|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] copy-of breaks javascript in CDATA sections
Hi,
I have an XHTML document generated with XSLT (Saxon 9.1) where I need
to insert external third party XHTML fragments.
Basically I do sth. like:
<xsl:variable name="frag" select="document('http://somehost/somepage.html') />
<xsl:copy-of select="$frag//div[@id='someid']/div"/>
In some of the external fragments there is some ugly javascript looking like:
<script type="text/javascript">/*<![CDATA[*/document.write('<script
type="text/javascript"
src="http://somehost/somescript.js"></script>');/*]]>*/</script>
When inserting the above via copy-of it gets written into the document like:
<script type="text/javascript">/**/document.write('<script
type="text/javascript"
src="http://somehost/somescript.js"><\/script>');/**/</script>
I know that there is nothing wrong from the XML parsers point of view
but do you see any chance of preventing it from escaping the script
tags inside the document.write()?
Unfortunately I have to take these fragments as they come and cannot
fix the problem there.
So what I am looking for is a workaround to insert these fragments via
XSLT without braking the javascript.
Any chance to solve that?
Kind regards,
Felix
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






