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

 If the behavior for determining the base uri of the document entity is
 really supposed to be determined by an xml:base attribute on the
 document element, then imo, this is something that needs to be addressed
 in the xml:base specs and not elsewhere.

"The attribute xml:base  may be inserted in XML documents to specify a
base URI other than the base URI of the document or external entity."

Which sounds to me like:
<!-- document @ -->
<Foo xml:base=""; />

should be (in psuedocode)
$doc = new DOMDocument();

var_dump($doc->baseURI); //

Then there's...

"The base URI of a document entity or an external entity is determined
by RFC 2396 rules, namely, that the base URI is the URI used to
retrieve the document entity or external entity."

$doc = new DOMDocument();
$doc->load(''); //no xml:base anywhere
var_dump($doc->baseURI); //

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.
$doc = new DOMDocument();

var_dump($doc->baseURI); //

What have I missed apart from libxml & xerces (and probably others)
don't seem to do this at the moment?

So what you are saying is that currently no parser can be used for these

Well, there's a couple of different GRDDL implementations out there
which do pass

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]