uddf-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Uddf-public] validating uddf with schematron


From: Artur Wroblewski
Subject: [Uddf-public] validating uddf with schematron
Date: Fri, 26 Jul 2013 01:27:37 +0100

Hi,

The UDDF specification states that (as I understand it)

- depth and divetime of first waypoint should be zero
- depth of last waypoint should be zero

See

    http://www.streit.cc/extern/uddf_v320/en/waypoint.html

It would be nice to have ability to validate UDDF files if they comply
with such rules.

Unfortunately, it cannot be done with XML Schema, but apparently
for more complex rules we can use Schematron (ISO approved
standard)

    https://en.wikipedia.org/wiki/Schematron#Schematron_as_an_ISO_Standard

Please take a look at attached files

- ostc-dump-26.uddf - sample UDDF file
- uddf.xsd - XML Schema (for UDDF 3.2.0)
- uddf.sch - Schematron file containing waypoint rules mentioned above

If, in the ostc-dump-26.uddf file, we change depth of first waypoint's
depth to "1.0" and run the following command

    xmllint --noout --schema uddf.xsd --schematron uddf.sch ostc-dump-26.uddf

The output is

    /*/*[4]/*/*/*[2] line 35: Depth of first waypoint is not 0
    ostc-dump-26.uddf fails to validate
    ostc-dump-26.uddf validates

First two lines above are output of Schematron validation. The last one is
from XML Schema validation.

I have attached uddf-valid.py as an example how above can be performed
using Python and lxml.

Until someone disagrees, I will put the latest version of XML Schema
and the Schematron file into repository at

    http://git.savannah.gnu.org/cgit/uddf.git

Best regards,

Artur

Attachment: ostc-dump-26.uddf
Description: Binary data

Attachment: uddf.sch
Description: Binary data

Attachment: uddf.xsd
Description: Binary data

Attachment: uddf-valid.py
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]