Automatic XML Parser Generator

Andreas Franke

provides
x-ozlib://mathweb/dtdtool.exe
x-ozlib://mathweb/xmlparser/XmlScanner.ozf
x-ozlib://mathweb/xmlparser/XmlParser.ozf
x-ozlib://mathweb/xmlparser/ExpatEmulator.ozf
x-ozlib://mathweb/xmlparser/GumpScannerEmulator.ozf
x-ozlib://mathweb/xmlparser/SemTrivial.ozf
x-ozlib://mathweb/xmlparser/SemDefault.ozf
x-ozlib://mathweb/xmlread.exe
x-ozlib://mathweb/text2functor.exe
requires
x-ozlib://duchier/op/InputSource.ozf
is compatible with
x-ozlib://duchier/xml/expat/Processor.ozf

Purpose

This tool automatically converts XML Document Type Definitions (DTDs) into Oz Parsers (Gump). These are used to build user-specific Oz-representations (e.g. tree structures) from XML documents.

The use of ``semantic modules'' makes it both powerful and easy-to-use:

Installation

This package can be installed by following the usual configure, build, install procedure, i.e. by executing a the shell: ./configure make install By default, all files of the package are installed in the user's ~/.oz directory tree. In particular, all modules are installed in the user's private cache.

Example

You need:

Then you can use the tool as follows:

  1. Make sure that you have $HOME/.oz/bin in your $PATH.
  2. Convert the DTD to a Gump Parser:

    dtdtool <DTD> --root=<Element>[,<Element>...] -o <ParserFunctor.ozf>

    where the root elements are the documents' possible root nodes

  3. Test whether you can parse your documents:

    xmlread <DOC.xml> --parser=<ParserFunctor.ozf> --root=<Element>

  4. Create an appropriate ``semantic module'' for your application (analogous to SemDefault.oz)
  5. Test if it works:

    xmlread <DOC.xml> --parser=<Parser.ozf> --root=<Elem> --sem=<SemFunctor.ozf>

  6. Integrate the parser into your application (analogous to xmlread.oz)
  7. Replace ExpatEmulator.ozf with expat.ozf to improve efficiency (available from Denys Duchier )

Omega Homepage - MathWeb Homepage