|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: grouping adjacent siblings
> I am trying to transform the following...
>
> <frag>
> <b>house</b>
> <a>door</a>
> <a>wall</a>
> <a>room</a>
> <b>barn</b>
> <a>hay</a>
> <a>cow</a>
> <a>poo</a>
> </frag>
>
You can do this with something like
<xsl:for-each select="b">
<xsl:variable name="id" select="generate-id()"/>
<xsl:apply-templates/>
<xsl:for-each
select="following-sibling::a[generate-id(preceding-sibling::b[1])=$id]">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








