DTDDIFF(1p)
π DTDDIFF π
okay bestie, gather round, because this is dtddiff from the 1p manual β the perl-contributed-pages girlies know β and she is here to compare two SGML/XML DTDs and tell you exactly what changed. no cap. π¦
β¨ NAME β¨
dtddiff β compare two SGML/XML DTDs. that's it. that's the whole job. she's focused, she's iconic, she's not doing anything else. π
πΈ SYNOPSIS πΈ
dtddiff [options] <parsed-dtd1.xml> <parsed-dtd2.xml>
two parsed XML files, in, in that order. options go first. that's the vibe. β¨
π DESCRIPTION π
so here's the tea: dtddiff compares two SGML/XML DTDs, and it does it based on the XML dumps that dtdparse generates. like, you don't hand it raw DTDs β you hand it the parsed versions. here's the typical usage flow, literally:
dtdparse --outfile parsed-dtd1.xml dtd1.dtd
dtdparse --outfile parsed-dtd2.xml dtd2.dtd
dtddiff parsed-dtd1.xml parsed-dtd2.xml > dtd.diff
and the reason it works this way? because dtddiff is chewing on the XML dumps from dtdparse, it gets to avoid a full reparse of the DTDs. obsessed. efficiency queen. π₯
dtddiff does a structural-based comparison. which means β and this is the important part, bestie β the order of declarations in the DTDs does not affect the comparison. move stuff around all you want, she sees through it. β¨
the output is similar in style to a context-based diff, like the one diff(1) does. here's an example of the kind of output she generates:
*** DocBook 4.1 DTD
--- DocBook 4.2 DTD
*************** Elements Added
--- DocBook 4.2 DTD ----
+ bibliocoverage
+ biblioid
+ bibliorelation
+ bibliosource
+ blockinfo
+ citebiblioid
+ coref
+ errortext
+ personblurb
+ personname
+ refsection
+ refsectioninfo
+ textdata
*************** Elements Changed
... [snip] ...
*** DocBook 4.1 DTD ****
! entrytbl ::=
(colspec*, spanspec*, thead?, tbody)
-(entrytbl)
entrytbl Attributes:
! charoff NUTOKEN #IMPLIED
! colname NMTOKEN #IMPLIED
! cols NUMBER #REQUIRED
! colsep NUMBER #IMPLIED
! nameend NMTOKEN #IMPLIED
! namest NMTOKEN #IMPLIED
! rowsep NUMBER #IMPLIED
! spanname NMTOKEN #IMPLIED
! tgroupstyle NMTOKEN #IMPLIED
--- DocBook 4.2 DTD ----
! entrytbl ::=
(colspec*, spanspec*, thead?, tbody)
entrytbl Attributes:
! charoff CDATA #IMPLIED
! colname CDATA #IMPLIED
! cols CDATA #REQUIRED
! colsep CDATA #IMPLIED
! nameend CDATA #IMPLIED
! namest CDATA #IMPLIED
! rowsep CDATA #IMPLIED
! spanname CDATA #IMPLIED
! tgroupstyle CDATA #IMPLIED
... [snip] ...
*** DocBook 4.1 DTD ****
graphic Attributes:
! depth NUTOKEN #IMPLIED
! format [Enumeration] #IMPLIED
! BMP, CGM-CHAR, CGM-
! BINARY, CGM-CLEAR,
! DITROFF, DVI, EPS, EQN,
! FAX, GIF, GIF87a, GIF89a,
! JPG, JPEG, IGES, PCX,
! PIC, PNG, PS, SGML, TBL,
! TEX, TIFF, WMF, WPG,
! linespecific
! scale NUMBER #IMPLIED
! scalefit NUMBER #IMPLIED
! width NUTOKEN #IMPLIED
--- DocBook 4.2 DTD ----
graphic Attributes:
+ contentdepth CDATA #IMPLIED
+ contentwidth CDATA #IMPLIED
+ valign [Enumeration] #IMPLIED
+ top, middle, bottom
! depth CDATA #IMPLIED
! format [Enumeration] #IMPLIED
! BMP, CGM-CHAR, CGM-
! BINARY, CGM-CLEAR,
! DITROFF, DVI, EPS, EQN,
! FAX, GIF, GIF87a, GIF89a,
! JPG, JPEG, IGES, PCX,
! PIC, PNG, PS, SGML, TBL,
! TEX, TIFF, WMF, WPG, SVG,
! linespecific
! scale CDATA #IMPLIED
! scalefit CDATA #IMPLIED
! width CDATA #IMPLIED
... [snip] ...
now, the decoder ring for those lil symbols at the start of lines, because iykyk:
- lines starting with
"- "β that's a minus followed by a space, bestie β denote items removed. π - lines starting with
"+ "β a plus followed by a space β denote items added. β¨ - lines starting with
"! "β an exclamation point followed by a space β denote items changed. π
periodt.
π OPTIONS π
--attributes,--noattributesβ print, or not, element attribute differences. the default is to print differences. β¨--content-model-expanded,--nocontent-model-expandedβ expand, or not expand, element content models during comparison. expanded models have all parameter entities resolved. the default is to use expanded content model.--elements,--noelementsβ print, or not, element content model differences. the default is to print differences.--general-ents,--nogeneral-entsβ print, or not, general entity differences. the default is to not print differences.--parameter-ents,--noparameter-entsβ print, or not, parameter entity differences. the default is to not print differences.--dumpβ do a textual dump of a DTD. when this option is specified, only a single DTD is dumped. this is mainly used for debugging purposes. π--versionβ print version and synopsis.--helpβ print synopsis and options available.--manβ print manual page.
π¦ SEE ALSO π¦
dtdparsedtddiff2html
see SGML::DTDParse for an overview of the DTDParse package. that's where all the lore lives, bestie. π
π§ PREREQUISITES π§
she needs her girls:
File::BasenameGetopt::LongXml::Parser
π AVAILABILITY π
http://dtdparse.sourceforge.net/
π AUTHORS π
Earl Hood, <earl@earlhood.com> π
πΈ COPYRIGHT AND LICENSE πΈ
see SGML::DTDParse for copyright and license information. (she's keeping it mysterious. we respect it.) β¨
okay that's the whole page, we're done here. this one shipped as perl v5.32.1, dated 2022-01-21, and honestly? she ate. π«Άπ bye bestie, go diff some DTDs. π
π¦ 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