Opened 10 months ago

Last modified 9 months ago

#5561 new task

Automate validation of html version of postgis manual

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.5.0
Component: QA/testsuite Version: master
Keywords: documentation, html Cc:

Description

At the moment the generated html is not checked for validity. This ticket is to add a Makefile check target for it.

It may be easy to do if we keep the xhtml format as xmllint could then be used to validate. See #5559 and #5555

Change History (4)

comment:1 by strk, 10 months ago

Both Ubuntu-22.04 and Debian-11 have this package available:

  • xhtml-relaxng - Implementation in RELAX NG of the modularization of XHTML

RelaxNG validation is already used for the source XML so it would be the natural way to validate the XHTML output.

comment:2 by strk, 10 months ago

Some errors are found pretty early by RelaxNG but I'm not sure they are real errors:

# xmllint --noout --relaxng /usr/share/xml/xhtml-relaxng/xhtml.rng html/postgis-en.html 
html/postgis-en.html:2: element div: Relax-NG validity error : Element body has extra content: div
html/postgis-en.html fails to validate

That's the very first <div> after <body>, which sounds perfectly fine to me …

Using the "basic" RelaxNG finds other kind of invalidities:

$ xmllint --noout --relaxng /usr/share/xml/xhtml-relaxng/xhtml-basic.rng html/postgis-en.html 
html/postgis-en.html:33: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:39: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:40: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:41: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:41: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:43: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:43: element hr: Relax-NG validity error : Did not expect element hr there
html/postgis-en.html:43: element hr: Relax-NG validity error : Element div has extra content: hr
html/postgis-en.html:269: element section: Relax-NG validity error : Did not expect element section there
html/postgis-en.html:269: element section: Relax-NG validity error : Element div has extra content: section
html/postgis-en.html fails to validate

comment:3 by strk, 10 months ago

Another commandline validator option (suggested from #xml on libera): https://pypi.org/project/vnu-validator/

comment:4 by strk, 9 months ago

Component: buildQA/testsuite
Keywords: html added; testsuite removed
Note: See TracTickets for help on using tickets.