You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/02/07 22:08:56 UTC

DO NOT REPLY [Bug 6316] New: - Content from CDATA being double reported as TEXT

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=6316>.
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=6316

Content from CDATA being double reported as TEXT

           Summary: Content from CDATA being double reported as TEXT
           Product: Xerces2-J
           Version: 2.0.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: jhunter@apache.org


In testing Xerces 2.0 as a parser for JDOM, I discovered that a file containing 
a CDATA section like this:

<?xml version="1.0"?>
<cdataTest>
  test &lt; one <![CDATA[&&<<>>]]> test two
</cdataTest>

Creates a document like this:

<?xml version="1.0" encoding="UTF-8"?>
<cdataTest>
  test &lt; one <![CDATA[&&<<>>]]>&amp;&amp;&lt;&lt;&gt;&gt; test two
</cdataTest>

It works correctly under earlier Xerces versions (1.3, etc).  I'm using JDOM's 
DOMBuilder to conduct this test.

Walking the produced DOM document it seems Xerces 2.0.0 is putting the CDATA 
text into a Text node in addition to the CDATA node.  Here's the output with 
some debug statements in DOMBuilder.

// Xerces 1.3.x
% java DOMBuilderDemo cdata.xml
got text node:
  test < one
got cdata node: &&<<>>
got text node:  test two

// Xerces 2.0.0
% java DOMBuilderDemo cdata.xml
got text node:
  test < one
got cdata node: &&<<>>
got text node: &&<<>> test two

-jh-

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org