xsl-list
[Top] [All Lists]

Re: [xsl] Preventing CDATA output in XHTML

2007-07-02 22:29:19
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--