Re: xml:base

> I see (responding to your point about it not being related to ancestor 
> elements). But I was trying to find somewhere where the issue was made 
> explicit as to how xml:base is not only based on the parent, since there 
> are these following lines (and basically only these lines on the topic) 
> which only refer to "parent element" and not clearly to an indefinite 
> number of levels of inheritance of within the document (and regardless 
> of whether xml:base was explicitly present on the parent or not, etc.):
> 
> "The base URI of an element is...the base URI of the element's parent 
> element within the document or external entity, if one exists..."
> 
> "The base URI for a URI reference appearing in an |xml:base| attribute 
> is the base URI of the parent element of the element bearing the 
> |xml:base| attribute, if one exists within the document entity or 
> external entity, otherwise the base URI of the document entity or 
> external entity containing the element."
> 
> Maybe that is made clear in other referenced specs, but since this seems 
> to be such a central point of the spec, I would think clarifying that 
> would be helpful.

The answer follows from the rules you quote above.  Given

<a xml:base="http://example.com">
  <b>
    <c> ...

the base URI of the <c> element is (by 4.2 part 2) the base URI
of the <b> element.  Similarly, the base URI of the <b> element
is the base URI of the <a> element.  And by 4.2 part 1, the base
URI of the <a> element is "http://example.com".

-- Richard

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Received on Monday, 3 November 2008 15:37:44 UTC