0

I am trying to declare a variable/parameter in the beginning of my XSL sheet and use it later to filter on in XPATH:

<xsl:param name="MemberName">Lara</xsl:param>
<!-- other stuff -->
<xsl:for-each select="LIBRARY/MEMBER[MEMBER_NAME = '$MemberName']">
<!-- other stuff -->        

but the resulting output is empty, whereas if I replace '$MemberName' with 'Lara' it works fine.

0

1 Answer 1

1

Your code is looking for a MEMBER whose MEMBER_NAME is the literal string "$MemberName".

To look for a MEMBER whose MEMBER_NAME is equal to the value of the $MemberName param, remove the quotes surrounding the param name:

<xsl:for-each select="LIBRARY/MEMBER[MEMBER_NAME = $MemberName]">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.