[
Lists Home |
Date Index |
Thread Index
]
- From: Steve Rowe <sarowe@textwise.com>
- To: "Raheja, Dhruv (TRANS)" <Dhruv.Raheja@Trans.ge.com>, xml-dev@lists.xml.org
- Date: Wed, 02 Aug 2000 18:19:30 -0400
Try this:
<xsl:template match="new_num_list">
<ol>
<xsl:apply-templates/>
</ol>
</xsl:template>
<xsl:template match="num_list">
<li><xsl:value-of select="."/></li>
</xsl:template>
<!-- The <p></p>'s between <li></li>'s allows the numbering to
continue. -->
<xsl:template match="note|caution|warning">
<p><b><xsl:value-of select="."/></b></p>
</xsl:template>
Steve Rowe
MNIS-TextWise Labs
Raheja, Dhruv (TRANS) wrote:
>
> hi everybody,
> i am trying to display my XML
> information using an
> enumerated list. i am generating that list in XSL using the
> <ol><li>----</li></ol> . Each individual enumerated
> sentence is an element
> called <num_list>. The structure is as follows:
> <new_num_list>
> <num_list>
> ---------------
> </num_list>
> <note>
> ------------
> </note>
> <num_list>
> -------------
> <num_list>
> <new_num_list>
>
> The problem is that in the <new_num_list> element i also
> have other elements
> (<note>, <warning>, <caution>) that may occur between the <num_list>
> elements. What I want to do is insert <note> and/or <warning> and/or
> <caution> without affecting the numbering of <num_list>.
> what i mean is
> that the first <num_list> in the above code should be
> numbered 1 and the
> second <num_list> should be numbered 2 with the <note>
> inserted between
> them.
>
> In the stylesheet i have the following code:
>
> <xsl:template match="new_num_list">
> <ol>
> <xsl:for-each select="num_list">
> <li><xsl:value-of select="."/></li>
> </xsl:for-each>
> </ol>
> </xsl:template>
>
> Although this allows me to number the <num_list> elements,
> it doesnt allow
> me to insert <note> in between. I tried to add <xsl:apply-templates
> select="note"> after the </ol> tag but obviously what it
> does is that it
> puts the <note> after numbering all the <num_list> elements.
>
>
> Can someone please tell me what to do?
|