XML & Web services: org.xml.sax.SAXParseException: An invalid XML character (Unicode

  1. I am getting this exception
    org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1a) was found in the element content of the document.
    when parsing an XML document created using data retrieved from db2.
    Does anyone know what the problem might be?
    thank you
  2. Hi
    I am also facing the same problem.
    please let me know if you have got any solution.

    thanks in advance.
  3. I came across this problem a while ago, it was because the XML document that I was trying to parse contained a '&' character. I created a small validation function that replaced all of the &'s with '&' which fixed up the issue.

    I have not found this with any other characters (although I'm sure that there are more out there).


    Ryan Thomas
    TransActive Systems
  4. I re-read your post and did a google on the 0x1a character. This is the control character SUB, I'm not sure what that's doing in there...

    Best of luck solving it.

    Ryan Thomas
    TransActive Systems