I have the following xml
<root>
<element id='1'>blah</element>
<element id='2'>blah</element>
<element id='3'>blah</element>
</root>
A parm passed into my xsl that is..
<Ids>
<id>1</id>
<id>2</id>
<id>3</id>
</Ids>
In my xsl I want to loop through both the parm and xml to match any elements with id attribute that equals one of the parm id values.This is dynamic and I will not know the values of either they will be uuids.
I’ve tried this but I the of element id is not found
<xsl:for-each select="/$Ids/id">
<xsl:variable name="driverId" select="."/>
<xsl:for-each select="/root/element[@id=$driverId]">
//do something
</xsl:for-each>
</xsl:for-each>
If message out the value of element id before the first for each I can see all the values but not with in the loop.. Is this possible in the way I’m thinking about doing it.
Still not working, I’ve changed the to
same results.
In the xsl if I put outside the parm for-each
<test><xsl:for-each select="/root/element/@id"></test>
I get
<test>1 2 3</test>
IF put
<test><xsl:for-each select="/root/element/@id"></test>
inside
<xsl:for-each select="$Ids/id">
I get nothing returned???
Define a key
then you also need a reference to the primary input document with a global
xsl:variablei.e.once you have that use
Without a key you need