Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

populate a list xml xsl

Sear all,
How say this phrase:
<xsl:for-each select="/Component/Lists/List[@name = '@ListName' ]/Item">

where @ListName attribute of current node.


thanks,
0
ethar1
Asked:
ethar1
  • 2
1 Solution
 
Geert BormansInformation ArchitectCommented:
<xsl:variable name="listn" select="@ListName"/>
<xsl:for-each select="/Component/Lists/List[@name = $listn]/Item">
0
 
ethar1Author Commented:
can do it with another way , without using variable?
0
 
Geert BormansInformation ArchitectCommented:
what is the point in doing it without a variable?

it is XSLT no? I am pretty certain the most robust way is with a variable.
I guess you could use current(), but I find that less readable, easier to break in a later maintenance cycle and most likely less performant
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now