[xsl] Dealing with javascript and CDATA in XSL

Subject: [xsl] Dealing with javascript and CDATA in XSL
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx>
Date: Wed, 18 Feb 2004 22:12:48 -0700
Hi there,

Having trouble with som JavaScript.  Trying to do the following:
----------------------------------------------------------------------------
---------
<script language="JavaScript" type="text/javascript">
        //<![CDATA[
        <!--
   dom.loadXML('<TEST><T att="1"/><T att="2">testing</T><T
att="3"><![CDATA[a<B>bc</B>d]]></T></TEST>');

writeToLayer('select_signature',dom.documentElement.selectSingleNode("T[@att
='3']").text);
        //-->
        //]]>
</script>
----------------------------------------------------------------------------
---------

I get the following error:
End tag 'T' does not match the start tag 'script'.


However, if I remove the CDATA section inside my <T att="3"> element, so I
have:
----------------------------------------------------------------------------
---------
<script language="JavaScript" type="text/javascript">
        //<![CDATA[
        <!--
   dom.loadXML('<TEST><T att="1"/><T att="2">testing</T><T
att="3">bc</T></TEST>');

writeToLayer('select_signature',dom.documentElement.selectSingleNode("T[@att
='3']").text);
        //-->
        //]]>
</script>

----------------------------------------------------------------------------
---------

So I guess I'm having trouble with that CDATA section on the inside there.
Uggg, what to do?  Ahhh, just thought of an idea.  Going to try and use
endoded < and > for those.  Nope, didn't seem to work.

Any help would be appreciated!

Karl



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


Current Thread