jetski Posted March 25, 2006 Share Posted March 25, 2006 I am trying to use a parameter to as part of the element name in Xpath in order to select a certain element, but cannot get it to work. I want to select element named either Artist1,Artist2,Artist3,...ArtistNdepending on the value 'N' of parameter $ArtistCount, passed to the template.I have tried all combinations of quotation marks and parenthesis, this is a typical example. <xsl:when test="boolean($thisSong/Artist'string($artistCount)')"> and <xsl:when test="boolean($thisSong/Artist{string($artistCount)})"> However I have managed to use parameters as part of the element name I am creating. (using the name attribute in xsl:element) <xsl:element name="RPI_{string($artistCount)}"> Is there a way to use a parameter's value as part of the element name in Xpath? Link to comment Share on other sites More sharing options...
jetski Posted May 10, 2006 Author Share Posted May 10, 2006 (edited) I am assuming from lack of replies that this is not possible in XSLT, can anyone verify this?J Edited May 10, 2006 by jetski Link to comment Share on other sites More sharing options...
boen_robot Posted May 11, 2006 Share Posted May 11, 2006 I was trying to have something like this with no success . However, I never tryed the parameter with string method, so... thank you . Link to comment Share on other sites More sharing options...
dooberry Posted May 12, 2006 Share Posted May 12, 2006 Try this <xsl:when test="boolean($thisSong/[artist=concat('Artist',string($artistCount)))]" /> I've made a best guess based on some code I've used to create an id attribute when I load information into a textbox control.Let us know if it doesn't work.Dooberry Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now