[xsl] Un-cdata-section-elements

Subject: [xsl] Un-cdata-section-elements
From: "Alexander Johannesen" <alexander.johannesen@xxxxxxxxx>
Date: Tue, 21 Mar 2006 16:40:23 +1100
Hi,

I'm sure this is a FAQ thing, but
http://www.dpawson.co.uk/xsl/sect2/cdata.html talks about proper XML
and CDATA, not proper JavaScript within it. (Or I'm turning blind :)

Is there any way to undo the CDATA section rules for outputting XHTML
1.0? I'm trying to create something like ;

<script type="javascript">
  // <![CDATA[
   javascript here ...
  // ]]>
</script>

The processors I use (tested Sablotron and LibXSLT) seems to
(properly) use the DTD and enforce the content of <script> as CDATA ;

<script type="javascript">
  <![CDATA[
   javascript here ...
  ]]>
</script>

where there's no JavaScript comments '//' in front of their definition
(I can fake the last one, but I'm stumped on how to create the first
one). The XHTML 1.0 strict validation approves, but the JavaScript
engines complain (it doesn't understand CDATA, of course)

Is there anyway to override this so I can invoke my own rules for this
element, kinda like the opposite of output@cdata-section-elements? Or
do I have to hack something ugly together with
value-of@disable-output-escaping?


Alex
--
"Ultimately, all things are known because you want to believe you know."
                                                         - Frank Herbert
__ http://shelter.nu/ __________________________________________________

Current Thread