Subject: Re: [xsl] From flat to hierarchical structure From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 22 Oct 2014 11:34:04 -0000 |
I need to convert a flat structure like this
<root> <H>1</H> <I>1-1</I> <I>1-2</I> <I>1-3</I> <H>2</H> <I>2-1</I> <I>2-2</I> </root>
in one like this
<root> <H> 1 <I>1-1</I> <I>1-2</I> <I>1-3</I> </H> <H> 2 <I>2-1</I> <I>2-2</I> </H> </root>
<xsl:template match="root"> <xsl:copy> <xsl:for-each-group select="*" group-starting-with="H"> <xsl:copy> <xsl:apply-templates select="node(), current-group() except ."/>
<xsl:template match="root"> <xsl:copy> <xsl:apply-templates select="H"/> </xsl:copy> </xsl:template>
<xsl:template match="H"> <xsl:copy> <xsl:apply-templates select="node() | key('group', generate-id())"/> </xsl:copy> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] From flat to hierarchical str, nick public nickpubl | Thread | Re: [xsl] From flat to hierarchical, Hank Ratzesberger xm |
[xsl] From flat to hierarchical str, nick public nickpubl | Date | Re: [xsl] Parse a date - exslt:pars, Kerry, Richard richa |
Month |