1 2 Previous Next 16 Replies Latest reply: Mar 26, 2009 4:37 AM by 800308 Go to original post RSS
      • 15. Re: How do I read XML & escape chars ?
        jemrug wrote:
        org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)

        I thought the parser was supposed to ignore these control chars and treat them as whitespace.

        I am really really confused.Could someone explain?

        Umm... the "prolog" is the bit before the opening element.

        I don't care where the debugger "points" I've only ever seen this error message from leading whitespace... as in:
        <?xml version="1.0" encoding="UTF-8" ?>\r\n
        Download the XML with a BINARY downloader... Hint: I posted one a while back... Do NOT just copy-paste or even save-as from your browser... they all eff-with the data... mostly helpfully, but occassionally in strange ways.

        Now look at the file in a hex editor (google it, if you haven't already got one)... Hex-editors show you exakery what's in the file... text editors, IDE's, browsers, etc all try to be helpful, especially with EOL chars.

        What's are you actually getting from the middleware?

        Cheers. Keith.
        • 16. Re: How do I read XML & escape chars ?
          I think I have got to the bottom of it. The 0D 0A are CR LF's are ok as they are white spaces. Its the ?? that casuse the problem. They are not inside elements. I made sure I was not sendin them , but at the end point they exist. Therefore problem is indeed with the middleware translation process. Its adding these chars.

          thanks for all that helped.

          1 2 Previous Next