Re: [xsl] Ampersand in attributes

Subject: Re: [xsl] Ampersand in attributes
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 Oct 2004 22:51:29 -0400
Saxon is doing the right thing and the error message is correct because the XSLT specification says that feature can only be used for text nodes.

Browsers are supposed to recognize "&amp;" where just "&" is being used. It is proper HTML to use "&amp;".

I acknowledge that what you are seeing is not what you are used to seeing, because browsers do accept the naked "&", but have you tested what you are getting with the software you are running? Many people discover that the *proper* way of writing the URL "&amp;" works just as well as the naked "&", though I realize there are some apps that incorrectly accept only the naked "&" use of ampersand.

I suggest you try with the conformant output already being produced by Saxon. I use Saxon as a reference implementation of XSLT ... it is really very well done ... and I question my own work before I question what Saxon does with my work.

I hope this helps.

..................... Ken

At 2004-10-06 22:42 -0400, Nestor Boscan wrote:
I'm using saxon and I'm having problems generating anchor links. Because the
source has to be XML I'm changing ampersands to &amp;. For example:

link.jsp?p1=1&amp;p2=2&amp;p3=3

My output method is HTML but the result generated mantains the &amp;.

If I set disabled-output-encoding saxon returns:

javax.xml.transform.TransformerConfigurationException:
disable-output-escaping is not allowed for a non-text node


--
Upcoming publicly-subscribed XSL delivery: Helsinki Oct 18-20,2004
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread