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="";>
> ...
> &links;
> ...
> </book>
> where Links.xml is just a para:
> <para>...</para>
> If I process this with showns.xsl, I get (in part:)
> Found {}book
> Found {}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...


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]