Subject: Re: [xsl] Path according to a child node attribute From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sat, 31 Dec 2011 11:59:51 +0100 |
I'm founding difficulties on adding a child element as last child of the node (i.e.<Path>) and on making the right path building (i.e. accessing the attributes and values of the father, of the grandfather or of the great grandfather based on the SuperClass code of each Class). Using SaxonHE9-4-0-1J.
Any ideas? Thanks in advance
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template>
<xsl:template match="Class" mode="path"> <xsl:variable name="next" select="key('k1', SuperClass/@code)"/> <xsl:if test="$next"> <xsl:apply-templates select="$next" mode="path"/> <xsl:text>/</xsl:text> </xsl:if> <xsl:value-of select="concat(@code, ' ', Rubric)"/> </xsl:template>
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Path according to a child nod, Gian Paolo Bernardin | Thread | [xsl] why get the value not be calc, Roelof Wobben |
[xsl] Path according to a child nod, Gian Paolo Bernardin | Date | RE: [xsl] where's here the error, Roelof Wobben |
Month |