APIs for obtaining an XDM document and mutating the XDM tree.
XML diff capabilities.
XDM-based implementation of DOM interfaces.
Visitors for operations over the XDM such as generating XPath expressions, calculating document position and finding elements by position.
XAM model and component abstractions based on XDM tree.
XDMXDM (XML Document Model) provides a XAM based full fidelity XML model which implements the org.w3c.dom interfaces. The intention is not to provide an an alternate implementation of the dom interfaces but only to reuse part of the api where it makes sense and more importantly provide a foundation on which to provide a model basis for graphical multi way editors.This module was developed to support the following requirements:
The typical client of XDM would be a tool author supporting an XML language who wants to provide a custom client API. A concrete example of this is the XML Schema model. The XML Schema model starts by subclassing AbstractXDMModel and providing the component updater, which is called in conjunction with sync to mutate the model according to changes in the underlying source.
BaseDocument sd = ...;
Lookup lookup = Lookups.singleton(sd);
// create an editable ModelSource with base document
// in the lookup (this is required)
ModelSource ms = new ModelSource(lookup, true);
// create an XDMModel
XDMModel model = new XDMModel(ms);
// sync the XDM model with the underlying source
// create customer element, same as dom
Element customer = model.getDocument().createElement("customer");
// add to the model as 0th child of employee element, not shown
The sources for the module are in the NetBeans Mercurial repositories.
Read more about the implementation in the answers to architecture questions.