� is indeed an invalid character and is probably occuring due to a
mismatch of encoding types.

You may need to set the default encoding in the writer you are using to
match the encoding Castor is using. You could also set the
"file.encoding" property in the system properties.


For example:

String encoding = "UTF-8";

FileOutputStream fos = new FileOutputStream("output.xml");
OutputStreamWriter writer = new OutputStreamWriter(fos, encoding);

marshaller = new Marshaller(writer);
marshaller.setEncoding(encoding);


Castor should probably take a peek at the encoding from the writer if
it's a subclass of OutputStreamWriter and warn if there is a mismatch.


--Keith

Chetan Rathi wrote:
> 
> Hello Keith,
> 
> We are using the castor tool to marshal and unmarshal the XML message
> being sent across cleint and server.
> 
> I am getting the following exception:
> 
> org.xml.sax.SAXParseException: Character reference "�" is an
> invalid XML character.
> --when i try to marshal the field of type string with the content
> being"<>".
> 
> All other symbols viz []() are being properly handled except for the
> above one.
> 
> "&#x0;" basically represents the character<> in the string.
> 
> Please let me know wht cud be the possible cause for the same.
> 
> The same when written in the other fields of data type string is being
> correctly handled by castor.
> 
> Thanking you.
> 
> Regds,
> 
> Chetan
> 
> 
> 
> Chetan Rathi
> Augsburger Str.336
> 70327 Stuttgart
> Tel no.0711-7861-3148(off.)
> Handy.no.015055564671
> 
> >From: Keith Visco
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: [castor-dev] Using collections instead of vectors
> >Date: Thu, 16 Jan 2003 09:18:59 -0600
> >
> >
> >
> >You parameters are correct, but you're passing too many parameters to
> be
> >using sourceGen.bat.
> >Call the source generator directly. The sourceGen.bat file can only
> pass
> >along up to 9 arguments. So any args passed 9 won't be passed along.
> >
> >Instead use:
> >
> >java org.exolab.castor.builder.SourceGenerator
> >
> >--Keith
> >
> >[EMAIL PROTECTED] wrote:
> > >
> > > What is the exact string for specifig the use of collections
> instead of
> > > Vectors in the source generator. I use this command line and the
> system
> > > doesn't seem to recognize the use of collections:
> > >
> > > call sourceGen.bat -verbose -i C:\Projects\FXNG\msg\schema\GL.xsd
> -dest C:
> > > \Projects\FXNG\castor\src -line-separator win -package
> > > com.globallink.glml.xml.schema -types j2
> > >
> > > >From reading the docs it looks like -types should work but no
> > > luck. What's wrong?
> > >
> > > - Travell
> > > _____________________________________________________
> > >
> > > Travell Perkins
> > > Senior Associate / Application Developer Consultant
> > > globallink / State Street Bank
> > > [EMAIL PROTECTED]
> > > _____________________________________________________
> > >
> > > -----------------------------------------------------------
> > > If you wish to unsubscribe from this mailing, send mail to
> > > [EMAIL PROTECTED] with a subject of:
> > > unsubscribe castor-dev
> >
> >-----------------------------------------------------------
> >If you wish to unsubscribe from this mailing, send mail to
> >[EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
> 
> ----------------------------------------------------------------------
> MSN 8 with e-mail virus protection service: 2 months FREE*
> ----------------------------------------------------------- If you
> wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to