P
Phil Jenkins
Hello there
I've inherited some code, which looks like this:
<!-- recreate the element (with its namespace) -->
<xsl:element name="{local-name()}" namespace="{namespace-uri()}">
<!-- if it has children... -->
<xsl:if test=".//">
<!-- process the children -->
<xsl:apply-templates/>
</xsl:if>
<!-- if it does not have children... -->
<xsl:if test="not(.//)">
<!-- recreate its value -->
<xsl:value-of select="."/>
</xsl:if>
</xsl:element>
Which seems to be a long winded <xsl:copy of> method - but the
important part is that the test for children -> ".//" no longer works
with a newer version of xerces - i'm getting an error along the lines
of "a location step was expected after the //".
So the question is - is there another more correct way of testing for
children right down the node tree, i'm sure there is but i'm stumped
with my limited xslt experience.
Thanks in advance
I've inherited some code, which looks like this:
<!-- recreate the element (with its namespace) -->
<xsl:element name="{local-name()}" namespace="{namespace-uri()}">
<!-- if it has children... -->
<xsl:if test=".//">
<!-- process the children -->
<xsl:apply-templates/>
</xsl:if>
<!-- if it does not have children... -->
<xsl:if test="not(.//)">
<!-- recreate its value -->
<xsl:value-of select="."/>
</xsl:if>
</xsl:element>
Which seems to be a long winded <xsl:copy of> method - but the
important part is that the test for children -> ".//" no longer works
with a newer version of xerces - i'm getting an error along the lines
of "a location step was expected after the //".
So the question is - is there another more correct way of testing for
children right down the node tree, i'm sure there is but i'm stumped
with my limited xslt experience.
Thanks in advance