[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to get position()

Subject: how to get position()
From: Vinoth Palaniappan <vinoth@xxxxxxxxxxxx>
Date: Fri, 2 Aug 2002 18:15:17 +0530
get position
Hi,
My problem is as follows:
I've a DTD: <!ELEMENT filterable_body_data (nv_pair*)> and the corresponding
xml document is: 
      <filterable_body_data>
         <nv_pair/>
         <nv_pair/>
      </filterable_body_data>
I've an XSL document for transferring this xml to a C++ header file. The XSL
file snippet is:
	<xsl:template match="filterable_body_data">
  		fill_filterable_body()
 		 {
			<xsl:for-each select="child::*">
				<xsl:apply-templates
select="."></xsl:apply-templates>
			</xsl:for-each>
		  }

	<xsl:template match="nv_pair">
		<xsl:number level="single" count="nv_pair" from="nv_pair"/>
	</xsl:template>

The "<xsl:number level="single" count="nv_pair" from="nv_pair"/>" in the
template match="nv_pair", I get a count sequentially from one(like 1,2,3..).
I would like to have count from zero(like 0,1,2..). I added
attribute-format="0" to the <xsl:number..> element and still the count is
done from one and not from zero. 
	Can you tell me how to do count of elements from zero. Thank you in
advance!
____________________________________________________________________________
___________
Vinoth
iDEN OMC Software, GSG
Motorola, India
voice: 91-040-3308090 extn:3208
____________________________________________________________________________
___________


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.