Subject: Re: [xsl] Group or sort? From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Thu, 14 Oct 2010 23:31:39 +0200 |
I seem to have a constant problem with getting the correct results with grouping. I have a problem I could use help with that is either a sort or grouping problem. Possibly both.
<xsl:template match="fgc_list"> <xsl:copy> <xsl:apply-templates select="fnc"/> </xsl:copy> </xsl:template>
<xsl:template match="fnc"> <xsl:copy-of select="." /> <xsl:copy-of select="../figure[@parent-id eq current()/@id]" /> </xsl:template>
Desired Result:
<fgc_list> <fnc code="01" id="fgc1"/> <fnc code="0101" id="fgc1.1" parent-id="fgc1"/> <figure figid="1" parent-id="fgc1.1"/> <figure figid="2" parent-id="fgc1.1"/> <fnc code="02" id="fgc2"/> <fnc code="0201" id="fgc2.1" parent-id="fgc2"/> <fnc code="020101" id="fgc2.1.1" parent-id="fgc2.1"/> <figure figid="3" parent-id="fgc2.1"/>
<fnc code="020102" id="fgc2.1.2" parent-id="fgc2.1"/> <figure figid="4" parent-id="fgc2.1.2"/> </fgc_list>
I need the<fnc> element to remain in the current order, but insert the sibling<figure> elements with the attribute "parent-id" where that value matches the "id" attribute of the preceding<fnc>.
Charles
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Group or sort?, charlieo0 | Thread | Re: [xsl] Group or sort?, David Carlisle |
[xsl] Group or sort?, charlieo0 | Date | Re: [xsl] Group or sort?, David Carlisle |
Month |