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

Re: Preventing CDATA output in XHTML

Subject: Re: Preventing CDATA output in XHTML
From: Dale Tan <wtdtan@xxxxxxxxx>
Date: Tue, 03 Jul 2007 01:28:48 -0400
Re:  Preventing CDATA output in XHTML
hey brian,
have you checked your <xsl:output method>?
i'm assuming you are using xslt 1.0 (or 1.1, whatever it is, just not 2) so there is no native "xhtml".


so you can do something like the following:

<xsl:output
   method="xml"
   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
   omit-xml-declaration="yes"
   encoding="UTF-8"
   indent="yes" />

the key there is the "method" attribute. in order to get a true "xhtml" doc type, that needs to be equal to "xml" otherwise you will be parsing as regular "html" where your self-closing tags will not be closed (<img> instead of <img />, <br> instead of <br />, etc)

this way, you can go back and do this with your javascript:

<script type="text/javascript">
   <xsl:comment>
      ...
      javascript  in here
      ...
   //</xsl:comment>
</script>

hope that helps. good luck.

dale

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-2007 All Rights Reserved.