[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: AW: grouping-problem i guess
Szabo, Patrick (LNG-VIE) wrote:
Here an input with more lists The following stylesheet produces the described result: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="liste"> <xsl:for-each-group select="*" group-starting-with="ziffernliste | strichliste"> <xsl:apply-templates select="current-group()[1]"/> </xsl:for-each-group> </xsl:template> <xsl:template match="ziffernliste"> <nummerierte-liste> <xsl:apply-templates select="listelem" mode="ziffer"/> </nummerierte-liste> </xsl:template> <xsl:template match="listelem" mode="ziffer"> <listnum> <xsl:value-of select="symbol"/> </listnum> <punkt> <xsl:apply-templates select="text()"/> <xsl:if test="position() eq last()"> <xsl:apply-templates select="current-group()[self::schluss]"/> </xsl:if> </punkt> </xsl:template> <xsl:template match="strichliste"> <liste> <xsl:apply-templates select="listelem" mode="strich"/> </liste> </xsl:template> <xsl:template match="listelem" mode="strich"> <punkt> <xsl:apply-templates select="text()"/> <xsl:if test="position() eq last()"> <xsl:apply-templates select="current-group()[self::schluss]"/> </xsl:if> </punkt> </xsl:template> <xsl:template match="schluss | listelem/text()"> <absatz> <xsl:value-of select="."/> </absatz> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://JavaScript.FAQTs.com/
|
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
|