xsl-list
[Top] [All Lists]

RE: [numbering selected nodes]

2004-02-19 01:37:02

<xsl:number level="any" count="ITEM[not(../TITLE="Raging River")]"
   format="w" ordinal="yes" lang="en"/>

(the last three attributes give you numbering in the form "first",
"second", "third" if you are using XSLT 2.0).

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
tsterlin(_at_)email(_dot_)arizona(_dot_)edu
Sent: 19 February 2004 03:28
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: 


Hello,
   I'm attempting to produce an HTML document from an XML one 
using XSLT.  I need to make a numbered list of a certain 
tag's(<ITEM>) info contained within the XML document.  This 
challenge here is that I only want certain <ITEM>s to be 
contained in my list while others should be omitted, however 
all <ITEM>s have the same ancestry.  The only distinguishing 
element is a sibling tag known as <TITLE> with different 
literal values stored in them.  It is the value stored in 
this <TITLE> that needs to determine the <ITEM>'s inclusion 
to or exclusion from the list:

<GROUP>
  <PARA0>
    <TITLE>Magic Mountains</TITLE>
    <STEP1>
      <ITEM>This is the first item.</ITEM>
    </STEP1>
    <STEP1>
      <ITEM>This is the second item.</ITEM>
    </STEP1>
  </PARA0>
  <PARA0>
    <TITLE>Raging River</TITLE>
    <STEP1>
      <ITEM>I don't want this item.</ITEM>
    </STEP1>
    <STEP1>
      <ITEM>I don't want this item either.</ITEM>
    </STEP>
  </PARA0>
  <PARA0>
    <TITLE>Spectacular Sky</TITLE>
    <STEP1>
      <ITEM>This is the third item.</ITEM>
    </STEP1>
    <STEP1>
      <ITEM>This is the fourth item.</ITEM>
    </STEP1>
  </PARA0>
</GROUP>

---------------The HTML output should be as follows:
             1.  This is the first item.
             2.  This is the second item.
             3.  This is the third item.
             4.  This is the fouth item.

Any ideas?







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



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



<Prev in Thread] Current Thread [Next in Thread>