Subject: RE: Re: CDATA output
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 23 Apr 2003 08:54:37 +0100
|
>
> but it did not work, rightfully so. So, I cannot use
> cdata-section-elements. Right now, I am simply doing
> this:
>
> <property name="Body"><![CDATA[
> <!-- main content -->
> <xsl:apply-templates />
> ]]></property>
>
> but that seems 'unclean' to me...
>
Not only is it unclean, it's not going to work, unless you use
disable-output-escaping.
Why does the serialized output need to be in a CDATA section? Is it
really destined for an application that treats
<a><![CDATA[xyz&]]></a>
differently from
<a>xyz&</a>
? If so, you should consider redesigning that application. The
XSLT/XPath data model regards the two constructs above as different
representations of the same information, and I think any sane XML
application should do likewise.
Your only alternative is to do the serialization yourself. Rather than
doing this in the logic of your stylesheet (using
disable-output-escaping), I would suggest doing it as a back-end
post-processing application - typically written as a SAX ContentHandler.
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: CDATA output
- Nathan Shaw - Tue, 22 Apr 2003 22:06:56 -0400 (EDT)
- Michael Kay - Wed, 23 Apr 2003 03:50:01 -0400 (EDT) <=
- <Possible follow-ups>
- Nathan Shaw - Wed, 23 Apr 2003 10:11:40 -0400 (EDT)
|
|