RE: [xsl] Return position in for-each

Subject: RE: [xsl] Return position in for-each
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Jul 2004 17:09:32 -0700
[Michael Kay Wrote]
Incidentally,

  <xsl:variable name="x"><xsl:value-of select="y"/></xsl:variable>

should in 99.99% of cases be rewritten

  <xsl:variable name="x" select="y"/>


Michael,
I thought I was writing these variables out correctly.  I believed that your
suggestion was for when you were passing XML document fragments around (not
sure how to express that properly), where y might be of the source:

<x>
  <y/>
  <y/>
  <y/>
</x>



About my logic:
You have XML source <ABC/> with 50 <Entry> elements (which begins to look
like this):
<ABC>
  <Entry>
	<Element name="name"/>
	<Element name="country"/>
	<Element name="phone"/>
	... etc ...
  </Entry>
  <Entry>
	<Element name="name"/>
	<Element name="country"/>
	<Element name="phone"/>
	... etc ...
  </Entry>
  ... etc (50 times) ...
</ABC

Current Thread