See: Description
Package | Description |
---|---|
org.netbeans.modules.xml.xdm |
APIs for obtaining an XDM document and mutating the XDM tree.
|
org.netbeans.modules.xml.xdm.diff |
XML diff capabilities.
|
org.netbeans.modules.xml.xdm.nodes |
XDM-based implementation of DOM interfaces.
|
org.netbeans.modules.xml.xdm.visitor |
Visitors for operations over the XDM such as generating XPath
expressions, calculating document position and finding elements by position.
|
org.netbeans.modules.xml.xdm.xam |
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
model.sync();
// create customer element, same as dom
Element customer = model.getDocument().createElement("customer");
// add to the model as 0th child of employee element, not shown
model.add(employee,customer,0);
|
The sources for the module are in the Apache Git repositories or in the GitHub repositories.
Read more about the implementation in the answers to architecture questions.