You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/04/08 20:21:07 UTC

DO NOT REPLY [Bug 10726] - After transformation, Xalan gives out several adjancent CDATA nodes.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10726>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10726

After transformation, Xalan gives out several adjancent CDATA nodes.





------- Additional Comments From minchau@ca.ibm.com  2003-04-08 18:21 -------
In general adjacent CDATA sections are merged by the serializer, but for the 
given testcase we can't merge CDATA sections that would cause the characters "]]
>" to become adjacent because the output would be incorrect as the adjacent 
characters would incorrectly indicate the end of the CDATA.

The original XSLTest.java and invalid.xml files pointed to with a web link are 
no longer there.  I looked at the bugzilla attachments for xml and xsl.

The input xml document is this:
<?xml version="1.0"?> 
<doc><![CDATA[abc]]]><![CDATA[]>defghi]]]]><![CDATA[>jkl]]></doc>

The serializer is presented with writing this out this character data in
as a CDATA section:
     abc]]>defghi]]>jkl
So internally the CDATA's are merged.  But when faced with writing this out the 
serializer writes out "CDATA[[" then the given characters, then a closing "]]>".
The serializer sees the "]]>" that occurs in the middle of the character string 
and knows that it can't go out as is, because it would incorrectly mark the end 
of the CDATA, so it splits each "]]>" by closing the CDATA after "]]" and re-
opening with the ">" as the first character of then next section, to give the 
output:
  <?xml version="1.0" encoding="UTF-8"?>
  <out><![CDATA[abc]]]]><![CDATA[>defghi]]]]><![CDATA[>jkl]]></out>

Looks right in the latest Xalan in CVS to me.  What more can it do?  We can't 
output:
  <?xml version="1.0" encoding="UTF-8"?>
  <out><![CDATA[abc]]>defghi]]>jkl]]></out>

as that would be wrong.  Did I miss something or is this bug fixed now?
- Brian Minchau