File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XML Parsing Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Parsing Error" Watch "XML Parsing Error" New topic

XML Parsing Error

Indrayani Bhoir

Joined: Dec 02, 2002
Posts: 21
I am getting XML Parsing error in case, when my xml file data contains charcters like (", &) etc. As '&' is required to be present the XML Data i can't replace this char with any other char or 'and'.
how i can handle XML Parsing error in such case?
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Apparently the existence of quotes and ampersands in your XML makes the document malformed XML. Thus, you need to either encode those characters in the XML document, or enclose them into a CDATA block.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: XML Parsing Error
It's not a secret anymore!