[Home] [By Thread] [By Date] [Recent Entries]
On 14.10.2010 23:10, charlieo0@xxxxxxxxxxx wrote:
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. Or rather none of them. Here's a solution using just apply-templates: <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: The proposed solution inserts figure3 at another position than specified: just after its parent fgc2.1, rather than after fgc2.1.1. Is this ok? I couldn't devise a rule that inserts figure4 immediately after its parent fgc2.1.2, while figure3 won't be inserted immediately after its parent but after the first of fgc2.1's two children. <fnc code="020102" id="fgc2.1.2" parent-id="fgc2.1"/> <figure figid="4" parent-id="fgc2.1.2"/> </fgc_list> Proposed solution seems to be in accordance with this rule. -Gerrit
|

Cart



