[jdom-interest] Forcing a CDATA section

Richard Gaywood richardgaywood at gmail.com
Wed Mar 31 08:22:30 PDT 2010


Hi there.

I am using JDOM to integrate with an API provided to me by a big travel
firm. My integration was working fine for my test cases, but failed QA when
the tester tried something different. I've now been told by the travel firm
that instead of sending

<Key>N GBTM00423004Z</Key>
I need to send
<Key><![CDATA[N GBTM00423004Z]]></Key>

Googling has only turned up flamewars on this mailing list about this issue,
and I cannot see anything about it in the JDOM API docs. So I ask: is there
currently a way to force JDOM to use a CDATA section for a given tag, even
where it shouldn't really be necessary?

And before anyone starts another flamewar, I know this is dumb, I know this
isn't clean XML, but the travel firm is a big multinational with a hojillion
employees that makes zillions of dollars a year. My employer is a small
ecommerce outfit. I cannot make them change this, as much as I would like
to. It could be worse; one of their competitors we wrote a connector to only
supports socket connections that take EDIFACT encoded strings, and they ship
us a closed-source binary C library to enable us to talk to the service.
Integrating Java into that was a barrel of laughs.

Cheers!

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20100331/a627bbe9/attachment.htm


More information about the jdom-interest mailing list