I have a web service and client that are passing around strings containing character references such as  (0x1A). These are invalid in XML 1.0 but valid in XML 1.1. Axis's XML parser is throwing exceptions because of these character references. Is there a way to force it to parse the response as XML 1.1, or to insert the XML declaration? (There currently isn't one.) I looked into using handlers, but my understanding is that they get invoked after the XML is already parsed.
Are you passing in an InputStream
or Reader
? If so, you could wrap the source in another class (like BufferedReader
works) but use it to drop the unnecessary characters.