JAST: Java Abstract Syntax Trees unites in one economical package the ability to do different kinds of XML processing in Java that used to need separate XML tools.
DOM Parsing is where you convert an XML file into a Document Object Model in memory. The DOM-tree is a hierarchical model of the XML document.
XMLReader reads an XML file into a DOM-tree.
XMLWriter writes a DOM-tree out to an XML file.
The nodes of the DOM-tree are Java classes, with obvious names that correspond to the XML element types. These nodes may be queried and updated by Java programs, before saving the tree to file.
SAX Building is where you use a Streaming API for XML to scan a very large XML file, seeking to build a part of this structure. You invoke call-back methods on a Builder that recognises the parts you want.
XMLParser reads an XML file and calls a Builder.
BasicBuilder is the default null-op Builder.
You design your own Builder to recognise specific XML elements, and make it build the desired Java structure in your program.
XPath Querying is where you use an XPath query pattern to search a DOM-tree. The string pattern is analogous to a directory path leading to the matching element, or elements.
XPath compiles a pattern to a set of rules.
XPath's method match() searches the DOM-tree.
JAST supports only the short-form XPath syntax. The results are returned as lists of Content, an abstract kind of XML node.
Java Binding is where you map the elements of an XML file to Java classes of your own design. XML is the serialisation format used by your own Java data structures.
ASTReader maps an XML file to a Java structure.
ASTWriter maps a Java structure to an XML file.
Your own Java classes must observe simple method naming conventions to enable marshalling to and from XML.
DTD Validation is where you check the elements of a DOM-tree against a Document Type Definition. This is a grammar of the expected XML structure, which is compiled into a DTD-tree of grammar rules.
DTDReader compiles a DTD-tree.
XMLReader may validate a DOM-tree.
You may have an internal DTD (in the DOM-tree) or an external DTD (a separate file). Validation is enabled by the XMLReader's method setValidation() with the argument Validation.DOCTYPE.
XSD Validation is where you check the elements of a DOM-tree against an XML Schema Definition. This is an XML schema of the expected XML structure, which is compiled into grammar rules.
XSDReader compiles an XML Schema.
XMLReader may validate a DOM-tree.
The XML Schema is always provided as an external XML file. Validation is enabled by the XMLReader's method setValidation() with the argument Validation.SCHEMA.
JAST unifies a number of different XML processing utilities in one place, for which you would normally expect to need several different, possibly incompatible, Java packages:
DOM Parsing is easier in JAST than with W3C DOM which is bulky, and JDOM which depends on external packages. JAST can be used instead of Oracle JAXP and Apache Xerces to build DOM-trees.
SAX Building is easier in JAST than with Oracle SAX and Oracle StAX, which require more setting up using factories. JAST can be used directly with the XMLParser push-parser and your own Builder class.
Java Binding is easier in JAST than with Oracle JAXB, which requires a schema binding phase. JAST can marshal and unmarshal Java classes directly. The Java classes do not need XML schema annotations, but observe simple conventions on method names, similar to Java Beans.
XPath Querying is easier than with Jaxen XPath or Java XPath, which are DOM-neutral and so require more setting up for a specific DOM-tree. This XPath uses JAST's own native DOM-tree directly.
DTD and XSD Validation are built in with the JAST readers and parsers. It is enabled by supplying values of the enumerated type Validation: Validation.DOCTYPE and Validation.SCHEMA.
The economies of scale gained by integrating these facilities means that each sub-package shares a lot of common code. We think that JAST is the most compact XML processing package for Java that provides all of these facilities.