C
Collin VanDyck
I'm using Xalan's TransformerIdentityImpl class to provide a nice base
framework upon which to write SAX transformers.
However, using the identiy transform, I'm getting some weird output issues.
My source xml looks like this:
....
<script>
<![CDATA[
<!--
some javascript here
//-->
]]>
</script>
And I am getting something out that looks like this:
<script type="text/javascript" language="JavaScript"><![CDATA[
]]><![CDATA[
<!--]]><![CDATA[
function MM_swapImgRestore() { //v3.0]]><![CDATA[
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
x.src=x.oSrc;]]><![CDATA[
}]]><![CDATA[
........ ad nauseum
Of course, my first example left out the javascript, but it was javascript
without any CDATA tags inside of it. The result is that my javascript has
tons of CDATAs everywhere. How do I stop this? Is the source XML in
violation of some rule? This example was created using a plain identity
transform -- nothing should have been changed as I understand it.
Also, my transformers are constructed using:
setOutputProperties(OutputProperties.getDefaultMethodProperties("xml"));
I'd appreciate any help on this -- thanks!
Collin
framework upon which to write SAX transformers.
However, using the identiy transform, I'm getting some weird output issues.
My source xml looks like this:
....
<script>
<![CDATA[
<!--
some javascript here
//-->
]]>
</script>
And I am getting something out that looks like this:
<script type="text/javascript" language="JavaScript"><![CDATA[
]]><![CDATA[
<!--]]><![CDATA[
function MM_swapImgRestore() { //v3.0]]><![CDATA[
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
x.src=x.oSrc;]]><![CDATA[
}]]><![CDATA[
........ ad nauseum
Of course, my first example left out the javascript, but it was javascript
without any CDATA tags inside of it. The result is that my javascript has
tons of CDATAs everywhere. How do I stop this? Is the source XML in
violation of some rule? This example was created using a plain identity
transform -- nothing should have been changed as I understand it.
Also, my transformers are constructed using:
setOutputProperties(OutputProperties.getDefaultMethodProperties("xml"));
I'd appreciate any help on this -- thanks!
Collin