passing multiple parameters in href from xslt

2019-08-03 16:23发布

问题:

I am transforming an xml document to html by xslt. I am getting wrong output while passing multiple parameters in . Following is the code :

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>

this works with single parameter.any suggestions ?

回答1:

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>

This is not a well-formed XML document.

In a well-formed XML document, an & character that isn't in a comment or isn't used as a start of an entity-reference name, must be escaped.

This is correct:

<A href='index.html?id={str[2]}&amp;classname={str[3]}'><xsl:value-of select="str[4]"/></A>


标签: xslt href