Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to copy a set of nodes stored in a variable in xslt 2.0

843834Feb 24 2010 — edited Feb 24 2010
I am trying to do something like this:

XSL
<xsl:variable name="setOfNodes" select="foo[@attr = 'bar']" />
<result>
<xsl:copy-of select="$setOfNodes/*" />
</result>
XML
<test>
<foo attr="bar" />
<foo attr="bar" />
<foo attr="different" />
<foo attr="bar" />
</test>
I want the result to look like this:
<result>
<foo attr="bar" />
<foo attr="bar" />
<foo attr="bar" />
</result>
But when I run the above xsl I get:
<result />
This seems like it should be pretty simple, I am probably just mixing something up. Does anyone have any ideas or suggestions for how to do this type of thing?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2010
Added on Feb 24 2010
2 comments
674 views