Hi,

as already mentioned off-line, I do not think this is a problem with
Castor. Have a look at the stack trace (copied partially)

org.exolab.castor.xml.schema.reader.Sax2ComponentReader.fatalError(Sax2ComponentReader.java:296)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

and you'll notice that is it Xerces itself reporting a fatal error.
Without having seen the XML schema in question, it looks like you might
have set the encoding in the XML declaration, but the document itself is
NOT UTF-16 encoded.

Regards
Werner

shubh singh wrote:
> Hi,
> 
> I am having trouble using SourceGeneratorMain with XML schemas that have an
> encoding of UTF-16. Whenever the declaration at the top of the XML schema
> file is <?xml version="1.0" encoding="UTF-16" ?>, I get the following error
> when running SourceGeneratorMain:
> 
> org.xml.sax.SAXException: In document:
> 'file:///C:/Documents%20and%20Settings/Castor/test/word/new.xsd'
> Parsing Error : Content is not allowed in prolog.
> Line : 1
> Column : 1
> at
> org.exolab.castor.xml.schema.reader.Sax2ComponentReader.fatalError(Sax2ComponentReader.java:296)
> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> at
> org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at
> org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:658)
> at
> org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:593)
> at
> org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:312)
> 
> I would really appreciate your help with the above problem.
> 
> Thanks and regards,
> 
> Shubh
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to