Re: xml:base handling

On Feb 25, 2014, at 8:37 AM, Jan Wielemaker <J.Wielemaker@vu.nl> wrote:

> Hi,
> 
> While making process with the SWI-Prolog RDFa implementation, I'm struggling with xml:base for the XML test suite.  The spec says
> this must be set when creating the initial context, but XML seems
> to allow for zero or more xml:base attributes anywhere in the
> tree.
> 
> What is supposed to happen here?
> 
>  - Scan the tree for xml:base when creating the initial context?
>    Then, what if there are two of them (with a different base).
>  - Update the context as we see xml:base, similar as to what we
>    do for xml:lang processing?

Scan for <base> element in <head> (HTML-varieties only) and use this as document base in favor of document location. For XHTML5 and XML and SVG (really, anything other then XHTML1, HTML4 or HTML5, if the current element has an xml:base attribute, use it as the new base within the context of that element, resolving relative IRIs against the base in effect when starting to process the element.

Tests 0202 and 0203 check for this in the test suite [1].

Gregg

[1] http://rdfa.info/test-suite/#

> 	Thanks --- Jan
> 

Received on Sunday, 20 April 2014 19:47:47 UTC