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]

AW: Variables


Devan,

imagine you have something like
.
.
<xsl:for-each select="TABLE/child::*[name()='PRICE']">
	<xsl:value-of select="."/>
	.
	.
</xsl:for-each>

that means, that all PRICE-grandchildren of the current node, which have
TABLE-parents will be processed.
With exactly the same pattern you can count the 'loops'.

<xsl:variable name="temp"
select="17+count(TABLE/child::*[name()='PRICE'])"/>

when you need counting in the 'loop', simply use 
	<xsl:value-of select="count()"/>
in the <xsl:for-each...> Element
Michael.


-----Ursprungliche Nachricht-----
Von: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]Im Auftrag von Devan
Govender
Gesendet: Donnerstag, 12. Juli 2001 16:19
An: xsl-list@lists.mulberrytech.com
Betreff: [xsl] Variables


  <xsl:variable name="temp">
    <xsl:value-of select="1"/>
  </xsl:variable>

How would I go about incrementing the above variable in a for-each tag
??


-- 
"I count religion but a childish toy, and hold there is no sin but 
ignorance." -Christopher Marlowe, 1592

"HEAVEN does'nt want me & HELL is afraid I'll take over"

DEVAN GOVENDER

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

 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]