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

Re: Re: Unwanted Output Escaping

Subject: Re: Re: Unwanted Output Escaping
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 23 May 2002 09:32:43 -0600 (MDT)
Re: Re:  Unwanted Output Escaping
gary cor wrote:
> Sadly this is not a solution to our problem, the mark-up in the CDATA block 
> is most likely invalid mark-up that we don't control, hence we need to leave 
> it "as-is" through into our final output.

Just to drive the point home, whoever made the decision to use a CDATA section
in this way was misinformed about what a CDATA section actually is. It is just
a convenience for the document author. It does not mark a span of text with a
"Dear Application, please preserve me" flag. It merely says "Dear XML Parser,
if you see something in here that looks like markup, it's not really markup.
Please report it to the Application as ordinary character data, as if '<' and
'&' had been written as '&lt;' and '&amp;', for example."

If you want to treat markup like your <p>Hello</p> as markup -- like if you
want it to be treated as an element 'p' containing character data 'Hello', and
you want it serialized as that markup should be -- then you should make sure 
it's embedded in your XML as actual XML. 

Your only other option is to leave all of it as character data, copy it with 
<xsl:value-of select="." disable-output-escaping="yes"/>, and hope that your 
XSLT processor supports d-o-e (it isn't required to) and that you're not 
outputting malformed data (more of a concern when the rest of the output uses 
the xml method), and that you're always going to be using this stylesheet as 
the last step before serialization (you may one day change your mind about 
this).

The point is, as Mike Kay mentioned, a poor design decision was made.
Lose the CDATA sections if you can.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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


Current Thread

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.