1

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(").

3
  • Are you talking about copy/pasting an xml file into your java source? Commented Aug 27, 2015 at 4:09
  • Escaping characters is done for the java compiler. The escape doesn't exist at runtime in the string. Commented Aug 27, 2015 at 4:11
  • Could you post your code? Commented Aug 27, 2015 at 6:02

1 Answer 1

3

You can find more in details from http://www.journaldev.com/1237/java-convert-string-to-xml-document-and-xml-document-to-string

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.