Alpha release of Perl modules for VOTABLE documents

From: Eric L. Winter <elwinter-at-olegacy.gsfc.nasa.gov>
Date: Tue, 14 May 2002 19:47:16 -0400 (EDT)


To all (and Roy - Tom McGlynn asked me to CC you on this),

        I have (finally!) finished and posted an alpha version of a set of Perl modules for manipulating VOTABLE documents. You can grab the code at:

http://heasarc.gsfc.nasa.gov/classx/restricted/src/index.html

For those of you who do not have the password to the ClassX site: if you wish to view the code, please let me know and I will post a copy in a publicly accessible area, or email you the code.

        The modules are built on top of the XML::DOM module, so that is required for use. I may change this later, to use a better XML parser, but the user should not see any change in the VOTABLE API. That was, after all, the while point in writing this code: to hide the dirty details of munging the XML.

Quick instructions:

0. Make sure you have the required third-party code built and installed:

Perl 5.6.1 or better (available from CPAN) XML::Parser (available from CPAN)
XML::Parser::Expat (available from CPAN) libexpat (get from http://expat.sourceforge.net)

If you have problems building any of these, let me know and I'll give you a hand.

  1. Unpack the archive:

tar xvf - VOTABLE-0.01.tar.gz

2. Build the modules.

cd VOTABLE-0.01
perl Makefile.PL PREFIX=your_local_perl_library_prefix_goes_here make

3. Test the modules:

make test

4. Install the modules:

make install

5. Examine the sample code in VOTABLE-0.01/samples.

        In general, the code consists of a VOTABLE::XXX module/class for each VOTABLE XXX element defined in the VOTABLE DTD (version 1.0). The sample programs (votable_read.pl and votable_write.pl) show how to read an existing VOTABLE file, and how to build one in-memory and write it to a file.

        This is VERY alpha code. It provides a crude but essentially complete capability to read, modify, and write VOTABLE documents. The code does its best to maintain the internal integrity of the document so that adherence to the DTD (or schema) is maintained.

        I am working on more complete documentation for the API, but as you can see from the sample code, it is very straightforward. Each element is an object, and all attributes have get and set methods. Child elements have get and set methods, which take scalar or array arguments as needed for their respective element counts. If you are unfamiliar with Perl object syntax, the sample code should get you started, and I can give assistance as needed.

        I will be adding a slew of convenience methods (especially for translating tabular data to TABLEDATA format) in the near future.

Caveats:

0. Alpha code. Caveat programmor.

  1. External data is not yet supported, although the infrastructure has been started (BINARY and FITS elements, and STREAMs).
  2. No testing has been done with Perl prior to version 5.6.1.

        Finally, I will appreciate ANY feedback on this code, be it the API itself, the distribution, and of course, the rare bug report :^). Please feel free to contact me if you have any comments or questions.

Good luck!
Eric

Eric Winter, SSAI, NASA GSFC Code 692
elwinter-at-lheapop.gsfc.nasa.gov
(301) 286-2316 Office: T2, Room 56 Received on 2002-05-15Z06:33:41