DTDFLATTEN(1p)

πŸ“¦
version 2.00 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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 the NAMECASE and CHARSET directives β€” 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::Long
  • Text::DelimMatch
  • XML::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. 🎧


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