|
Additional info, exception states:
SAX2
driver class org.apache.xerces.parsers.SAXParser does not implement
XMLReader
which
makes no sense.
Thanks,
Rob
-----Original Message----- From: Rishi Khanna
[mailto:[EMAIL PROTECTED] Sent: Monday, October 28, 2002 3:22
PM To: [EMAIL PROTECTED] Subject: Re: Class Cast
Exception
I haven't implemented this with XMLReaderFactory,
but if you're willing to try, you can load the class with the following
code:
XMLReader parser = (XMLReader)
Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();
----- Original Message -----
Sent: Monday, October 28, 2002 3:13
PM
Subject: Class Cast Exception
I am trying
to upgrade to Xerces 2, we are trying something very trivial but
it will not work:
import
org.apache.xerces.parsers.SAXParser; import
org.xml.sax.XMLReader; import
org.xml.sax.helpers.XMLReaderFactory;
/** * @testcase
net.onesaf.services.data.xml.sax.TestSAX */ public class SAX
{
public
SAX(){ try
{
System.out.println("In here");
XMLReader parser =
XMLReaderFactory.createXMLReader(
"org.apache.xerces.parsers.SAXParser");
System.out.println("out
here");
} catch(Exception
e){ System.out.print(e);
} }
but we keep getting a ClassCastException
In
here
java.lang.ClassCastException
What are we
doing wrong?
Thanks,
Rob
|