List Info

Thread: Problem with xsltParseStylesheetImportedDoc /xsltGatherNamespaces




Problem with xsltParseStylesheetImportedDoc /xsltGatherNamespaces
user name
2006-08-30 14:07:38
Hi, 

> -----Original Message-----
> From: xml-bouncesgnome.org [mailtoml-bo
uncesgnome.org] On 
> Behalf Of Christopher R. Palmer
> Hi,
> 
> I just upgraded to libxslt-1.1.17 and found what
appears to 
> be a bug in the 
> the stylesheet creation.  In version 1.1.15, the code
in 
> xsltParseStylesheetImportedDoc was:
> 
>      ...
>      ret->doc = doc;
>      ret->parent = style;        /* needed to
prevent loops */
>      xsltGatherNamespaces(ret);
>      ...
> 
> and the current code (removing the ifdefs) is:
> 
>      retStyle->parent = parentStyle;
>      ...
>      xsltGatherNamespaces(retStyle);
>      retStyle->doc = doc;
> 
> In xsltGatherNamespaces, it collects all the namespaces
from 
> the ->doc 
> which it can no longer do because the doc has not been
set 
> before calling it.
> 
> The attached patch fixes the problem by setting the doc

> before calling the 
> gather function.  I included an #ifndef on the
assumption 
> that it should 
> not be set in the new refactoring code (but that was
just a guess).

Yes, the xsltGatherNamespaces() function is not needed in
the refactored code paths.

The fact that this bug (I'm pretty sure it was me who
invented this bug) in the normal code paths survived the
regression tests, should encourage us to get rid of
calling xsltGatherNamespaces(), as its usage restricts the
stylesheet to have distinct prefixes; i.e., it disallows
a specific prefix to be bound to different namespace names.

Could you compile and send the scenario where the current
behaviour (no build of a namespace-hash) produces problems?
Maybe we can fix your issue without usage of the namespace
hash.

(by the way: please direct Libxslt-related issues to
xsltgnome.org)

Regards,

Kasimier

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )