[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] &parameter= in XML to HTML transformation


Subject: [xsl] &parameter= in XML to HTML transformation
From: stephan@xxxxxxxxxx
Date: Wed, 31 Jan 2007 21:24:51 +0800

Hi there,

we try to get URLs in an XSLT transformation that contain query 
parameters.
I tried

<xsl:output method="html" />
<xsl:element name="a">
        <xsl:attribute name="href">
 http://myserver/action.do?action=Approve&amp;ID=<xsl:value-of select="." 
/>
        </xsl:attribute>
        Approve
</xsl:element>

and

<xsl:element name="a">
        <xsl:attribute name="href">
                <xsl:text disable-output-escaping="yes|no"
>http://myserver/action.do?action=Approve&amp;ID=</xsl:text><xsl:value-of 
select="." />
        </xsl:attribute>
        Approve
</xsl:element>

(both no and yes)....

but the &amp would stay and &amp and not render to &

While & is illegal in XML and HTML it is perfectly legal (and required) in 
an URL. I searched online and found:

http://www.biglist.com/lists/xsl-list/archives/200410/msg00565.html
http://sources.redhat.com/ml/xsl-list/2001-01/msg00510.html
http://www.biglist.com/lists/xsl-list/archives/200101/msg00741.html
http://www.xml.com/pub/a/2001/03/14/trxml10.html

but it didn't address my problem. Unfortunately the server thinks these 
two URLs are different:
http://myserver/action.do?action=Approve&ID=7
http://myserver/action.do?action=Approve&amp;ID=7

What can I do?

Thx for helping!
:-) stw


Current Thread
Keywords