xml-xalan-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinoth Palaniappan <vin...@mihy.mot.com>
Subject RE: how to find position?
Date Wed, 31 Jul 2002 12:38:15 GMT
	I changed from <xsl:number value="position()"> to <xsl:number
level="1"/> inside <xsl:template match="nv_pair"> and it is counting all
"nv_pair" elements as one, two, three... But i want this to be counted from
zero. I changed the <xsl:number level="1"/> to <xsl:number format="0"/> and
the nv_pair elements are not being counted from zero as expected; Instead,
they are still being counted from one. Am i missing something in using
format attribute??

____________________________________________________________________________
___________
Vinoth
iDEN OMC Software, GSG
Motorola, India
voice: 91-040-3308090 extn:3208
____________________________________________________________________________
___________


-----Original Message-----
From: Vinoth Palaniappan [mailto:vinoth@motorola.com]
Sent: Wednesday, July 31, 2002 1:29 PM
To: xalan-c-users@xml.apache.org
Subject: how to find position?


Hi All,
	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>

  }
When I use "position()" inside <xsl:template match="nv_pair">
....</xsl:template > I always get a value one which i think is corresponding
to it's parent <filterable_body_data>. My doubt is how can i get the
position of nv_pair element inside the XSL snippet <xsl:template
match="nv_pair"> ....</xsl:template > .

thanks for reading through.
____________________________________________________________________________
___________
Vinoth
iDEN OMC Software, GSG
Motorola, India
voice: 91-040-3308090 extn:3208
____________________________________________________________________________
___________

Mime
View raw message