This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: escaping from CDATA
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] escaping from CDATA
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- Date: Fri, 26 Oct 2001 10:37:09 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Question 1:
> You are using java - is there a way to do this in javascript
> in IE6? I am write javascript in the following context:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> xmlns:user="http://mycompany.com/mynamespace"
> version="1.0">
>
> <msxsl:script language="javascript" implements-prefix="user">
> <![CDATA[
>
> function Fun(arg) {
> arg = arg.replace(/</, "<");
arg = arg.replace(/>/, ">");
arg = arg.replace(/"/, "\"");
var xml = new ActiveXObject("msxml2.domdocument");
xml.loadXML(arg);
return xml.selectSingleNode("/");
> }
> ]]>
> </msxsl:script>
>
> <xsl:template ...>
<xsl:apply-templates select="user:Fun($arg)"/>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Question 2:
> I originally said the text was wrapped in CDATA:
>
> <![CDATA[<element attr="100"><a>100</a><b>200</b></element>]]>
>
> Would it make any difference if the string was not wrapped in
> CDATA but just had the angle brackets represented as entities
> (which is the actual case):
>
> <element attr="100"> ... </element>
No
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list