[jdom-interest] XML formatting and java class hierarchy

Ken Rune Helland kenh at csc.no
Fri Mar 30 04:35:58 PST 2001

At 02:09 PM 3/30/2001 +0200, Ludvig Omholt wrote:
>I am using the jdom beta6 (XMLOutputter) to send simple XML messages to a
>server. The server, however, can't parse the "<![CDATA[" and "]]" strings.
>I have contacted the folks who implemented the server and questioned their
>parsing. They have not answered my email yet.
>In the meantime I would like to fix this by subclassing the org.jdom.CDATA
>class and override the getSerializedForm() method having it return the
>getText() String instead. This is not possible because the
>getSerializedForm() method is final and also there is no interface to
>implement. Why must the getSerializedForm() method be final? This seems to
>me to be quite dumb since it limits the use of the library.
>For now I have resolved the issue by modifying my copy of jdom, but it
>would be nice to use an "off the shelf" version of the library and create
>my own subclass of CDATA since that is much cleaner and I don't have to
>distribute my own version of the jdom JAR.
>Thanks for any feedback!

If you want it output as text witout the CDATA tags add it as
a String not as a CDATA object.

Or maybe I completly misundestood your problem.


More information about the jdom-interest mailing list