I had already tried instantiating the xerces SAX
parser using the XMLReaderFactory, like so

XMLReader xmlReader =
XMLReaderFactory.createXMLReader();

And I set the system property
org.xml.sax.driver=org.apache.xerces.parsers.SAXParser

But still I got the same error.

But now after tying your suggestion with the
SAXParserFactory,

XMLReader xmlReader =
javax.xml.parsers.SAXParserFactory.newInstance().newSAXParser().getXMLReader();

It works !!  I don't get any errors :)

Why it didn't work with the XMLReaderFactory, is
beyond me.  Thanks a whole bunch Werner :)

-Saladin

--- Werner Guttmann <[EMAIL PROTECTED]>
wrote:

> Odd. Can you try to instantiate Xerces through its
> SAXParserFactory as well, rather than creating an
> instance manually. Other than that, no idea.
> 
> Werner
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Saladin Sharif [mailto:[EMAIL PROTECTED]
> > Gesendet: Donnerstag, 15. März 2007 18:54
> > An: [email protected]
> > Betreff: Re: AW: [castor-user] How to do XSD
> validation when the code was
> > not generated by the Castor code generator
> > 
> > 
> > Ok, hold off there.  I think I am getting closer
> to
> > figuring out the problem.
> > 
> > It occured to me to try and use different SAX
> parsers
> > to see if I get the same error message.  Initially
> I
> > was using Xerces, and I was instantiating the SAX
> > parser this way :
> > 
> > XMLReader xmlReader = new
> > org.apache.xerces.parsers.SAXParser();
> > 
> > 
> > So then I decided to try a couple of different
> other
> > SAX parsers.
> > 
> > I tried the Piccolo SAX parser, and I modified the
> > code to instantiate the SAX parser:
> > 
> > com.bluecast.xml.JAXPSAXParserFactory
> > jaxpSaxParesrFactory = new
> > com.bluecast.xml.JAXPSAXParserFactory();
> > XMLReader xmlReader =
> >
> jaxpSaxParesrFactory.newSAXParser().getXMLReader();
> > 
> > 
> > And guess what?  The unmarshalling works with no
> > errors.
> > 
> > Then I tried to use Crimson, and I modified the
> code
> > to instantiate the SAX parser:
> > 
> > XMLReader xmlReader =
> >
>
org.apache.crimson.jaxp.SAXParserFactoryImpl.newInstance().newSAXParser().
> > getXMLReader();
> > 
> > And that one works as well.  No errors!
> > 
> > 
> > So I wonder how come it didn't work with Xerces. 
> Am I
> > instantiating the Xerces SAX parser incorrectly?
> > 
> > -Saladin
> > 
> > 



**********************************************************
* Saladin Sharif
* e-mail:  [EMAIL PROTECTED]
* Visit homepage @ http://gaia.ecs.csus.edu/~sharifs
**********************************************************


 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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

    http://xircles.codehaus.org/manage_email

Reply via email to