The XML plugin uses the Xerces XML parser, included in the Xerces Plugin. If you are developing your own plugin that needs to handle XML, you might prefer to use the XercesPlugin, which is more recent than the version of Xerces included in the JDK.
If you would like to use the Xerces parser from your own plugin, you will first need to change your plugin's license if it is licensed under the GPL. The GPL is not compatible with the Xerces license.
The XML plugin itself is licensed under a modified GPL; this will probably be sufficient for your plugin. Here is the text of the license, embedded in each source file of the XML plugin:
The XML plugin is licensed under the GNU General Public License, with the following exception:
Permission is granted to link this code with software released under the Apache license version 1.1, for example used by the Xerces XML parser package.
You will also need to add a dependency for the XercesPlugin in your plugin's property file:
plugin.MyPlugin.depend.n
=plugin xerces.XercesPlugin 2.8.0
Note that you must replace n
with the
appropriate number, as dependency properties must have consecutive numbers.
That's all there is to it; you can now use the Xerces parser in your plugin. Xerces includes its own implementations of the JAXP, SAX2 and DOM3 APIs, so integrating existing code should be relatively easy.
It is also possible to call the XML plugin's entity resolver method to resolve public and system IDs. This method is in the xml.CatalogManager class:
public void resolve( | current, | |
current, | ||
publicId, | ||
systemId) ; |