Hello I need to transform a structure that looks like this
in a hierarchic structure like this (more or less)
I would like to do it with Mediator (with loops)
My problem is where to concatenate and build the ouptput structure.
Have you ever done something similar ?
J-F Declercq
Software AG Belgium
+32-2.777.03.28
http://jfd.lowas.be/
I found the response to my question here :
http://www.biglist.com/lists/xsl-list/archives/200208/msg01182.html
But as I have two levels of nesting, here is my final stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version=“1.0” xmlns:xsl=“XSLT Namespace”>
<xsl:template match=“/”>
<xsl:apply-templates select=“doc/a”/>
</xsl:template>
<xsl:key name=“childrenNotSiblingsOfA” match=“b” use=“generate-id[preceding-sibling::a[1])”/>
<xsl:key name=“childrenNotSiblingsOfB” match=“c” use=“generate-id[preceding-sibling::b[1])”/>
<xsl:template match=“a”>
<xsl:value-of select=“.”/>
<xsl:for-each select=“key[‘childrenNotSiblingsOfA’,generate-id[))”>
<xsl:value-of select=“.”/>
<xsl:for-each select=“key[‘childrenNotSiblingsOfB’,generate-id[))”>
<xsl:copy-of select=“.”/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The question is : what is the performance of such a stylesheet.
Jef
J-F Declercq
Software AG Belgium
+32-2.777.03.28
http://jfd.lowas.be/