[xml/sgml-pkgs] Bug#686820: xmllint: Please make xmllint detect more bugs with indexterm ranges in docbook files
Daniel Leidert
Daniel.Leidert.Spam at gmx.net
Thu Sep 6 12:00:59 UTC 2012
Petter Reinholdtsen wrote:
> When checking docbook XML files, there are a few errors in the indexterm
> entries that are undetected. It will detect if there is a endofrange
> entry without the corresponding startofrange.
That is becausing an IDREF must refer to an existing ID.
> It will also detect if
> there are two startofrange with the same ID.
IDs must be unique inside an XML document. So ditto.
xmllint can easily check for these kind of issues.
> But it will not detect
>
> (1) if there is a startofrange without a endofrange.
This one cannot be expressed using a DTD.
> (2) if there are two endofrange with the same ID.
The second refers not to IDs in the meaning of what is an ID in an
XML file. The DTD says, that startref is an IDREF. Therefor it is
allowed by the DTD, that two or more indexterms of class 'endofrange'
exist using the same IDREF, even if this is not the expected content
of an DB file.
IMO there is no way to make xmllint check for these kind of issues
using the DocBook DTD. There are some rewrites of the DocBook
DTD using RelaxNG and XSD. Maybe one of them has the abilities to
express the conditions you are looking for (I don't know it). For
RelaxNG I'd recommend jing-trang for validation. xmllint AFAIK has
some issues in validating RelaxNG when using larger RNG definition
files. Maybe better ask on the appropriate docbook list.
Regards, Daniel
More information about the debian-xml-sgml-pkgs
mailing list