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

RE: me escape logic escapes me


Subject: RE: me escape logic escapes me
From: "Evan Lenz" <elenz@xxxxxxxxxxx>
Date: Tue, 22 Aug 2000 16:27:11 -0700

The parser is concerned with breaking an XML document into its respective
parts in order that it can be used to build a source tree.  So it's not the
parser.  It's whatever output handler your XSLT processor is invoking to
serialize the result tree into an XML document.  It knows that if the output
is to be well-formed XML, it must always escape & and <, except within a
CDATA section, comment, or processing instruction.  Read about it in the XML
spec: http://www.w3.org/TR/1998/REC-xml-19980210#dt-chardata

To get around this for some perverse reason, try:

<xsl:text disable-output-escaping="yes">&amp; &lt; etc.</xsl:text>


Otherwise, if your output is HTML, indicate so with this top-level element:

<xsl:output method="html"/>


But I'm not even sure if you're supposed to do that in HTML anyway.  Most of
the time, just trust the output handler.  It should understand what's
allowed and what's not allowed.

Hope this helps!

Evan Lenz
elenz@xxxxxxxxxxx
http://www.xyzfind.com


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Aaron Miller
Sent: Tuesday, August 22, 2000 1:51 PM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: me escape logic escapes me


Hi all,

I've noticed that when I use &amp; entity as part of a value in a
<xsl:attribute name="src"> node, nameley for a dynamic URL with encoded
parameters, the parser refuses to change it to a "&" character. Fortunately,
it doesn't interfere with the loading of the URL in the src attribute in the
output HTML, but I am curious as to why I can't produce "&" within an
attribute... I have tried double escaping it as well, to no avail, and I
have also tried <![CDATA]]> and <xsl:text>, both of which output literal
characters, but both of which become escaped in the attribute of an HTML
tag. What exactly are the rules forthis or what does the spec say about it
(or is someone gonig to tell me to go read my parser documentation? (which i
eventually will).?

aaron


 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
Keywords