Opened 13 months ago

Last modified 4 weeks ago

#5532 assigned defect

Improve validation of PostGIS Manual docbook

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.6.0
Component: documentation Version: master
Keywords: Cc:

Description (last modified by strk)

In addition (or instead of) using the DTD, we could use XMLSchema, RelaxNG and maybe Schematron. xmllint supports these switches:

—schema http://docbook.org/xml/5.0/xsd/docbook.xsd —relaxng http://docbook.org/xml/5.0/rng/docbook.rng

In both cases the URIs are looked up in xml catalogs, and we could use the xmlcatalog tool to verify local versions exist at configure time, this is what I have in my system:

$ xmlcatalog "" 'http://docbook.org/xml/5.0/xsd/docbook.xsd'
file:///usr/share/xml/docbook/schema/xsd/5.0/docbook.xsd
$ xmlcatalog "" 'http://docbook.org/xml/5.0/rng/docbook.rng'
file:///usr/share/xml/docbook/schema/rng/5.0/docbook.rng

I also seem to have a Schematron file, but when I try to use it I get an error:

$ xmllint --noout --nonet --schematron /usr/share/xml/docbook/schema/schematron/5.0/docbook.sch postgis-out.xml 
/usr/share/xml/docbook/schema/schematron/5.0/docbook.sch:6: element rule: Schemas parser error : Failed to compile context expression db:firstterm[@linkend]
/usr/share/xml/docbook/schema/schematron/5.0/docbook.sch:16: element rule: Schemas parser error : Failed to compile context expression db:glossterm[@linkend]
/usr/share/xml/docbook/schema/schematron/5.0/docbook.sch:26: element rule: Schemas parser error : Failed to compile context expression db:glosssee[@otherterm]
/usr/share/xml/docbook/schema/schematron/5.0/docbook.sch:31: element rule: Schemas parser error : Failed to compile context expression db:glossseealso[@otherterm]
Schematron schema /usr/share/xml/docbook/schema/schematron/5.0/docbook.sch failed to compile

Change History (5)

comment:1 by strk, 13 months ago

Description: modified (diff)
Summary: Validate postgis manual using XSD and RELAXNG schemasImprove validation of PostGIS Manual docbook

comment:2 by strk, 13 months ago

Schematron resolve too, here's the correct URI:

xmlcatalog "" http://docbook.org/xml/5.0/sch/docbook.sch
file:///usr/share/xml/docbook/schema/schematron/5.0/docbook.sch

It still fails to compile for me though

comment:3 by Sandro Santilli <strk@…>, 13 months ago

In 4d57cbcd/git:

Add relaxng validation

References #5532

comment:4 by strk, 13 months ago

Now only schematron is missing, but 5.0 (packaged in Ubuntu-22.04) is known to be bogus while 5.1 is reportedly ok. Using 5.1 might require us to include the file in our repo using a custom catalog, not sure it's worth at this time

comment:5 by robe, 4 weeks ago

Milestone: PostGIS 3.5.0PostGIS 3.6.0
Note: See TracTickets for help on using tickets.