[jdom-interest] XML formatting and java class hierarchy

Ludvig Omholt ludde-jdom at restamus.se
Fri Mar 30 04:09:45 PST 2001


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!


  _   _ _ __  __  ___
 | | | | |  \|  \| __| Ludvig Omholt ................. ludde at restamus.se
 | |_| | | D | D | _|  070-310 08 71 ........... http://www.restamus.se/
 |___|___|__/|__/|___| ++++++++ cliff: Linux 2.2.13 on an i686 +++++++++

More information about the jdom-interest mailing list