/usr/share/perl5/SGML/DTDParse.pm is in libsgml-dtdparse-perl 2.00-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | #
# $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<dtdparse|dtdparse>. 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<dtdformat> which can produce HTML
or DocBook L<http://www.oasis-open.org/docbook/> 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<dtdparse|dtdparse> (the DTD is also provided in the file C<etc/dtd.dtd>
of the DTDParse distribution):
<!-- This is the DTD for the documents produced by DTDParse.
The public identifier for this DTD is:
"-//Norman Walsh//DTD DTDParse V2.0//EN"
-->
<!ELEMENT dtd (notation|entity|element|attlist)+>
<!ATTLIST dtd
version CDATA #REQUIRED
unexpanded CDATA #IMPLIED
title CDATA #IMPLIED
namecase-general CDATA #IMPLIED
namecase-entity CDATA #IMPLIED
xml CDATA #IMPLIED
system-id CDATA #IMPLIED
public-id CDATA #IMPLIED
declaration CDATA #IMPLIED
created-by CDATA #IMPLIED
created-on CDATA #IMPLIED
>
<!ELEMENT notation EMPTY>
<!ATTLIST notation
name CDATA #REQUIRED
public CDATA #IMPLIED
system CDATA #IMPLIED
>
<!ELEMENT entity (text-expanded?, text?)>
<!ATTLIST entity
name CDATA #REQUIRED
type CDATA #REQUIRED
notation CDATA #IMPLIED
public CDATA #IMPLIED
system CDATA #IMPLIED
>
<!ELEMENT text (#PCDATA)*>
<!ELEMENT text-expanded (#PCDATA)*>
<!ELEMENT element (content-model-expanded, content-model?,
inclusions?, exclusions?)>
<!ATTLIST element
name CDATA #REQUIRED
stagm CDATA #IMPLIED
etagm CDATA #IMPLIED
content-type (element|mixed|cdata|empty|rcdata) #IMPLIED
>
<!ENTITY % cm.mix "sequence-group|or-group|and-group
|element-name|parament-name
|pcdata|cdata|rcdata|empty">
<!ELEMENT content-model-expanded (%cm.mix;)>
<!ELEMENT content-model (%cm.mix;)>
<!ELEMENT inclusions (%cm.mix;)>
<!ELEMENT exclusions (%cm.mix;)>
<!ELEMENT sequence-group (%cm.mix;)*>
<!ATTLIST sequence-group
occurrence CDATA #IMPLIED
>
<!ELEMENT or-group (%cm.mix;)*>
<!ATTLIST or-group
occurrence CDATA #IMPLIED
>
<!ELEMENT and-group (%cm.mix;)*>
<!ATTLIST and-group
occurrence CDATA #IMPLIED
>
<!ELEMENT element-name EMPTY>
<!ATTLIST element-name
name CDATA #REQUIRED
occurrence CDATA #IMPLIED
>
<!ELEMENT parament-name EMPTY>
<!ATTLIST parament-name
name CDATA #REQUIRED
>
<!ELEMENT empty EMPTY>
<!ELEMENT pcdata EMPTY>
<!ELEMENT cdata EMPTY>
<!ELEMENT rcdata EMPTY>
<!ELEMENT attlist (attdecl, attribute+)>
<!ATTLIST attlist
name CDATA #REQUIRED
>
<!ELEMENT attdecl (#PCDATA)>
<!ELEMENT attribute EMPTY>
<!ATTLIST attribute
name CDATA #REQUIRED
type CDATA #REQUIRED
enumeration (yes|no|notation) #IMPLIED
value CDATA #REQUIRED
default CDATA #REQUIRED
>
=head1 SEE ALSO
L<dtdparse|dtdparse>,
L<dtdformat|dtdformat>,
L<dtddiff|dtddiff>,
L<dtdflatten|dtdflatten>,
L<SGML::DTDParse::DTD|SGML::DTDParse::DTD>
=head1 PREREQUISITES
The prerequisites listed are for all modules and scripts:
B<Getopt::Long>,
B<Text::DelimMatch>,
B<XML::Parser>,
B<XML::DOM>
For prerequisites that apply for a specific script or module,
see the individual scripts' and modules' reference pages.
=head1 AVAILABILITY
E<lt>I<http://dtdparse.sourceforge.net/>E<gt>
=head1 AUTHORS
DTDParse package originally developed by Norman Walsh,
E<lt>ndw@nwalsh.comE<gt>.
Earl Hood, E<lt>earl@earlhood.comE<gt>, 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.
|