disable-output-escaping

Subject: disable-output-escaping
From: "Evan Lenz" <elenz@xxxxxxxxxxx>
Date: Tue, 1 Aug 2000 17:07:05 -0700
Currently, we are using an extension element for escaping XML fragments for
inclusion as the value of an HTML hidden form field, so that XML can be
passed back to the server.  Any arbitrary tree can be nested into an
<escape> element in order for that tree to be escaped as a string to be
included in the form.

Implementing this in pure XSLT seems rather difficult or at least "clunky".
While I understand that the disable-output-escaping attribute for the
xsl:text and xsl:value-of elements is a feature that an XSLT processor does
not have to support, it seems crucial for this application.  (Please correct
me if I'm overlooking another route!)  I have however run into some
interesting problems.  SAXON disabled the output escaping of &lt; and &apos;
but not &gt; &amp; or &quot;.  I was quite confused at first that it was
treating these characters differently, but then I tried the same thing with
xt.  xt gave me an error: "illegal use of disable-output-escaping='yes'".
Apparently, the use of disable-output-escaping is illegal when the output to
the result tree is anything but a text node.  Thus, it cannot be used to
generate the value of an attribute, for example, which is what I am trying
to do.  But, as I mentioned, SAXON DID let me escape &lt; and &apos; in this
context.  Do I thank SAXON for letting me by or scold it for not reporting
an error?  Either way, I seem to be back to the drawing board on making this
aspect of the stylesheet portable.  I'm afraid to see what MSXML does now
(and client-side transformations is the reason I decided to try this whole
thing).

Any input regarding this would be greatly appreciated.

Thanks,

Evan Lenz
elenz@xxxxxxxxxxx


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


Current Thread