DTDFLATTEN(1p)
π DTDFLATTEN π
okay bestie, so this is dtdflatten, a little user-contributed Perl thing (that's the 1p in the corner, iykyk) and honestly? it's giving flattening. let's get into it β¨
πΈ SYNOPSIS πΈ
dtdflatten [options]
π¦ DESCRIPTION π¦
so like. dtdflatten parses a DTD and prints out a flatten/expanded version of it, with all parameter entities expanded. that's the whole vibe. no cap.
the first non-option-related argument you drop on the command-line is the file to parse. and if you give no filename at all? bestie, it just reads the DTD from standard input. casual. iconic. π
the flattened DTD goes to standard output β unless you specify the --output option, in which case it goes wherever you told it to. periodt.
π OPTIONS π
--catalog <catalog>β specify catalog files to parse for resolving external entity references. you can drop this option multiple times if you're feeling extra.
NOTE: currently, only SGML Open Catalog format is supported. XML Catalog support is not implemented (yet). π don't come for me, it's on the list.
--debugβ extra debugging output. specify it multiple times to increase the amount of output β yes, you can stack it, go off. debugging output gets sent to standard error. π--declaration <file>β specify the SGML declaration. it gets parsed to figure out the type of DTD being parsed, XML or SGML. the key parts of the SGML declaration examined are theNAMECASEandCHARSETdirectives β that's what determines the DTD type. π
if no SGML declaration is available, you can use the --xml, --namecase-general, and --namecase-entity options instead. slay, we have backup plans.
--output <file>β output file. if not specified, standard output is used. the classic default. π«Ά--preserve <entity-name>β preserve the parameter entity declaration denoted by <entity-name>. specify it multiple times if you've got a whole roster.
note: if <entity-name> matches any portion of a parameter entity, the parameter entity declaration will be preserved. any portion, bestie. it's generous like that. β¨
--verbose/--noverboseβ print parsing progress. by default, this option is enabled. verbose output is sent to standard error.
if --debug is specified, then this option is automatically enabled. it just turns itself on. main character energy tbh. π
--versionβ print version and synopsis. the receipts. π§Ύ--helpβ print synopsis and options available. your lil cheat sheet. π--manβ print manual page. you are literally here rn. meta. πͺ
π₯ SEE ALSO π₯
dtdparse
also, go look at SGML::DTDParse for an overview of the DTDParse package β that's the whole friend group. π
π PREREQUISITES π
Getopt::LongText::DelimMatchXML::Parser
gotta have the squad installed, fr fr. π¦
β AVAILABILITY β
<http://dtdparse.sourceforge.net/>
π AUTHORS π
originally developed by Norman Walsh, <ndw@nwalsh.com>. π«‘
Earl Hood <earl@earlhood.com> picked up support and maintenance. handing over the aux cord, respectfully. π§
π COPYRIGHT AND LICENSE π
see SGML::DTDParse for copyright and license information. that's where the legal lore lives.
and that's the whole page bestie!! this one's from perl v5.32.1, dated 2022-01-21, and it's part of the User Contributed Perl Documentation β so like, the community shelf of Perl goodies. go flatten something, you've got this πβ¨πΈ
π¦ 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