RE: HTML parameters and Ampersands

Subject: RE: HTML parameters and Ampersands
From: "Friedlander, Hal" <Hal@xxxxxxxxxxxx>
Date: Wed, 4 Oct 2000 09:59:53 -0400
Have you tried using the character value &#38; or #38; in replace of &amp;
in your XSL?

-----Original Message-----
From: David_Benua@xxxxxxxxxxxxxx [mailto:David_Benua@xxxxxxxxxxxxxx]
Sent: Tuesday, October 03, 2000 11:22 PM
To: XSL-List@xxxxxxxxxxxxxxxx
Subject: 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&param2=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"/>
          &amp;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&amp;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">&amp;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


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread