Re: [xsl] url encoding of ampersands

Subject: Re: [xsl] url encoding of ampersands
From: Sivan Mozes <sivan@xxxxxxxx>
Date: Mon, 26 Feb 2001 01:03:26 -0800
> This won't work because there is no ampersand in your *source tree* (which
> was *derived* from your original XML). &#233; in your XML is resolved by
> the XML parser into a single LATIN SMALL E WITH ACUTE character long before
> the XSLT processor sees it. Likewise, your output will be *derived* from
> the result tree you construct, hence the automatic conversion of the
> character in question into &eacute; or &#233; by the XSLT processor's
> result tree serializer, just as it would convert an ampersand into &amp;.

Question: if the xslt processor was passed this character from the xml
parser, how is it selected for conversion as opposed to other characters, by

Shouldn't there be a way to be more specific in HTML output mode in regards
to ampersand handling? (using xerces/xalan).

I eventually wrapped all my entities in CDATA so I can later on encode the
ampersands, and did another assignment pass w/ disable-output-escaping to
parse these entities for displaying link content.

Although it works, I don't like the idea of introducing an exception into
the xml itself, which is being handled by non-techies. Only for specific
elements CDATA needs to be used for entities while everywhere else, entities
are handled in a standard manner. I don't think this can be specified in the

Thanks for your illuminating comments.


> <xsl:variable name="anchor" select="concat(substring-before(.,'&#233;'),
> '%C3%A9',substring-after(.,'&#233;'))"/>
> - Mike
> ____________________________________________________________________
> Mike J. Brown, software engineer at            My XML/XSL resources:
> in Denver, Colorado, USA    
> XSL-List info and archive:

 XSL-List info and archive:

Current Thread