W3C home > Mailing lists > Public > www-svg@w3.org > January 2006

[SVGMobile12] Concern about "Relative to absolute IRI conversion" attribute normalization

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 19 Jan 2006 13:12:45 -0600
Message-ID: <43CFE4AD.2070104@mit.edu>
To: www-svg@w3.org

I'm not quite sure what the "Relative to absolute IRI conversion" 
attribute normalization possibility really means.  For example, consider 
the following markup (the "svg" prefix is bound to the SVG namespace; 
the "xlink" prefix is bound to the XLink 1.0 namespace) found in a 
document with document URI <http://www.example.com/>:

   <svg:a xlink:href="relative.txt"/>

If I getAttributeNS the xlink:href attribute, what values is a 
conforming SVG UA allowed to return?  Is "relative.txt" allowed?  What 
about "http://www.example.com/relative.txt"?

Now consider the following slightly modified markup:

   <svg:a xlink:href="relative.txt" xml:base="subdir/"/>

In this case, if I getAttributeNS the xlink:href attribute, is 
"http://www.example.com/subdir/relative.txt" an allowed value?

If so, then does this mean that the value that getAttributeNS returns 
for xlink:href depends dynamically on the value of xml:base?  More 
precisely, given the markup and script (still located at the same 
document URI):

   <svg:a xml:id="id" xlink:href="relative.txt">
      var a = document.getElementById("id");
      var first =
        a.getAttributeNS("http://www.w3.org/1999/xlink", "href");
      a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "base",
      var second =
        a.getAttributeNS("http://www.w3.org/1999/xlink", "href");
      a.setAttributeNS("http://www.w3.org/1999/xlink", "href",
      a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "base",
      var third =
        a.getAttributeNS("http://www.w3.org/1999/xlink", "href");

can |first| and |second| end up with different values?  Can |second| and 
|third| end up with different values?  Note that the only thing that 
happened between |second| and |third| is that I set xml:base, then set 
an attribute to the value it already had, then unset xml:base; the net 
effect really should not be that the value of the attribute in question 

Or is the intent that URI normalization happens at parse time only and 
thus xml:base doesn't affect URIs in SVG 1.2 unless they're specified 
via setAttributeNS dynamically?

At the very least these issues should be clarified.  As an implementor, 
I can't tell what's a valid behavior here.

Received on Thursday, 19 January 2006 20:05:57 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:06 UTC