DLESE Tools
v1.2

Package org.dlese.dpc.xml

Provides a simple API for reading XML files and directories.

See:
          Description

Interface Summary
XMLDirectory Provides a hashmap-like interface to a collection of XML records, hashed with a user-defined key extracted from the XML record.
XMLDocumentFormatConverter Implementations of this interface are used by the XMLConversionService to convert content from one format to another.
XMLFormatConverter Implementations of this interface are used by the XMLConversionService to convert XML from one format to another.
XMLMap Provides a hashmap-like interface into an XML-based metadata file, hashed by user-defined named keys.
 

Class Summary
ADNToBriefMetaFormatConverter Converts from ADN format to the BriefMeta format.
ADNToNSDLDCFormatConverter Converts from ADN format to the NSDL DC format.
ADNToOAIDCFormatConverter Converts from ADN format to the OAI DC format.
GenericXMLDocument  
SimpleErrorHandler A simple XML error handler that catches XML errors and warnings and saves them to StringBuffers so the errors can be extracted and displayed.
SimpleXMLDirectory Straightforward implementaion of the XMLDirectory interface for a file-based system, using a TreeMap for optimal sorting of keys.
SimpleXMLFormatConverter A simple demonstraion implementation of the XMLFormatConverter interface.
TestDirectory  
TestMapper  
XMLConversionService Manages the conversion of XML files from one format to another using XSL or Java classes.
XMLDoc Reads and parses an XML document.
XMLFilter Subclass of FileFilter to keep non-XML files from appearing in the directory listing.
XMLMapFactory Provides support for XMLDirectory implementations by using static constants and methods to create individual XMLMap instances.
XMLNode Creates an object wrapper for JDOM XML elements and for accessing their content.
XMLRecord Creates a wrapper implementation for accessing a JDOM XML document and for mapping the JDOM elements to a local HashMap.
XMLValidator XMLValidator uses Xerces to parse and validate xml files in a directory or an individual xml file you specify.
XMLWriter Subclassed from JDOM's XMLOutputter, in order to tweak output.
XSLTransformer Transforms files or Strings using XSL stylesheets.
 

Exception Summary
XMLException Simply wraps Exception.
 

Package org.dlese.dpc.xml Description

Provides a simple API for reading XML files and directories.

From Dave Deniman:

Provides a simple API for reading XML files and directories. The elements and attributes of the XML file are hashed as needed to produce an easy mapping between user-defined names and the desired value or object. This first release requires a mapping class be constructed to implement the XMLMap interface. The mapping is relatively easy to produce and once created makes accessing values trivial. Any number of mappings can be provided. Work is in progress to abstract the mapping using an XML metadata-definition file, which will eliminate the need to manually create mapping classes.

Two classes, XMLNode and XMLRecord, are used to abstract the actual XML parsing. JDOM is the parser used for this implementation. It would not be hard however to implement these two classes as interfaces and thus allow other parsers to be utilized.

Two interactive test programs are provided, TestMapper and TestDirectory, as demos. These prompt for the XML file or directory to map and the type of mapping to use. Three mappings are provided: DLESE IMS, DLESE Review Status, and unqualified Dublin Core. Custom mappers can be easily added, but the appropriate allocation will need to be added to XMLMapFactory. (Running TestDirectory on a large directory can take several minutes.)

See XMLNode for a description of how the actual mappings are implemented. The "key" structure needs to be understood when creating a mapping class. The next release will abstract this using the aforementioned metadata-defintion file.

This is an early release. A subsequent release will provide XML editing support as well.

 

Provides the classes to abstract XML parsing and to implement the name:value mapping between user-defined names and actual XML.

Implementations generally utilize metadata for defining information in user-relevant terminology. These metadata "objects" can and do consist of XML elements and their attributes, singularly or in combination with other elements/attributes.

The mapping interface provided by this package takes advantage of a hashmap implementation that provides "keys" to individual elements of an XML DOM. See XMLNode method


DLESE Tools
v1.2