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]

RE: Current position in WD namespace


>In the http://www.w3.org/TR/WD-xsl namespace, is there a way to get the
>current position in an xsl:for-each loop? 

Ok, think differently for wd-xsl.  All you need to do to get the current
position in the for-each is to call a function each time that increments
by 1.  So, you would use something like:

<xsl:eval>resetCounter()</xsl:eval>
<xsl:for-each select="metadata/dataqual/lineage/procster">
  <xsl:eval>getCounter()</xsl:eval> 
  <xsl:value-of select="."/>
</xsl:for-each>

then within your <xsl:script> :

int counter = 1;
funtion resetCounter() {
  counter=1;
}
function getCounter() {
  return counter++;
}


Remember that Microsft itself has dropped wd-xsl - there is no support
for it in msxml4, so whatever your are working on now wont be very
useful in the future :)

cheers
andrew


-----Original Message-----
From: Mike Leahy [mailto:mgleahy@fes.uwaterloo.ca]
Sent: 02 July 2002 21:01
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Current position in WD namespace


In the http://www.w3.org/TR/WD-xsl namespace, is there a way to get the
current position in an xsl:for-each loop?  Essentially, I would like to
create a numbered list of the values in a series of "procstep" tags
within
the "metadata/dataqual/lineage" tag in my XML files.

I know this namespace is outdated, but it's what I have to work with for
the
time being.

Any help is appreciated.

Mike


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





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

 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]