CDATA
CDATA is used to include raw data that will get passed through unchanged to the target system.
<script type="text/javascript">
//<![CDATA[
function addLoadEvent(func)
{
if ( typeof wpOnload!='function')
{
wpOnload=func;
}
else
{
var oldonload=wpOnload;
wpOnload=function()
{
oldonload();
func();
}
}
}
//]]>
</script>
XML
If you are using a CMS system that uses an XML XSLT translator and want XHTML comments for SSI or client side includes you may find the following examples of use of xsl:comment and CDATA useful:
XML in
<!-- begin XSL -->
<xsl:comment>
begin xhtml server ssi and client comments
</xsl:comment>
<xsl:comment><![CDATA[#include file="ssi.html"]]></xsl:comment>
<xsl:comment><![CDATA[[if lt IE 7]>
<link rel="stylesheet" href="iefix.css" type="text/css" media="screen" />
<![endif]]]></xsl:comment>
<xsl:comment>
end xhtml server ssi and client comments
</xsl:comment>
<!-- end XSL -->
XHTML out
<!--
begin xhtml server ssi and client comments
-->
<!--#include file="ssi.html"-->
<!--[if lt IE 7]>
<link rel="stylesheet" href="iefix.css" type="text/css" media="screen" />
<![endif]-->
<!--
end xhtml server ssi and client comments
-->
REFERRERS
XML
There are no comments on this page. [Add comment]