I am passing xml data as input and want my java code to read it as a single line string .
I could achieve it as a single line,but the problem is in conversion of this line.
"?xml version="1.0" encoding="UTF-8"?"
I could do it by using \" but I want my java code to handle this data and convert it to a String by escaping the quotes(").
-
Are you talking about copy/pasting an xml file into your java source?durron597– durron5972015-08-27 04:09:28 +00:00Commented Aug 27, 2015 at 4:09
-
Escaping characters is done for the java compiler. The escape doesn't exist at runtime in the string.Geoduck– Geoduck2015-08-27 04:11:35 +00:00Commented Aug 27, 2015 at 4:11
-
Could you post your code?bhdrkn– bhdrkn2015-08-27 06:02:33 +00:00Commented Aug 27, 2015 at 6:02
Add a comment
|
1 Answer
You can find more in details from http://www.journaldev.com/1237/java-convert-string-to-xml-document-and-xml-document-to-string