[xslt] Namespace problem
- From: Bjorn Reese <breese mail1 stofanet dk>
- To: "xslt gnome org" <xslt gnome org>
- Subject: [xslt] Namespace problem
- Date: Mon, 30 Apr 2001 15:42:31 +0000
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]