DTDPARSE(1p)

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

πŸ’– 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 the NAMECASE and CHARSET directives β€” 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 whether NAMECASE GENERAL is YES or NO. The default is YES unless --xml is specified. πŸ”€
  • --namecase-entity
  • --nonamecase-entity β€” same deal, but for NAMECASE 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... πŸ˜­πŸ’–


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