1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
xml validation with xmllint
[PROBLEM]
nsgmls aka "make test" does not detect entity usage without
trailing ';', either add additional checks or switch to a
different, more XML-specific validator.
[SOLUTION]
xmllint form libxml package. xlstproc form the same package seems to be
XLST processor of choice. The english version of the enhanced chm manual
is produced by xsltproc. It seems a good idea to use programms out aof the
same package.
[TESTRESULTS]
xmllint detects entity usage without trailing ';', also missing ids,
entities and double usage of IDs.
xmllint needs to be run several times.
(A) The first run should be used to detect wrong entities, without trailing ;
This errors should be fixed on the fly with a php script.
(B) The second run should be used to detect valid missing entities.
(c) The third run should be used to detect valid missing ids.
Multiple runs of xmllint seems to be necessary. As long as wrong entities
(without trailing ;) exists, the error output is not usable to create valid
missing entities. Also is seems there is no way to convince convince xmllint
to report errors for missing entities and missing IDREFS in the same run.
[POSSIBLE SOLUTIONS]
(1) long time:
Processing the manual with xsltproc relies on valid entities. Therefore it's
mandatory to ensure valid entities in all lang modules.
- We need a script to catch wrong entities from the first run of xmllint, which
corrects them on the fly.
- We need a script to produce missing-entities.ent and missing-ids.xml
- Makefile.in and configure.in adjustments:
(a) detect/check for xmllint.
(b) include the above mentioned scripts in the build system
(2) short time:
Use xmllint to check for non valid entities only.
- Makefile.in and configure.in adjustments as above (1a)
- missing-entities and missing-ids are produced through existing mechanisms.
- additional make target for xmllint to check for wrong entities.
Feb 10 2003: betz
build system adjusted to detect xmllint
additional support for win, with the possibilty to use
phpdoc-tools/libxml for xslt and xmllint, rather than the
cygwin versions.
A first script to create missing-entities.ent and missing-ids.xml
from xmllint output can be found in scripts/test_missting-entities.php.in
Testing was done with libxml 20430 and 20502
|