Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - How to use elements which belong to another node-set? >Thread Next - Re: How to use elements which belong to another node-set? Re: How to use elements which belong to another node-set?To: NULL Date: 2/3/2005 3:33:00 PM Tempore 16:23:07, die Thursday 03 February 2005 AD, hinc in foro {microsoft.public.xsl} scripsit jim <jim@d...>:
> So, for the first <xsl:for-each>, I can get value of TimeStamp/@val which is
> belong the first node-set, No problem. After entering second <xsl:for-each>
> which it bring the second node-set, so my question is: How can I use the
> elements which is belong to the first node-set within the second
> <xsl:for-each> or within the second node-set context?
Hi,
In xslt1.0, you can store node-sets in variables.
So you could use e.g.:
<xsl:for-each select="/Inventory/InventoryItem">
<xsl:element name="FromInventory">
<xsl:value-of select="TimeStamp/@val" />
</xsl:element>
<xsl:variable name="node-set1" select="."/>
<xsl:for-each select="$fielddef/type[@name='Resp_Inventory']/field">
<xsl:element name="Inventory2">
<xsl:value-of select="$node-set1/TimeStamp/@val" />
</xsl:element>
</xsl:for-each>
</xsl:for-each>
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"Et ipsa scientia potestas est" - Francis Bacon , Meditationes sacrae
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
