Re: [xslt] Bug in external entity handling in xsltproc?



On Fri, Sep 08, 2006 at 11:57:39AM -0400, Norman Walsh wrote:
> I think there's a bug in xsltproc's handling of namespaces and
> external parsed entities. Or a bug in my understanding of the relevant
> specs :-)
> 
> Consider book.xml which includes Links.xml by way of entity reference:
> 
> <?xml version='1.0'?>
> <!DOCTYPE book [
> <!ENTITY links SYSTEM "Links.xml">
> ]>
> <book xmlns="http://docbook.org/ns/docbook";>
> ...
> &links;
> ...
> </book>
> 
> where Links.xml is just a para:
> 
> <para>...</para>
> 
> If I process this with showns.xsl, I get (in part:)
> 
> Found {http://docbook.org/ns/docbook}book
> Found {http://docbook.org/ns/docbook}info
> ...
> Found {}para
> ...
> 
> It appears that xsltproc "forgets" the in-scope namespace declarations
> when it expands the external parsed entity. I think that's a bug.

  Yes known b ug. the parsing of the entities doesn't see the namespace 
declarations from the reference point, the parsing being done out of context.
The origin lays in libxml2 being designed for authoring, I wanted multiple
entities references to share the same subtree at the time, this was mostly 
okay before namespaces. I should revisit the issue since nobody really 
author XML as XML and  entities are just a design mistake if you think of them
as shared docuemnt part as we used to. Oh well, sorry, just repeat your 
namespaces declarations, it will also ease the transition to to XInclude for
those use cases...

Daniel


-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


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