Re: [xml] Possible bug in interaction of xml:base and external entities

On Fri, Sep 21, 2007 at 05:58:44PM +0100, Toby White wrote:
I *think* xmllint is defining xml:base wrongly in
the presence of external entities - but I'm prepared
to be told I'm wrong or I'm using xmllint inappropriately.

Consider the pair of documents:

1: wrapper.xml

<!DOCTYPE wrapper [
<!ENTITY contents SYSTEM "subdir/contents.xml">

2: subdir/contents.xml


If I open up wrapper.xml in the xmllint --shell, without
using "--noent", then I can't look inside the &contents;
entity (or at least, I can't find a way to do so)

So instead, if I open it up using xmllint --noent --shell,
then take a look at the <node/> inside &contents; and
ask for its base URI, I get told "wrapper.xml", when in fact
the base URI ought to be "contents.xml", or possibly
"subdir/contents.xml" - or so it seems to me, anyway.

How ought I to use xmllint to inspect nodes inside entity

  Known problem, there is no way in the libxml2 tree model to add the
informations about the change of base after entities have been substitued.
If you don't substitute, you get an entity reference node which should
have the path and hence the base of nodes from the entity can be computed.
xml:base was added to the XML standard stack after libxml2 datastructures
design was completed, unfixeable without breaking the ABI in some ways.

In a similar vein, when using xsltproc, are there any extension
functions which allow me to access the base URI of a node?

  not sure
looks different from what you need.


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]