users@jaxb.java.net

Re: SAX Parse Exceptions + setting encoding type

From: Robert Lowe <rmlowe_at_rmlowe.com>
Date: Fri, 28 Mar 2003 01:05:48 +0800

You can specify the encoding using:

marshaller.setProperty(Marshaller.JAXB_ENCODING, "ISO-8859-1");


----- Original Message -----
From: "Anthony Maguire" <ajmsonic_at_YAHOO.CO.UK>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Friday, March 28, 2003 12:21 AM
Subject: SAX Parse Exceptions + setting encoding type


> Hi
>
> I have 2 applications both using jaxb for the transmitting of xml data.
Both the applications are using the java classes generated from the xsd,
just one is doing marshalling and the other one is unmarshalling the data.
Occasionally i get the following error on the unmarshalling application:
>
> org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was
found in the element content of the document
>
> if anybody could shed some light on this, it would be much appreciated.
>
> relating to this i was wondering if you can specify the encoding for the
xml document (have searched the archives but have not found anything), ie to
have
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> instead of
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> thanks in advance,
> anthony