- Direct Known Subclasses:
- XmlArgusReader, XmlChem3dReader, XmlCmlReader, XmlOdysseyReader, XmlVaspReader, XmlXsdReader
public class XmlReader
extends AtomSetCollectionReader
A generic XML reader template -- by itself, does nothing.
The actual readers are XmlCmlReader, XmlMolproReader (which is an
extension of XmlCmlReader, XmlChem3dReader, and XmlOdysseyReader, which is wholely different.
XmlReader takes all XML streams, whether from a file reader or from DOM.
This class functions as a resolver, since it:
(1) identifying the specific strain of XML to be handled, and
(2) passing the responsibility on to the correct format-specific XML readers.
There are parallel entry points and handler methods for reader and DOM. Each
format-specific XML reader then assigns its own handler to manage the
parsing of elements.
In addition, this class handles generic XML tag parsing.
XmlReader.JmolXmlHandler extends DefaultHandler is the generic interface to both reader and DOM element parsing.
XmlCmlReader extends XmlReader and is where I'd like Andrew to take charge.
XmlCmlReader.CmlHandler extends XmlReader.JmolXmlHandler is generic
XmlMolproReader extends XmlCmlReader. If you feel like expanding on that, feel free.
XmlMolproReader.MolprolHandler extends XmlCmlReader.CmlHandler adds Molpro-specific XML tag processing
XmlChem3dReader extends XmlReader. That one is simple; no need to expand on it at this time.
XmlChem3dReader.Chem3dHandler extends XmlReader.JmolXmlHandler is generic
XmlOdysseyReader extends XmlReader. That one is simple; no need to expand on it at this time.
XmlOdysseyReader.OdysseyHandler extends XmlReader.JmolXmlHandler is generic
Note that the tag processing routines are shared between SAX
and DOM processors. This means that attributes must be
transformed from either Attributes (SAX) or JSObjects (DOM)
to HashMap name:value pairs. This is taken care of in JmolXmlHandler
for all readers.
TODO 27/8/06:
Several aspects of CifReader are NOT YET implemented here.
These include loading a specific model when there are several,
applying the symmetry, and loading fractional coordinates. [DONE for CML reader 2/2007 RMH]
The DOM reader is NOT CHECKED OVER, and I do not think that it supports
reading characters between start/end tags:
characters
If you work on this, please read formats other than CML into DOM so that
we can see that that works as well.
Test files:
molpro: vib.xml
odyssey: water.xodydata
cml: a wide variety of files in data-files. Feel free to prune if some are
not of use.
-Bob Hanson