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 http://www.w3.org/TR/xinclude/#base, 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 http://www.w3.org/TR/xslt#function-unparsed-entity-uri > 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, Toby -- Dr. Toby O. H. White Dept. Earth Sciences, Downing Street, Cambridge CB2 3EQ United Kingdom Web: http://uszla.me.uk -- Dr. Toby O. H. White Dept. Earth Sciences, Downing Street, Cambridge CB2 3EQ United Kingdom Tel: +44 1223 333464 Fax: +44 1223 333450 Web: http://uszla.me.uk _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
