08-24-2010 05:20 AM
How can i encode a string value .
I'm sending a data in xml in the HTTP Post .
this works fine.
But now if i do the below it fails
08-24-2010 08:28 AM
The ampersand '&' has to be encoded like
The '<' like
These are standard HTML character entities
See this article:
08-27-2010 02:04 AM
I don't think there's a class that escapes a String for XML, but there is a way to do what you want. The steps are:
The only hard part of this is building the DOM representation. You can use a DocumentBuilder to create an empty Document, then use the Document methods to create and add all the nodes of the DOM that you need.
12-14-2011 08:24 AM
I have done just that. However I have trouble setting an encoding for the Document. I know the API allows getXMLEncoding(), but there is no call for setting it. Is there a way to do this?