Harvard University Library - Library Digital Initiative
  Home 
  METS 
  JAXB 
  Toolkit 
  Procedural Construction 
  Validation 
  Marshalling / Unmarshalling 
  Implementation 
  Papers and Presentations 
 
  Printer-Friendly Version of Site 

  Harvard University Library 
 
  Office for Information Systems 
 
  Library Digital Initiative 

METS Java Toolkit / Implementation
Draft Version 1.0 (alpha) 2002/03/15

The current version of the METS toolkit is based on the METS schema Version 1.0 (zeta) of February 8, 2002; the JAXB working draft specification Version 0.21 of May 30, 2001; and version 0.5 of XP. The toolkit has constructed and tested with the Sun J2SE 1.3.1_02-b02 JDK under Solaris 2.7.

Javadoc for the METS tooklit packages is available.

A distribution version of the METS toolkit can be downloaded as a gzipped tar file, mtk-20020315.tar.gz (378 KB).

gunzip mtk-20020315.tar.gz
tar xvf mtk-20020315.tar

The distribution directory structure is as follows:

mtk-1.0/
    README
    Makefile
    Marshal.java     # Test marshalling app
    Unmarshal.java   # Test unmarshalling app
    marshal.xml      # Marshalling output
    unmarshal.xml    # Unmarshalling output
    bin/
        bind.jar
        marshal.jar
        mets.jar
        xp.jar
    com/
        jclark/
            util/
                ...
            xml/
                tok/
                    ContentToken.java
                    Encoding.java
                    ...
    doc/
        index.html
        ...
    org/
        mets/
            xml/
                bind/
                    Makefile
                    MarshallableObject.java
                    MarshallableRootElement.java
                    PCData.java
                    ValidatableObject.java
                    ...
                marshal/
                    Makefile
                    XMLScanner.java
                    XMLWriter.java
                mets/
                    Makefile
                    Mets.java
                    MetsHdr.java
                    ...

The marshalling application, Marshal, procedurally constructs a METS file and marshals to the standard output unit. The unmarshalling application, Unmarshal, unmarshals the file specified by the file argument, validates it, and then re-marshals it to standard output.

To test the marshalling and unmarshalling applications:

cd mtk-1.0
java Marshal > marshal.xml
java Unmarshal marshal.xml > unmarshal.xml

The two files, marshal.xml and unmarshal, should be identical.

The following list documents currently unsupported features of the METS and JAXB specifications:

  1. Collection properties are initialized to non-null, but empty, as oppossed to the JAXB norm of initialization to null, which would require an invocation of the Element.emptyAttr() method (before setting attribute values) or the Parent.emptyElement() method (before defining an element content model).
  2. No strict validation of sequence ordering.
  3. The <area>, <par>, and <seq> elements not supported.
  4. Cannot specify non-UTF-8 encoding in XMLWriter.

The following limitations are in force in the current implementation:

  1. Single token cannot span more than two buffers.

Things to do:

  1. Base 64 encoder/decoder methods in binData and FContent classes.
  2. Add time zone field to dates.
  3. Support for the named entities and character references (&#xHH;).
  4. Support comments and PIs.
  5. Better diagnostic error messages.
  6. Use specific, rather than general exceptions (when documented).
  7. Full coverage of all public methods in the bind and marshal package classes.
  8. Monitor JAXB specification updates.


Stephen Abrams
Harvard University Library, Office for Information Systems
1280 Massachusetts Avenue, Suite 404
Cambridge, MA 02138
stephen_abrams@harvard.edu
Copyright © 2002 by the President and Fellows of Harvard College.
This information about the METS Java Toolkit is provided for evaluation purposes only.

The METS specification was developed as an initiative of the Digital Library Federation and is maintained by the Network Development and MARC Standards Office of the Library of Congress.
The toolkit is compliant with the JAXB API specification, copyright © 2001 Sun Microsystems, Inc.
The toolkit uses the XP parser, copyright © 1997,1998 James Clark.