W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > May 2006

Canonicalization xml:base processing

From: Richard Tobin <richard@inf.ed.ac.uk>
Date: Wed, 10 May 2006 18:02:08 +0100 (BST)
To: public-xml-core-wg@w3.org
Message-Id: <20060510170208.961835E4862@macintosh.inf.ed.ac.uk>

To fix up the xml:base attribute of an element E:

If the base URI of the immediate container of E is known (and is
therefore by definition absolute), determine the base URI of E
according to xml:base.  Set the xml:base attribute to this value.

If the base URI of E's container is not known (which can only be the
case if the base URI of the document is unknown, and there is no
ancestor element with an absolute xml:base attribute), proceed as
follows:

 - if there is no ancestor with an xml:base attribute, leave E's
   xml:base attribute (if any) unchanged;

 - if the nearest ancestor with an xml:base is not being omitted,
   leave E's xml:base attribute (if any) unchanged;

 - otherwise we must construct an xml:base attribute giving E's base
   URI relative to the nearest non-omitted ancestor with an xml:base
   attribute; call this ancestor A).  Find the xml:base attributes of
   the omitted ancestor elements between A and E.  Take these in
   outer-to-inner order, followed by the E's xml:base attribute if it
   has one.  This is a sequence of relative URIs.  Discard the last
   segment - the characters after the last slash - of all but the last
   of these.  If any of these URIs has no slash character, discard it
   completely.  Concatenate the resulting strings, and use this as the
   xml:base attribute of E.

-- Richard
Received on Wednesday, 10 May 2006 17:02:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:33 GMT