Search code examples
xsltampersand

Escape ampersand in xsl url parameter


I have an xsl document with javascript int it in which i append url parameters to the string.

 window.parent.parent.addTab('Loading...', 'PGS/ContentView.aspx?dpath=' + dpath + '&hashValue=' + hashValue);

The xsl using visual studio gives me an error stating entity 'hashvalue' not defined, its a valid parameter being passed to the function.


Solution

  • Try to use & and wrap it in the xsl:text:

    <xsl:text disable-output-escaping="yes">&amp;</xsl:text>