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

On Sat, Mar 15, 2008 at 09:59:30PM +1030, Daniel O'Connor wrote:
Hey all,
I'm causing trouble for Richard by asking for things like:

Basically, what happens in the following scenarios with the baseURI of
a document?

 1. A document is loaded from a URI (
 2. An xhtml document is loaded from a URI  (, but has
a <base href=""; />
 3. An xml document is loaded from a URI, but has an <Foo
xml:base=""; />
 4. An xml document is loaded from a URI, which was redirected (GET redirected to
 5. An xml document is loaded, and has an xml:base attribute - but
it's not on the root element (/Foo/bar[ xml:base])

From what I read of, section 5.1
& on, I think it should be:

2a. Unless the implementation understands xhtml / html -

  that's an interpretation on top of the original XML view


  Wrong, the base applies only to the element carrying the xml:base and below.
If you ask for the *document base* the document node is an ancestor of Foo
and the answer is still the original URI


  xmlCheckHTTPInput does this, it's called by xmlNewInputFromFile() in libxml2
it is possible it may be missing in some case, or the PHP I/O architecture
doesn't do something similar.


  Wrong, same misunderstanding as 3/

The current behavior for PHP (using libxml2 2.6.31) isn't that.

  I can't tell for PHP, but at least 2 of your expectations are clearly
wrong from purely a spec perspective.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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