From: Peter Halferty
Subject: XSLT character escaping
Date: 
Message-ID: <WOvF9.213776$C8.555464@nnrp1.uunet.ca>
Hello

I am rendering XML to HTML using XSLT stylesheets with Saxon as my XSLT
processor
Along the way I am also needing to add some inline CGI calls into the
resulting HTML

All works well except that the rendered HTML ends up with a CGI call looking
something like

http://www.somewhere.com/cgi-bin/function?param1=this&amp;param2=that&amp;pa
ram3=theOther

with the &amp; entity printing out explicitly instead of '&'

I have tried using 'disable-output-escaping' to change this behaviour but it
has had no (visible) effect in this case.

Here is a snip from the stylesheet I am using.  'given-uri' is passed to the
stylesheet and in this case will be
http://www.somewhere.com/cgi-bin/function?


<xsl:variable name="new-url">
  <xsl:value-of select="$given-url"/>
  <xsl:text>parm1=</xsl:text><xsl:value-of select="$this"/>
  <xsl:text
disable-output-escaping="yes">&amp;param2=</xsl:text><xsl:value-of
select="$that"/>
  <xsl:text
disable-output-escaping="yes">&amp;param3=</xsl:text><xsl:value-of
select="$theOther"/>
</xsl:variable>

As a note. The rendered documents work for me as the browser resolves the
&amp; entity before making the CGI call.
However, it does not work for the people implementing the CGI, apparantly
because of the &amp;
That end of things is being further investigated but I want to find out if
there is way to render the HTML with '&' in the URL strings and not '&amp;'

If someone has any ideas regarding this please let me know.


Thanks very much

Peter


--
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **

<email_address>
    <username>phalferty</username>
    <hostname>newbook</hostname>
    <suffix>com</suffix>
</email_address>

From: Peter Halferty
Subject: Re: XSLT character escaping
Date: 
Message-ID: <thwF9.213787$C8.555584@nnrp1.uunet.ca>
My apologies.  Please delete/ignore/burn the previous posting as it was
obviously meant for a different newsgroup.

Peter

"Peter Halferty" <·········@mercury.bc.ca> wrote in message
···························@nnrp1.uunet.ca...
> Hello
>
> I am rendering XML to HTML using XSLT stylesheets with Saxon as my XSLT
> processor
> Along the way I am also needing to add some inline CGI calls into the
> resulting HTML
>
> All works well except that the rendered HTML ends up with a CGI call
looking
> something like
>
>
http://www.somewhere.com/cgi-bin/function?param1=this&amp;param2=that&amp;pa
> ram3=theOther
>
> with the &amp; entity printing out explicitly instead of '&'
>
> I have tried using 'disable-output-escaping' to change this behaviour but
it
> has had no (visible) effect in this case.
>
> Here is a snip from the stylesheet I am using.  'given-uri' is passed to
the
> stylesheet and in this case will be
> http://www.somewhere.com/cgi-bin/function?
>
>
> <xsl:variable name="new-url">
>   <xsl:value-of select="$given-url"/>
>   <xsl:text>parm1=</xsl:text><xsl:value-of select="$this"/>
>   <xsl:text
> disable-output-escaping="yes">&amp;param2=</xsl:text><xsl:value-of
> select="$that"/>
>   <xsl:text
> disable-output-escaping="yes">&amp;param3=</xsl:text><xsl:value-of
> select="$theOther"/>
> </xsl:variable>
>
> As a note. The rendered documents work for me as the browser resolves the
> &amp; entity before making the CGI call.
> However, it does not work for the people implementing the CGI, apparantly
> because of the &amp;
> That end of things is being further investigated but I want to find out if
> there is way to render the HTML with '&' in the URL strings and not
'&amp;'
>
> If someone has any ideas regarding this please let me know.
>
>
> Thanks very much
>
> Peter
>
>
> --
> ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
>
> <email_address>
>     <username>phalferty</username>
>     <hostname>newbook</hostname>
>     <suffix>com</suffix>
> </email_address>
>
>
From: Henrik Motakef
Subject: Re: XSLT character escaping
Date: 
Message-ID: <87of89s5xz.fsf@pokey.henrik-motakef.de>
"Peter Halferty" <·········@mercury.bc.ca> writes:

> I am rendering XML to HTML using XSLT stylesheets with Saxon as my XSLT
> processor

You do realize that this is comp.lang.*lisp*?

> All works well except that the rendered HTML ends up with a CGI call looking
> something like
> 
> http://www.somewhere.com/cgi-bin/function?param1=this&amp;param2=that&amp;pa
> ram3=theOther
> 
> with the &amp; entity printing out explicitly instead of '&'
> 
> I have tried using 'disable-output-escaping' to change this behaviour but it
> has had no (visible) effect in this case.

Why do you want to create broken HTML? The &amp; version is correct.

> As a note. The rendered documents work for me as the browser resolves the
> &amp; entity before making the CGI call.
> However, it does not work for the people implementing the CGI, apparantly
> because of the &amp;

The error is probably somewhere else in the CGI. If the browser
"resolves" the entities before it sends the request, how should the
CGI even know they were there?

Regards
Henrik