Alright, so here is my issue. I need to generate xml in Java to pass onto another application. I started off thinking this would be easy using an org.w3c.dom.Document. Unfortunately the application I need to pass the XML off to requires that special characters like " need to be encoded as ASCII (") instead of their character entity ("). Does anybody know a simple solution to this?
P.S. Changing the target application is not an option.
Update: So let's say my app is given the following string as input:
he will "x" this if needed
My app needs to output this:
<field value="he will "x" this if needed"/>
The XML generator I am using and I am guessing most others output this but this is not valid for my target:
<field value="he will "x" this if needed"/>
I realize my target may not quite be up to XML standards, but that doesn't help me as I have no control over it. This is my situation and I have to deal with it. Any ideas other than simply converting every special character by hand?