# # $Id: DTDParse.pm,v 2.2 2005/07/16 03:21:35 ehood Exp $ package SGML::DTDParse; $VERSION = "2.00"; sub Version { $VERSION; } require 5.005; ## General utilities for programs @SGML::DTDParse::CommonOptions = ( 'help', 'man', 'version', ); sub process_common_options { my $opts = shift; usage(-verbose => 0, -exitval => 0) if ($opts->{'version'}); usage(-verbose => 1, -exitval => 0) if ($opts->{'help'}); usage(-verbose => 2, -exitval => 0) if ($opts->{'man'}); } sub usage { require Pod::Usage; require FindBin; Pod::Usage::pod2usage( { -message => join('', 'Version: ', $FindBin::Script, ' v', $VERSION, "\n"), @_ }); } 1; __END__ =head1 NAME SGML::DTDParse - Parse an SGML or XML DTD =head1 SYNOPSIS use SGML::DTDParse; print "This is DTDParse v$SGML::DTDParse::VERSION\n"; =head1 DESCRIPTION The DTDParse collection is a set of Perl modules and scripts for manipulating SGML an XML Document Type Definitions (DTDs). DTDParse is designed primarily to aid in the understanding and documentation of DTDs. Typical usage of this package is as follows: =over =item 1. Parse the DTD with L. This produces an XML representation of the DTD. This representation exposes both the logical structure of the DTD (the actual meta-structure of its grove) and the organizational structure of the DTD (the declarations and parameter entities) that comprise its textual form. =item 2. Manipulate the XML document produced by dtdparse to do whatever you want. DTDParse is shipped with several programs that demonstrate various capabilities, including B which can produce HTML or DocBook L RefEntry pages for each element and parameter entity in the DTD. =back =head1 DTDParse XML DTD The following is the XML DTD for XML documents created with L (the DTD is also provided in the file C of the DTDParse distribution): =head1 SEE ALSO L, L, L, L, L =head1 PREREQUISITES The prerequisites listed are for all modules and scripts: B, B, B, B For prerequisites that apply for a specific script or module, see the individual scripts' and modules' reference pages. =head1 AVAILABILITY EIE =head1 AUTHORS DTDParse package originally developed by Norman Walsh, Endw@nwalsh.comE. Earl Hood, Eearl@earlhood.comE, picked up support and maintenance. =head1 COPYRIGHT AND LICENSE Copyright (C) 1999-2001, 2003 Norman Walsh Copyright (C) 2005, Earl Hood DTDParse may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the DTDParse distribution.