Hi Mark, I noticed there was another thread about this issue yesterday. I think I'll add my two cents.
Xerces 1 and Xerces 2 are completely different beasts. Xerces 2 is almost a complete rewrite of its predecessor, and is based on configurable pipelines written using XNI. If you've written parsing code using only JAXP, SAX, and DOM, then you should be able to plugin both Xerces 1 and 2 into your application (as well as any other parser that supports these APIs). However, if your parsing code directly references classes which are part of the parser's implementation you might be out of luck. I think if you were using anything from org.apache.xml.serialize from Xerces 1, you should be fine, but many other classes from Xerces 1 have been moved or removed. I noticed one problem that people experience is that they compile their code against Xerces 1 with direct references to org.apache.xerces.parsers.DOMParser. Upon plugging in Xerces 2, I've seen reports that they "get a java.lang.NoClassDefFoundError: org.apache.xerces.framework.XMLParser thrown as the DOMParser's class heirachy has changed in Xerces 2". I believe you can keep yourself out of this trouble by using JAXP's DocumentBuilder, making your code interoperable with Xerces 1 & 2 (and other JAXP parsers). Ditto for SAX. You're safer using JAXP's SAXParserFactory, or one of SAX's factory methods for creating SAX parsers. I hope that helps. ----------------------------- Michael Glavassevich [EMAIL PROTECTED] 4B Computer Engineering University of Waterloo On Thu, 15 May 2003, Mark Causer wrote: > Hi > > is there any statements on back compatibility of Xerces 1 and 2. > ie code compiled against xerces1 running against xerces2. Is this likely to > work ? > I know there are issues if you use DOMParser, but what about using SAX ? > > thanks > > Mark > > > ________________________________________________________________________ > The information contained in this e-mail is intended only for the person > or entity to which it is addressed and may contain confidential and/or > privileged material. If you are not the intended recipient of this > e-mail, the use of this information or any disclosure, copying or > distribution is prohibited and may be unlawful. > > If you received this in error, please contact the sender and delete the > material from any computer. > > The views expressed in this e-mail may not necessarily be the views of > The PCMS Group plc and should not be taken as authority to carry out any > instruction contained. > > > > --------------------------------------------------------------------- > 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]
