Search code examples
xsltxpathquotes

XSLT/XPath quoting: XPath within an XPath-Function within XSLT


Here we're using double quotes at the XSLT level; single quotes at the XPath function level, but when we need to embed an XPath expression within the XPath function, how do we quote that?

 <xsl:value-of select="document('price-list.xml','/im_prices/row/UPC_Code[text()='abc']"/>
                                                                                 ^^^^^

(scroll to the right)


Solution

  • Not sure about that, I have always used the node-set form of:

    <xsl:value-of select="document('price-list.xml')/im_prices/row/UPC_Code[text()='abc']"/>
    

    but that may be vendor specific (however, have never known it not to work!)