|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] HTML parameters and Ampersands
I'm generating HTML on the server with XT, and I've run into what I think should
be a common situation.
I want to build a link in my HTML page that passes multiple parameters: <a
href="baseurl.htm?param1=1¶m2=2">Label Text</a>
My XML (much simplified) looks like this:
<LinkList>
<Link param1="1" param2="2">Label</Link>
<Link param1="10" param2="20">Label2</Link>
</LinkList>
The problem is getting the Ampersands to come out without escaping. If the XSL
is like this: (ignoring the whitespacing issues for clarity)
<xsl:for-each select="/*/Link">
<a>
<xsl:attribute name="href">
baseurl.htm?param1=
<xsl:value-of select="@param1"/>
&param2=
<xsl:value-of select="@param2"/>
</xsl:attribute>
<xsl:value-of select=".">
</a>
</xsl:for-each>
leads to output like this:
<a href="baseurl.htm?param1=1&param2=2">Label</a>
which is close, but not quite what I need. I've also tried:
<xsl:for-each select="/*/Link">
<a>
<xsl:attribute name="href">
baseurl.htm?param1=
<xsl:value-of select="@param1"/>
<text disable-output-escaping="yes">&param2=</text>
<xsl:value-of select="@param2"/>
</xsl:attribute>
<xsl:value-of select=".">
</a>
</xsl:for-each>
but this gets an error message about "illegal use of disable-output-escaping"
Do any of you gurus out there have any other suggestions?
Thanks
Dave
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








