This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]