The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

dtdto - Convert an XML DTD to a variety of XML representations.

SYNOPSIS

dtdto [ --help ] [ --debug level ] [ --valid | --dtd | [ ( --html | ( --docbook [ --top-element element-name ] [ --top-id id-string ] ) ) [ --title title-string ] [ --anchor-prefix prefix-string ] ] ] [ input-file [ output-file ] ]

DESCRIPTION

dtdto constructs an XML representation of an XML DTD if one of the --valid, --dtd, --html, or --docbook arguments is not specified. If the --html or --docbook argument is specified, this intermediate XML representation is converted into documentation in HTML or Docbook format respectively. Within the DTD, any comment directly followed by a line break and an element declaration is considered to be applicable to that element, and will be included as such in the documentation. A similar convention is applied for entity declarations, except that a comment directly following an entity declaration, with no separating line break, is also considered to be applicable to that entity. If the --valid argument is specified, dtdto constructs an XSLT stylesheet for validating an XML document with respect to the DTD.

OPTIONS

--help

Display usage information.

--debug level

Set debugging level. Default value is 0, with larger integers signifying more detailed debugging information.

--valid

Generate an XSLT stylesheet for validating an XML document with respect to the DTD.

--dtd

Convert the intermediate XML representation back to a DTD. Mainly useful for debugging.

--html

Convert the intermediate XML representation to DTD documentation in HTML format.

--docbook

Convert the intermediate XML representation to DTD documentation in Docbook format. Note that this output is intended for inclusion within a Docbook document, and is not itself a valid Docbook document.

--top-element element-name

Set the Docbook top level element.

--top-id id-string

Set the id attribute of the Docbook top level element.

--title title-string

Set the output document title.

--anchor-prefix prefix-string

Define a prefix for internal link anchors.

LIMITATIONS

The XML::DTD library has not yet been rigorously tested, and may fail to correctly parse some DTDs. External entities are not yet resolved, so DTDs consisting of multiple included sections will not be properly handled.

The XSLT validation (generated when the --valid argument is specified) is currently only partial: child elements are confirmed to conform to the content model of their parent, but there is no checking for spurious text nodes in a non-mixed content model, and attributes are not checked at all.

LICENSE

This software is made available under the terms of the GNU General Public License (version 2 or later).

AVAILABILITY

This utility is part of the XML::DTD Perl module, available from http://search.cpan.org/~wohl/XML-DTD/.

AUTHOR

Brendt Wohlberg <wohl@cpan.org>