This project reads XML-encoded caDSR 11179-based Common Data Elements (CDEs). At the moment is prints out a basic summary of each CDE. The code is designed to provide a starting point for reading CDEs for transformation into other formats.
XML files containing various CDE collections can be found here. Go to the area labeled "Download caDSR Community Released CDEs" and click on "caDSR Production CDEs in XML". A large ZIP file can then be downloaded which will contain a dozen or so XML files containing caDSR CDEs. Note: these enclosed XML files seemed to be encoded as ISO-LATIN-1 so convert them to UTF-8 so that the code will correctly process them.
The XML files can then be placed in a directory and processed by this software (see execution instructions below).
There is an example CDE XML file in the src/main/resources/xml/example
directory.
The format of the caDSR CDEs is described by an XML Schema document. The JAXB library uses this document to generate Java classes to read the XML-encoded instances of caDSR CDEs.
The core translation routines extract information from the JAXB-generated Java objects and displays summary information about them.
Note that JAXB bindings were required to rename some generated classes.
Also not that the caDSR CDE XML Schema was produced semi-automatically from the caDSR-supplied DTD-encoded schema. We could not work with the DTD-encoded schema directly because the JAXB binding do not seem to work with DTD-based documents.
To build this library you must have the following items installed:
Get a copy of the latest code:
git clone https://github.com/metadatacenter/cadsr-reader.git
Change into the cadsr-reader
directory:
cd cadsr-reader
Then build it with Maven:
mvn clean install
To process the supplied CDEs in the src/main/resources/xml/example
directory:
mvn exec:java
To process CDEs in a user-specified directory:
mvn exec:java -Dexec.args="<directory containing CDE XML files>"