Subject: Re: [xsl] Proper syntax for counting all prior nodes in XPath? From: Johannes Döbler <jd@xxxxxxxxxxxxxx> Date: Mon, 11 Jun 2001 19:49:08 +0200 |
Hi,
With an XML document like this: <DOC> <CHAPTER> <SECTION> <PAGE> <LINE>Test</LINE> <LINE>Test 2</LINE> </PAGE> </SECTION> <SECTION> <PAGE> <LINE>Test 3</LINE> </PAGE> </SECTION> </CHAPTER> </DOC>
How can my XSL count all the preceding nodes? For example, when my template is processing the <LINE>Test 3</LINE>, I want to count all nodes before it, which would be 2 <LINE>s, 2 <PAGE>s, 2 <SECTION>s, 1 <CHAPTER>, and 1 <DOC>. Does this make sense?
It would be something like <xsl:number level="any" count="DOC|CHAPTER|SECTION|PAGE|LINE"/>, except I want to use the count in an <xsl:if />, not just display it. I have tried using <xsl:if test="count(something)">, but I do not know what the proper "something" is. Any suggestions?
Thanks Jason
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Proper syntax for countin, Bob DuCharme | Thread | RE: [xsl] Multiple Selects Revisite, Clapham, Paul |
Re: [xsl] checking if an attribute , Bob DuCharme | Date | RE: [xsl] Multiple Selects Revisite, Clapham, Paul |
Month |