Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Compare Differences crash on CDATA in Javascript

Vote:
 

Hi,

Running CMS 6 R1... I get this error when trying to compare differences between versions:

System.ArgumentException

Cannot have ']]>' inside an XML CDATA block.

Stacktrace:

   at System.Xml.XmlTextWriter.WriteCData(String text)

   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)

   at System.Xml.XmlElement.WriteTo(XmlWriter w)

   at System.Xml.XmlElement.WriteContentTo(XmlWriter w)

   at System.Xml.XmlElement.WriteTo(XmlWriter w)

   at System.Xml.XmlNode.get_OuterXml()

   at EPiServer.UI.Edit.PageCompare.Core.Providers.PageCompareAlgorithm.RecursiveNodeCompare(XmlNode firstNode, XmlNode secondNode, StringBuilder final)

   at EPiServer.UI.Edit.PageCompare.Core.Providers.PageCompareAlgorithm.GetDiffOfHtml(String html1, String html2)

   at EPiServer.UI.Edit.PageCompare.VisualPageCompare.OnLoad(EventArgs e)

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I guess the easy way around it is to change the javascripts... But is there maybe a fix available?

#52793
Aug 15, 2011 15:07
Vote:
 

Here's the banner ad code that contains the CDATA-syntax...

<script type="text/javascript"><!--//--><![CDATA[//><!--
	if (window.adgroupid == undefined) {
		window.adgroupid = Math.round(Math.random() * 1000);
	}
	document.write('<scr'+'ipt type="text/javascript" sr'+'c="http://adsby.webtraffic.se/addyn/3.0/733/2364582/0/321/ADTECH;cookie=info;loc=100;target=_blank;grp='+window.adgroupid+';misc='+new Date().getTime()+'"></'+'scri'+'pt>');
//--><!]]>
</script>

    

#52794
Aug 15, 2011 15:10
Vote:
 

It is a known bug in CMS 6 R1.

Bug #43920.

#52802
Edited, Aug 15, 2011 21:21
Vote:
 

Ah ok, thanks Toni. I altered the CDATA comment syntax and got the compare page to load by the way... However it messes up STYLE-elements so @import-statements such as this fails. Is that also a known bug?

EDIT: To clarify this is the resulting code after comparing... There is no CDATA in the original HTML source.

<style media="all" type="text/css"><![CDATA[
	@import '/mycsspath.css';
]]></style>

    

#52806
Edited, Aug 16, 2011 9:27
Vote:
 

STYLE-elements with @import-statements seems to be working ok now after upgrading to CMS 6 R2.

#54440
Oct 14, 2011 16:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.