DTDPARSE(1p)
π DTDPARSE(1p) π
okay bestie, gather round β this is dtdparse, a lil Perl script from the User Contributed Perl Documentation corner of the manual. It's giving DTD glow-up and honestly? iconic. π¦
β¨ NAME β¨
dtdparse β Generate an XML representation of an SGML or XML DTD. periodt. π
πΈ SYNOPSIS πΈ
dtdparse [options] [dtdfile]
π DESCRIPTION π
So like, dtdparse parses an XML or SGML DTD and prints out an XML representation of it. Why would you want that? Because that XML version can get handed off to other tools to help with analyzing and documenting the DTD. it's a whole pipeline moment. π
The first non-option-related argument you drop on the command line tells it which file to parse. No filename? No problem β then the DTD gets read from standard input. fr fr, it'll just vibe there waiting. π
The generated XML document goes to standard output, unless you specified the --output option. then it goes where you told it to, obviously. π
β¨ OPTIONS β¨
--catalog <catalog>β tell it which catalog files to parse so it can resolve external entity references. you can stack this option multiple times, go off. ποΈ
NOTE: Currently, only SGML Open Catalog format is supported. XML Catalog support is not implemented (yet). π don't come for me, it's a roadmap thing.
--debugβ extra debugging output, because sometimes you just need to see everything. π Stack it multiple times to crank up how much output you get.
Debugging output gets sent to standard error. (stderr stays unbothered, stdout stays clean. slay.)
--declaration <file>β specify the SGML declaration. This declaration gets parsed to figure out whether the DTD you're dealing with is XML or SGML. The key parts of the SGML declaration it examines are theNAMECASEandCHARSETdirectives β that's how it determines the DTD type. π
If you don't have an SGML declaration lying around, you can use the --xml, --namecase-general, and --namecase-entity options instead. bestie backup plan. π
--namecase-general--nonamecase-generalβ when there's no SGML declaration, these options specify whetherNAMECASE GENERALis YES or NO. The default is YES unless--xmlis specified. π€--namecase-entity--nonamecase-entityβ same deal, but forNAMECASE ENTITY, when there's no SGML declaration. These specify if it's YES or NO. The default is NO. π·οΈ--output <file>β specifies the filename to send XML output to. bye bye stdout, hello file. π--public-id <pubid>β the DTD's public ID. πͺͺ--system-id <sysid>β the DTD's system ID. π--title <title>β set the title of the DTD. give it a lil name, it deserves one. π--unexpanded--nounexpandedβ include, or do not include, unexpanded content models in the generated XML. By default, unexpanded content models are included. β
It's super common for DTD authors and maintainers to use parameter entities inside content models. When this option is enabled, dtdparse will include a version of content models with parameter entities not expanded. iykyk. π«Ά
--verbose--noverboseβ print parsing progress. By default, this option is enabled. Verbose output goes to standard error. π’
If --debug is specified, then this option is automatically enabled. no takebacks.
--xml--noxmlβ when there's no SGML declaration, this option says whether the DTD is an XML DTD or an SGML DTD (the default is--noxml). π--versionβ print version and synopsis. π--helpβ print synopsis and options available. π--manβ print manual page. (hi, that's this. you're literally here. π)
π« SEE ALSO π«
dtdformat, dtddiff, dtdflatten β the whole friend group, go check them out. π«
See SGML::DTDParse for an overview of the DTDParse package. that's the main character wiki page, fr.
π§ PREREQUISITES π§
Getopt::Long, Text::DelimMatch β yes bestie, it needs these two to function. install them. π
π AVAILABILITY π
<http://dtdparse.sourceforge.net/> β that's the link, go get it. β
π AUTHORS π
Originally developed by Norman Walsh, <ndw@nwalsh.com>. π«‘
Earl Hood <earl@earlhood.com> picked up support and maintenance. the way that someone stepped up to keep the dream alive... ππ
π COPYRIGHT AND LICENSE π
See SGML::DTDParse for copyright and license information. π
okay that's the whole page!! πΈ This one's from perl v5.32.1, dated 2022-01-21, and it lives under DTDPARSE(1p). mwah, go parse something cute. πβ¨π
π¦ where this page comes from
- debian bookworm: libsgml-dtdparse-perl 2.00-3 Β· Artistic-1.0-Perl OR GPL-2.0-only
- debian trixie: libsgml-dtdparse-perl 2.00-3 Β· Artistic-1.0-Perl OR GPL-2.0-only
- ubuntu jammy: libsgml-dtdparse-perl 2.00-3 Β· Artistic-1.0-Perl OR GPL-2.0-only
- ubuntu noble: libsgml-dtdparse-perl 2.00-3 Β· Artistic-1.0-Perl OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms