aspose file tools*
The moose likes XML and Related Technologies and the fly likes sax parser error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "sax parser error" Watch "sax parser error" New topic
Author

sax parser error

Jay X Brown
Ranch Hand

Joined: Jan 26, 2001
Posts: 51
hi all,
sorry for the elementary level of my questions. i am trying out the sax parser and trying to handle the SAXParseException but, instead of getting the expected result, i'm getting this:
java.io.UnsupportedEncodingException
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.io.UnsupportedEncodingException.<init>(Compiled Code)
at sun.io.CharToByteConverter.getConverter(Compiled Code)
at java.io.OutputStreamWriter.<init>(Compiled Code)
at echo4.main(Compiled Code)
what am i doing wrong?
thanks for your help.
jb
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Please post your XML document here.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Jay X Brown
Ranch Hand

Joined: Jan 26, 2001
Posts: 51
here is the xml document:
<?xml version='1.0' encoding='us-ascii'?>
<!-- The first xml document -->
<CustomerInfo
Source="Internal"
>
<username></username>
<emailid></emailid>
<name title="Ms.">
<LastName>Rai</LastName>
<FirstName>Aishwaria</FirstName>
</name>
<address type="shipping">
<streetleveldetail> 123 Rajdil Lane, Chowpatty</streetleveldetail>
<city>Mumbai</city>
<postalcode>22222</postalcode>
<countrycode>IN</countrycode>
</address>
<item/>
<item/>
</CustomerInfo>
the problem was solved when i changed the line in the parsing application from:
out = new OutputStreamWriter (System.out, "USASCII");
to
out = new OutputStreamWriter (System.out, "UTF8");
it's working but i'm totally confused on this encoding bit.
what am i missing?
jb
[This message has been edited by Jay Brown (edited February 07, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sax parser error
 
Similar Threads
OutOfMemoryError in java swing application
Netscape 4 Security Exception
dtd mistake of some kind
java.lang.OutOfMemoryError error.
How to display Japanese characters in excel sheet?