|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE:adding hierarchy
<!-- 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
|
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








