W3C home > Mailing lists > Public > www-svg@w3.org > June 2005

Re: SVG12: IRI Processing rules and xlink:href

From: Jon Ferraiolo <jon.ferraiolo@adobe.com>
Date: Tue, 07 Jun 2005 12:12:11 -0700
To: Andrew Sledd <Andrew.Sledd@ikivo.com>, www-svg@w3.org
Message-id: <>
At 04:40 AM 6/7/2005, Andrew Sledd wrote:
>The processing of references (section 14.1) seems clear in its 
>presentation but is a bit convoluted in practice, especially when combined 
>with error processing. It appears to me that the SVG spec only sets 
>restrictions on the resultant reference. The SVG spec defers completely to 
>the IRI/URI reference for requirements on reference resolution.
>I have a question about interpretation and reference resolution, in 
>particular about the reference xlink:href="". What does the reference 
>resolve to? Is it valid for image in the SVG Tiny Profile? Is it valid for 
>use and animation in the SVG Tiny Profile?
>I interpret the specs (SVG 1.2/IRI/URI) to say as follows:
>1) xlink:href="" resolves to a reference to the document itself (if no 
>other xml:base attribute is explicitly given in the ancestors to the 
>referencing element).

I think xlink:href="" is an error. The attribute definition references RFC 
2396 [http://www.faqs.org/rfcs/rfc2396.html]. Reading through that RFC, 
when you get to relative URIs in section 5, it says:

rel_path      = rel_segment [ abs_path ]
rel_segment   = 1*( unreserved | escaped |
                           ";" | "@" | "&" | "=" | "+" | "$" | "," )

The key thing is the "1*", which looks to me as if there must be at least 
one character in a relative URI.

Furthermore, even if "" were a valid relative URI, then I contend it would 
still not reference the document itself. To illustrate, let's say the 
current document has a URI of http://example.com/foo.svg. Then according to 
section 5.2 of RFC 2396, step 6a, for relative URI processing, it says:

          All but the last segment of the base URI's path component is
          copied to the buffer.  In other words, any characters after the
          last (right-most) slash character, if any, are excluded.

Therefore, assuming for the moment that it is not error, an attribute value 
of xlink:href="" would resolve to "http://example.com/", not 

But there are greater URI experts around. (I am surprised none of them have 
spoken up so far.)


>2) In terms of IRI processing (Section 14.1.1) this is both a local 
>reference and for the scope of <image> and <use> is an indirect circular 
> From this I conclude that xlink:href="" to be invalid and put the 
> document in error

>a) for <use> and <animation>; except in the case where its resolved 
>xml:base breaks this inherent circular reference
>b) for <image>; except in the case where its resolved xml:base is a 
>non-local reference
>Is this reasoning correct?
>Andy Sledd
>Andrew Sledd
>Ikivo AB
Received on Tuesday, 7 June 2005 19:17:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:06 UTC