Using a DTD instead of a schema

In addition to reading an XML schema, JaxMe can use a DTD as input for a schema tree. However, a DTD is very limited, so a lot of restrictions apply: The following options are supported from the DTDReader:
Name Description
dtdreader.package Name of the Java package in which the generated classes should reside. This option is required.
dtdreader.accessors Whether to generate accessor methods or not; defaults to false.
dtdreader.namespaceuri A namespace URI that should be assigned to the generated schema. By default the standard namespace is used.
dtdreader.extends The super class of the generated elements, by default JMAnyElement

The DTDReader is invoked like this:

      java de.ispsoft.jaxme.generator.Main
        --schemaReader de.ispsoft.jaxme.generator.dtd.DTDSchemaReader
        --sourceWriter de.ispsoft.jaxme.generator.JavaSourceWriter
        --option dtdreader.package=de.ispsoft.jaxme.examples.misc.dtd
        --option dtdreader.accessors=true
        --myDTD.dtd
For an example see the following:  choice.dtd ; the ant task generate.dtdreader in the file build.xml; and the JUnit test MiscTest.

NEXT     PREVIOUS  TABLE OF CONTENTS