Problem parsing XML
"Sunil Negi" <[email protected]> Mon, 9 Jun 2003 17:54:30 +0530
| Newsgroups | gmane.text.xml.sax.general |
|---|---|
| Message-ID | <[email protected]> |
hi all, I have a problem trying to parse XML strings that
are unicode. My application is a java servlet that accepts
a string [in unicode] as payload of a Post request.
My problem is that when I try to parse the XML, it throws
an invalid character Exception. This is obvious since the first char
it comes across is 0x0, which is invalid.. This is the exception..
Illegal XML character: �.
at
org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
at org.apache.crimson.parser.InputEntity.getc(InputEntity.java:360)
at org.apache.crimson.parser.Parser2.getc(Parser2.java:2862)
at
org.apache.crimson.parser.Parser2.maybeGetNameCacheEntry(Parser2.java:619)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1288)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1
79)
My problem is , how do i make the Parser recognise unicode boundaries,
rather then byte boundaries.
i m not getting headway even after using the java.nio utilities for unicode
conversion.
regards,
w|536uy
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
List: [email protected]
See: http://www.saxproject.org
https://lists.sourceforge.net/lists/listinfo/sax-users