I'm looking to dynamically print out elements which exist in a control list using only native XSLT2.0 functions.
<xsl:variable name="controlList">name</xsl:variable>
<M N="name" V="Bill Billson"/>
<M N="address" V="1234 street name"/>
<M N="country" V="United Kingdom"/>
<M N="phone" V="123456789"/>
Output Required:
Bill Billson
Ultimately however it will need to cope with multiple values in the control list e.g.
<xsl:variable name="controlList">name,address,phone</xsl:variable>
So far i have tried many different permutations but not getting the required results.
<xsl:value-of select="M[@N='{$controlList}']/@V"/>
or
<xsl:for-each select="M">
<xsl:value-of select="/[@name=$controlList]/@V"/>
</xsl:for-each>
Any help would be greatly appreciated. This may not even be available with native XSLT2.0 functions