Generic XML displayer --------------------- As part of a project of network simulator, I have begun a generic XML displayer with JGraph (http://jgraph.sf.net). I made a class DOMGraphModel: wrapper of one or more DOM XML Node and its sub-tree from the same or different DOM Document as a JGraph GraphModel : see source code here: http://jmvanel.free.fr/graph/ Compile it with jgraphpad.jar Try it with : java com.jgraph.dom.app.SampleEditorApp any.xml (you can use for instance the build.xml of JGraph) There are "collapse sub-tree" and reverse contextual commands, and the embryo of a command history with a button "Undo last Edit". There is currently a home-made Layout, that allocates to each node an horizontal space proportional to its total number of children. An XPath query does a JGraph selection of the DOM NodeList result. * tested Sujiayama algorithm : it works, but you need to select the sub-tree first. * open URL in general menu (can give a file name or an URL on command line or File Chooser) There is another main(): com/jgraph/dom/pad/DOMJGraphPad which is simply the inclusion of the DOMGraphModel in JGraphpad. The user is able to add an XML Element by adding a vertex and an edge from it in the normal JGraphpad way. Currently the added element has name "node", and user has no choice; "save as ... .pad_xml" works, but the labels are not saved. DOM --> Graph mapping --------------------- The default is to have 1 element --> 1 vertex. The attributes, text and other XML nodes are not represented. The tooltip on vertices show the XML attributes and the first text child, if any. Mapping and view customization ------------------------------ * Custom Vertex JGraph Attributes see interface CustomVertexAttributes * take in account a pruned XML tree in DOMTreeLayout * what to prune specified in : boolean GraphNodeFilter.pruneNode(Node n) * there is another Filter for XML nodes. Contrary to pruneNode(), a node can be excluded but its children not excluded ("shortcut"): public boolean acceptNode(Node n); Future: ------- There will be a new GUI for queries and transforms of several kinds: XPath, XSLT, XQuery. There will be a highlight of "legal" target ends when linking an edge, hopefully using the XML Schema. I plan to integrate a generic "classic" XML editor for the edition of leaf elements and small sub-trees. It might be Gendoc (on sf.net). I plan to show keyref associations in the XML document as links (edges) in the graph. Later I plan to do editing according to an XML Schema .