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

Daniel Veillard wrote:
> 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.

>   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.

Oh, that's a shame. I'll have to find some other way around then.
I suspect I'll have to add an xml:base to all my included documents.

Can I offer a (very low-priority!) feature request, then - it would
be nice if there were an option (--baseURIfixup?)to treat external
entities like XInclude à la, and
insert xml:base attributes at the top-level of all external entities,
to workaround this problem without changing libxml2's data structures.

>> 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.

Yes it is different. I know there's no way to get at the base URI
using just standard XSLT (annoyingly, the XSL standard went to some
length to define base URI, but then offered no means to get at
it explicitly until version 2.0), I was wondering if xsltproc in
particular offered any non-standard extension which gave access to
it - but apparently not.

Thanks anyway,

Dr. Toby O. H. White
Dept. Earth Sciences,
Downing Street,
Cambridge CB2 3EQ
United Kingdom


Dr. Toby O. H. White
Dept. Earth Sciences,
Downing Street,
Cambridge CB2 3EQ
United Kingdom

Tel: +44 1223 333464
Fax: +44 1223 333450

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