|
Subject: Re: [xsl] Grouping of Tags From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Fri, 20 Jun 2003 21:22:29 +0200 |
In my XML I have two types of tags. My result should be a table where I want for every block of the first tag a new row which contains all the following second tags....
The key is to formulate the condition which should apply to the
<second> elements: following the actual <first>, and the first
preceding <first> of this <second> should be the actual <first>.
In XPath:
<xsl:template match="first">
<tr>
<td><xsl:copy-of select="."/></td>
<td>
<xsl:copy-of select=following-sibling::second[
generate-id(previous-sibling::first)
= generate-id(current())]"/>
</td>
</tr>
</xsl:template>Beware: untested. May also be less efficient than other approaches, try alternative formulations of the condition.
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Grouping of Tags, Marc Baumgartner | Thread | RE: [xsl] Grouping of Tags, Américo Albuquerque |
| RE: [xsl] Optimizing Trax, Schwartz, Rechell R, | Date | RE: [xsl] xsl:number problem, Wendell Piez |
| Month |