DTDDIFF(1p)

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

πŸ’– 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 πŸ¦‹

  • dtdparse
  • dtddiff2html

see SGML::DTDParse for an overview of the DTDParse package. that's where all the lore lives, bestie. πŸ“š


🧚 PREREQUISITES 🧚

she needs her girls:

  • File::Basename
  • Getopt::Long
  • Xml::Parser

🌈 AVAILABILITY 🌈

http://dtdparse.sourceforge.net/


πŸ‘‘ AUTHORS πŸ‘‘

Earl Hood, <earl@earlhood.com> πŸ’Œ


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