• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

sax parser error

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post your XML document here.
 
Jay X Brown
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic