|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: problem with enumerated lists
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?
|
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








