[xslt] Namespace problem



The attached files triggers a problem with namespaces.

I believe that the problem is found in pattern.c / xsltCompileStepPattern
in the line that says (actually, there are three of these lines, and the
problem may pertain to all of them, although I have only experienced it
for the last of the three lines)

  ns = xmlSearchNs(ctxt->doc, ctxt->elem, prefix);

There seems to be a mismatch between the two first parameters and the
last. The two first parameters are pointing to data within the xsl
file, but the prefix parameter contains the namespace from the xml
file. So it tries to find the 'ns' namespace in the xsl file, starting
from the <xsl:template match='ns:root'> line.

This was tested against the latest CVS version.
<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
 version="1.0">

<xsl:output method="text"/>

<xsl:template match="ns:root">
  RIGHT
</xsl:template>

<xsl:template match="/">
  WRONG
</xsl:template>

</xsl:stylesheet>
<ns:root xmlns:ns="whatever">
  <something/>
</ns:root>


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