File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes embed one document in another, each with CDATA section Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "embed one document in another, each with CDATA section" Watch "embed one document in another, each with CDATA section" New topic
Author

embed one document in another, each with CDATA section

Craig Demyanovich
Ranch Hand

Joined: Sep 25, 2000
Posts: 173
I have an XML document that contains data best stored in a CDATA section. My colleague has written a component that receives my XML documents. When a volume or time threshhold is reached, the component embeds my XML documents as CDATA in an XML document, compresses the XML document as a stream of bytes, and sends the stream via a JMS message to another component.
The component that receives the JMS message decompresses the stream and parses the XML document. The parser encounters a fatal error due to embedded CDATA sections.
Here's a quote from W3Schools:
A CDATA section cannot contain another CDATA section. If a CDATA section contains the characters "]]>" or "<![CDATA[" you are in deep trouble.

How, then, do we correctly embed one XML document in another?
Thanks for your time,
Craig
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: embed one document in another, each with CDATA section
 
Similar Threads
how to embed CDATA within another
Doubt in org.w3c.dom.Document.
Inserting HTML in XML using JAVA
CDATA
Question on Asynchronous web service call using document style.