[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE:adding hierarchy

Subject: RE:adding hierarchy
From: Jim_Albright@xxxxxxxxxxxx
Date: Sun, 12 Oct 2003 23:07:33 -0400
add stanza
<!-- lineGroups add stanza  -->
<xsl:template match="blankLine">
        <xsl:choose>
                <xsl:when test="following-sibling::*[1]/self::lineGroup">
                        <!-- add stanza-->
                        <xsl:element name="lineGroup">
                                <xsl:attribute name="type">
                                        <xsl:text>stanza</xsl:text>
                                </xsl:attribute>
                                <!-- process all lineGroups using tail recurrsion -->
                                <xsl:if test="following-sibling::*[1]/self::lineGroup">
                                        <xsl:apply-templates select="following-sibling::*[1]" mode="stanza"/>
                                </xsl:if>
                        </xsl:element>
                </xsl:when>
        <xsl:otherwise>
                        <!-- toss out-->
        </xsl:otherwise>
        </xsl:choose>
</xsl:template>

<xsl:template match="lineGroup" name="lineGroup" mode="stanza">
        <xsl:copy-of select="."/>
                <!-- tail recurrsion -->
                <xsl:if test="following-sibling::*[1]/self::lineGroup">
                                        <xsl:apply-templates select="following-sibling::*[1]" mode="stanza"/>
        </xsl:if>
</xsl:template>

This puts the wrapper on but I will need to process lineGroups that are 
not preceded with a blankLine (which is legal to have).
Also I will need to skip processing lineGroups immediately preceded by a 
blankLine.

I am wondering if there isn't a more elegant 2.0 solution to this problem.

Jim Albright
704 843-0582
Wycliffe Bible Translators



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.