[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: CDATA Output

Subject: Re: CDATA Output
From: Nathan Shaw <n8_shaw@xxxxxxxxx>
Date: Wed, 23 Apr 2003 07:16:34 -0700 (PDT)
cdata output
Thanks Mike,

The reason it is being suggested to use a CDATA
section is that the element is going to contain HTML
markup, and thus, a ton of stuff like this >, <, &,
and other characters that need to be escaped. However,
I see what you are saying about the receiver treating
it differently and luckily, although I don't have
control over the receiver, I DO have control over
making sure that all content put into that containing
element is well-formed, so I will do that.

Thanks for the help.

--Nathan



Date: Wed, 23 Apr 2003 08:54:37 +0100
From: "Michael Kay" <mhk@xxxxxxxxx>
Subject: RE:  Re: CDATA output

>
> but it did not work, rightfully so. So, I cannot use
> cdata-section-elements. Right now, I am simply doing
> this:
>
> <property name="Body">&lt;![CDATA[
> <!-- main content -->
> <xsl:apply-templates />
> ]]&gt;</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&amp;</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

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

 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)
      • <Possible follow-ups>
      • Nathan Shaw - Wed, 23 Apr 2003 10:11:40 -0400 (EDT) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.