NeXML: a UML-driven XML Schema with Java bindings for the NeXus format
Served: Sat Feb 13 19:40:58 AEDT 2016
NeXML home |  MetaDTD(XML)->XMLschema(XSD) |  XSD->EMF(Java) |  XSD->UML ||  MetaDTD->NeXusBeans(Java) |  NeXusBeans->UML |  MetaDTD->HTML ||  Thanks ||  NeXus Home

The NeXML XSD zone: an experimental generative XML Schema for NeXus

2008-10-30: The Eclipse XSD Java API has been used to automatically translate the NeXus Meta-DTDs (XML templates) into an XML schema (called NeXML). The Eclipse Modeling Framework (EMF) has been used to create EObject Java bindings and an EMF model editor for the NeXML schema. The system was presented at the meeting of the NeXus International Advisory Committee (NIAC), Oct 2008 in Sydney.
2008-10-30: A comprehensive webel.com.au technical report on NeXML for XSD is available online:
NeXML: automating generation of an XML schema and EMF Java bindings from the XML templates
of the NeXus neutron, x-ray, and muon science data format
, Kelly D. R. C., 2008. PDF

The NeXML conversion process starts by reading NeXus XML Template Meta-DTDs from file or streamed from the NeXus template SVN repository. A prototype Java NeXML tool parses the XML templates using org.dom4j, interprets the digested templates according to the NeXus Meta-DTD grammar, and then an XML Schema is written using org.eclipse.xsd. The templates are interpreted as group classes with data items or group-typed child elements, and written as XSD complex types to the NeXML schema.

The same process could be easily adapted to intepret the new
NeXus Definition Language (NXDL) XML templates (ratified at NIAC2008) !

Transformation of Groups

A typical NeXus "MetaDTD" XML-template (pre-NIAC2008) for a geometrical group:

Extract from the Meta-DTD XML template for group NXaperture.

Generated XSD complex types for NeXus groups extend a NeXML base hierarchy:

Netbeans IDE Design view of the NeXML base types.
The NeXML base types as reverse-engineered UML (stereotyped classes).
The NeXML NXinstrumentType as a stereotyped, reverse-engineered UML class
with child "elements" as UML properties typed by group types and data item types.
Properties can be represented as text in the UML "attributes" compartment or at the end of an Association.
The NeXML geometrical types as reverse-engineered UML (stereotyped classes).
Design view in Netbeans IDE showing NXaperture complex type in the NeXML schema.
All generated NeXus group complex types in the Netbeans IDE Schema view.

Transformation of group children

Child elements typed by a NeXus group become XSD elements of the matching type:

The child elements of the NXinstrumentType in the Netbeans IDE XML schema view; most of the children are typed by groups.
The NeXML NXentryType as a stereotyped, reverse-engineered UML class
with child "elements" as UML properties typed by group types.

Transformation of data item children

Some NeXus MetaDTD dataitems with complicated dimensions, units, and types:

Extract showing some data-items from the Meta-DTD XML template for NXsample.
Encapsulation of implied NeXus enumeration for values of a specific data item. Netbeans IDE schema view.
Extract from NeXML schema: encapsulation of data item as array of known finite length.
Extract from NeXML schema: an array data item with explicit dimensions, finite array type, and units.
UML reverse-engineering of NeXML Schema for NXsampleType, showing experimental strategies for handling dimensions, units, and types.
NeXML home |  MetaDTD(XML)->XMLschema(XSD) |  XSD->EMF(Java) |  XSD->UML ||  MetaDTD->NeXusBeans(Java) |  NeXusBeans->UML |  MetaDTD->HTML ||  Thanks ||  NeXus Home
This dynamic web site and software © 2008+ Dr Darren R C Kelly. All rights reserved.
Content streamed from the NeXus home site is available under the GNU Free Documentation License 1.2.
Contact developer.    Project site hosted by: webel.com.au