[Home] [By Thread] [By Date] [Recent Entries]
Hi, Andy,
Here's a similar transform, to move a client's custom XML structure to DocBook: <xsl:for-each-group select="*" group-starting-with="Heading1"> <section> <xsl:apply-templates select="current-group()[self::Heading1]" /> <xsl:for-each-group select="current-group() except ." group-starting-with="Heading2"> <xsl:choose> <xsl:when test="self::Heading2"> <section> <xsl:apply-templates select="current-group()[self::Heading2]" /> <xsl:for-each-group select="current-group() except ." group-starting-with="Heading3"> <xsl:choose> <xsl:when test="self::Heading3"> <section> <xsl:apply-templates select="current-group()[self::Heading3]" /> <xsl:for-each-group select="current-group() except ." group-starting-with="Heading4"> <xsl:choose> <xsl:when test="self::Heading4"> <section> <xsl:apply-templates select="current-group()[self::Heading4]" /> <xsl:for-each-group select="current-group() except ." group-starting-with="Heading5"> <xsl:choose> <xsl:when test="self::Heading5"> <section> <xsl:apply-templates select="current-group()[self::*]" /> </section> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()[self::*]" /> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </section> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()[self::*]" /> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </section> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()[self::*]" /> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </section> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()[self::*]" /> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </section> </xsl:for-each-group> As you can see, it chews its way through 5 levels of heading to create nested section elements.Then other templates handle the elements within the sections. HTH Jay Bryant Bryant Communication Services ----- Original Message ----- From: "Andy Carr1" <CARRA@xxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, February 21, 2007 3:05 AM Subject: Re: xsl-list Digest 21 Feb 2007 06:10:00 -0000 Issue 1055 Jay
|

Cart



