[SoapRMI] XPP2

Aleksander Slominski aslom_at_cs.indiana.edu
Mon, 10 Feb 2003 17:38:03 -0500


Jeff Fisher wrote:

>I've just come across your XML parser and it seems very interesting.  I have
>one question about it.  Is XPP2 a validating parser?
>
hi Jeff,

XPP2 is both API and its implementations. you can see that API consists 
mostly of interfaces and factory: 

  http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/PullParser2/doc/api/

if you download XPP2 you see that there are two implementations 
one which is simple and fast non-validating XML pull parser 
(without support for DOCDECL) and other implementation that 
uses Xerces2 to provide full XML 1.0 support but it is considerably 
bigger (as expected)

in your program you can choose to use implementation that is 
the best match for your needs and you can switch implementations 
easy as both work with the same XPP2 API. to do this you need
to use correct jar (PullParser2_version_X2.jar contains Xerces2 impl
and PullParser2_version.jar contains default implementation)
or if you have both in your classpath you can use system property 
to select parser implementation when using XmlPullParserFactory 
(-Dorg.gjt.xpp.XmlPullParserFactory=...) 

	XmlPullParserFactory factory = XmlPullParserFactory.newInstance(
                System.getProperty(XmlPullParserFactory.DEFAULT_PROPERTY_NAME));

or even hardcode it in your application, for example to select Xerces2 based impl:

	XmlPullParserFactory factory = XmlPullParserFactory.newInstance(
                "org.gjt.xpp.x2impl.X2PullParserFactoryImpl");

keep also in mind that XPP2 is no longer under development and 
all current efforts are on XPP3 that uses XmlPull API (www.xmlpull.org)
so you may consider using XPP3 instead of XPP2.

>I would have posted this to the news group, but since I only have the one
>question.....
>
no problem - that is what mailing list is for.

thanks,

alek

-- 
"Mr. Pauli, we in the audience are all agreed that your theory is crazy. 
What divides us is whether it is crazy enough to be true." Niels H. D. Bohr