How to extract a value and use it in a future xpath query?

czyrelt

New Member
I'm extracting the value of a node into a variable:\[code\]<xsl:variable name="UPC" select="//x:input[@name='field-keywords']/@value"/><xsl:value-of select="$UPC" /> <!-- This works! -->\[/code\]Then I want to query another XML document for a node with the same value:\[code\]<xsl:value-of select="document('price_list.xml')/im_prices/row/UPC_Code[text()='$UPC']"/>\[/code\]When I substitute $UPC for the actual value I find the node just fine, but when I use $UPC it doesn't work. I haven't been able to work out how to extract the value to a variable and use it in a future xpath query.
 
Back
Top