This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
we are sending XML that consists of CDATA sections. Issue I am facing parser is generating nested CDATA sections for each newline feed it encountered within CDATA sections. FYR, I am attching CDATA input and CDATA as parsed by parser.
CDATA as parsed by parser =========================== <xmlData><![CDATA[<?xml version="1.0"?> ]]><![CDATA[ <form> ]]><![CDATA[ <type>UNKNOWN</type> ]]><![CDATA[ <code>1234</code> ]]><![CDATA[ </form>]]> </xmlData>
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
posted
0
For the parser to distinguish between non-ignorable and ignorable whitespace, there must be a DTD or schema associated with the XML document, and it must be used to validate the document during parsing.
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
That�s probably normal behavior for XML parsers to prevent them from blowing up on humongous CDATA sections � which would explain why in StaX and DOM there is the setCoalescing method. See Creating Parsers with JAXP and Referencing Enterprise Beans
void setCoalescing(boolean value) - If set, the parser combines all adjacent Text nodes and CDATA section nodes into a single Text node in the Document tree. If not set, CDATA sections may appear as separate nodes in the tree.