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

RE: Preserving XHTML markup

Subject: RE: Preserving XHTML markup
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 4 Feb 2002 20:11:18 -0000
RE:  Preserving XHTML markup
> this brings up an interesting question.
>
> which is preferred, using xsl:copy-of or putting the XML in
> CDATA tags, and using value-of?

To embed one XML structure in another, always use direct nesting, never
CDATA. If you use CDATA, then you have to parse the data twice to process
the inner document. The purpose of CDATA is to indicate that special
characters such as "<" are NOT markup, so don't use it when they are.

If you have HTML that isn't well-formed, my preference is still to make it
well-formed (use Dave Raggett's tidy) and then embed it directly, but in
this case using CDATA is an alternative. The disadvantage is that you can
then only copy it to the output, you can't transform it; and when copying it
you have to use disable-output-escaping, which doesn't work if you want to
use the result tree as input to another process, rather than serializing it
immediately. (And specifically, it doesn't work for that reason with
Netscape).

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

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.