Don’t call me DOM

12 September 2007

DTD comparison

As a follow-up on my toying with DTDs, I added a new Python script to my toolbox this morning: dtd-compare.py allows to compare the vocabularies defined in several DTDs to see which elements and attributes are present or absent among them.

For instance, running python dtd-compare.py http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd http://www.openmobilealliance.org/tech/DTD/xhtml-mobile10.dtd http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd has allowed me to build a comparison of the various mobile XHTML flavors with the content of XHTML 1.0 Strict.

I haven’t included XHTML MP 1.1 and XHTML MP 1.2 in that comparison chart since the officlal DTDs seems to have syntax errors, reported by the script as follows:

ERROR: character set conversion problem: 'utf8' codec can't decode byte 0xa9 in position 260: unexpected code byte at http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd:1:0
ERROR: character set conversion problem: 'utf8' codec can't decode byte 0x92 in position 715: unexpected code byte at http://www.openmobilealliance.org/tech/DTD/xhtmlmp12-form-1.mod:1:0

3 Responses to “DTD comparison”

  1. MWI Team Blog Says:

    Comparisons of XHTML flavors…

    As a follow-up on my XHTML Basic 1.1 cheat sheet, I’ve continued to play with the parsing of DTDs to make it possible to generate automatically comparisons of what the various flavors of XHTML contain in terms of elements and attributes.
    The comparis…

  2. Dom Says:

    The error on the XHTML MP 1.1 DTD was already described by Ruadhan, over at dev.mobi.

    I’m sending a bug reports on both issues to the OMA technical questions mailing list, will see how that goes.

  3. Dom Says:

    I just added MP 1.1 and 1.2 to the table, using local corrected copies of the DTD.

    I would like to find a better way to display the data in this big table, though…

Picture of Dominique Hazael-MassieuxDominique Hazaël-Massieux (dom@w3.org) is part of the World Wide Web Consortium (W3C) Staff; his interests cover a number of Web technologies, as well as the usage of open source software in a distributed work environment.