Re: [xml] DOM Base URI (xml:base, RFC 2396)

Daniel O'Connor wrote:
> "
> The base URI of an element is:
>
>    1. the base URI specified by an xml:base attribute on the element,
> if one exists, otherwise
>    2. the base URI of the element's parent element within the document
> or external entity, if one exists, otherwise
>    3. the base URI of the document entity or external entity
> containing the element.
> "
> Again...
> $doc = new DOMDocument();
> $doc->load('http://foo.com');
>
> var_dump($doc->baseURI); // http://bar.com/
>
>
> What have I missed apart from libxml & xerces (and probably others)
> don't seem to do this at the moment?
>   
document nodes are not element nodes.
>   
>> So what you are saying is that currently no parser can be used for these
>>     
> tests.
>
> Well, there's a couple of different GRDDL implementations out there
> which do pass
> See http://www.w3.org/2001/sw/grddl-wg/td/test_results.html
>   
Those appear to be implementations built upon existing parsers. One even 
happens to be using libxml2. I still say that the xml:base 
clarifications in the GRDDL specs are specific to GRDDL. The current 
behavior of the existing XML parsers are correct in respects to how they 
handle base uri. When writing an implementation for GRDDL, you would 
need to use the base uri of the document element rather than from the 
document node in order to conform to the GRDDL specification in terms of 
the document's base uri.

Rob

Received on Sunday, 16 March 2008 14:19:22 UTC