Jason, There's no magic service for obtaining XMLPullParserConfigurations. The default parser configuration: org.apache.xerces.parsers.XIncludeAwareParserConfiguration implements org.apache.xerces.xni.parser.XMLPullParserConfiguration. It has public constructors. You can create it directly. The other available parser configurations are listed here [1].
Thanks. [1] http://xml.apache.org/xerces2-j/faq-xni.html#faq-3 Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] Jason <[EMAIL PROTECTED]> wrote on 10/27/2005 04:49:46 PM: > Hello, > > I'm trying to use the methods in the interface > org.apache.xerces.xni.parser.XMLPullParserConfiguration > and I can't figure out how to create an instance of a > parser which implements it. I've made two attempts - > the first is to run this code: > > //Begin Code > public static void main(String[] args) throws > Exception > { > XMLParserConfiguration parserConfig = null; > > // create parser configuration > try > { > parserConfig = > > (XMLParserConfiguration)ObjectFactory.newInstance("org.apache. > xerces.xni.parser.XMLPullParserConfiguration", > ObjectFactory.findClassLoader(), > true); > > } > catch (Exception e) > { > System.err.println("error: Unable to instantiate > parser configuration > org.apache.xerces.xni.parser.XMLPullParserConfiguration"); > } > > // XMLDocumentParser parser = new > XMLDocumentParser(parserConfig); > //End Code > > Getting this code to compile involved copying > ObjectFactory.java and SecuritySupport.java from the > samples/xni directory and building them along with my > test code. When I run the class I get this error: > > Exception in thread "main" > ObjectFactory$ConfigurationError: Provider > org.apache.xerces.xni.parser.XMLPullParserConfiguration > could not be instantiated: > java.lang.InstantiationException: > org.apache.xerces.xni.parser.XMLPullParserConfiguration > at > ObjectFactory.newInstance(ObjectFactory.java:346) > at PullParserTest.main(PullParserTest.java:35) > > I also tried launching the VM like so: > > java > -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache. > xerces.xni.parser.XMLPullParserConfiguration > PullParserTest ADMAdapterOutput.xml > > but that didn't help. I've poked around the > documentation quite a bit but I'm still in the dark. > Am I making this harder than need be? Can anyone > provide me with a bit of code to create a PullParser > instance? Thanks in advance. > > -jason > > > > > > __________________________________ > Yahoo! FareChase: Search multiple travel sites in one click. > http://farechase.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
