|
Subject: [xsl] Converting siblings to children of a node. From: "Shawn O. McKenzie" <smckenzie@xxxxxxxxxxx> Date: Wed, 06 Aug 2003 18:22:37 -0700 |
<longdesc> <para style="Normal">This is a regular paragraph.</para> <para style="Normal">So is this but what follows is a list:</para> <para style="LS1">Item one</para> <para style="LS1">Item two</para> <para style="Normal">This is a regular paragraph.</para> <para style="Normal">This is a regular paragraph.</para> <para style="Normal">This is a regular paragraph.</para> <para style="Normal">What follows is a list:</para> <para style="LS1">Item one</para> <para style="LS1">Item two</para> <para style="LS1">Item three</para> <para style="Normal">This is a regular paragraph.</para> </longdesc>
<p>This is a regular paragraph.</p> <p>So is this but what follows is a list:</p> <ul> <li>Item one<li> <li>Item two<li> </ul> <p>This is a regular paragraph.</p> <p>This is a regular paragraph.</p> <p>This is a regular paragraph.</p> <p>What follows is a list:</p> <ul> <li>Item one<li> <li>Item two<li> <li>Item three<li> </ul> <p>This is a regular paragraph.</p>
<xsl:if test="@style='LS1'">
<xsl:if test="not(preceding-sibling::para/@style='LS1')">
<ul>
<li><xsl:value-of select="."/></li>
</xsl:if><xsl:template match="para[@style='LS1']">
<xsl:if test="not(preceding-sibling::para[@style='LS1'])">
<xsl:variable name="node">
<xsl:copy-of select="."/>
</xsl:variable>
<ul>
<xsl:call-template name="list">
<xsl:with-param name="listitem" select="$node"/>
</xsl:call-template>
</ul>
</xsl:if>
</xsl:template><xsl:template name="list">
<xsl:param name="listitem"/>
<li><xsl:value-of select="$listitem"/></li>
<xsl:if test="following-sibling::para[@style='LS1']">
<xsl:call-template name="list">
<xsl:with-param name="listitem">
<xsl:copy-of select="following-sibling::para"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Antenna House XSL Formatter B, Keiko Hiraide | Thread | Re: [xsl] Converting siblings to ch, Mark Brand |
| [xsl] Antenna House XSL Formatter B, Keiko Hiraide | Date | Re: [xsl] Converting siblings to ch, Mark Brand |
| Month |