Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert String to Well Formed XML String

807589Sep 18 2008 — edited Sep 18 2008
Hi folks,

I am facing a problem and I hope there is a simple solution.

I am working with an XML document. I am setting the XML tag names dynamically. I just realized that the input strings contains characters that are not allowed under XML.

Is there a simple way to convert the input String to a "safe" XML string and then re-convert it back?

I need just two functions:

String MySafeXMLString = ConvertToSafe ( myUnsafeXMLString)
String myUnsafeXMLString = ConvertToUnsafe ( MySafeXMLString)

.. IE I just need a function to translate a generic string to an acceptable XML string and then convert it back at a later time.

Please help.

Thanks.

Dwight
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2008
Added on Sep 18 2008
3 comments
624 views