From f61d3988767c105a881ea544eb363d2b3939a1ca Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 7 Dec 2025 01:25:01 +0000 Subject: [PATCH 1/2] Update .inx schema to ISO Schematron Schematron has two "flavors"; the pre-2006 Schematron 1.6 (xmlns="http://www.ascc.net/xml/schematron") and the modern ISO Schematron (xmlns=http://purl.oclc.org/dsdl/schematron). --- inkex/tester/inkscape.extension.schema | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/inkex/tester/inkscape.extension.schema b/inkex/tester/inkscape.extension.schema index 63cb97bc..0fd9834e 100644 --- a/inkex/tester/inkscape.extension.schema +++ b/inkex/tester/inkscape.extension.schema @@ -1,9 +1,10 @@ - - - - - Warning: @value values should be unique for a given option. - - - + + + + duplicateOptionValues + + Warning: @value values should be unique for a given option. + + + -- GitLab From 04b3cc3d2eb592407edbad3b5b43664f700cbac0 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 7 Dec 2025 01:26:00 +0000 Subject: [PATCH 2/2] migrate inx schemas validation from `lxml.etree` to `lxml.isoschematron` without this, schema validation is not supported by newer lxml builds. lxml ships two classes to ingest & validate Schematron files: - `lxml.etree.Schematron` - `lxml.isoschematron.Schematron` the former is a wrapper around libxml2's schematron component, which is disabled by default as of 2.15 and planned for removal in 2.16 the latter is maintained as part of lxml itself. by using it we can support schema validation regardless of the user's libxml2 version. --- inkex/tester/inx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inkex/tester/inx.py b/inkex/tester/inx.py index 0c2e5d59..e14642a1 100644 --- a/inkex/tester/inx.py +++ b/inkex/tester/inx.py @@ -8,7 +8,7 @@ import os import sys from importlib import resources -from lxml import etree +from lxml import etree, isoschematron from ..utils import PY3 from ..inx import InxFile @@ -151,7 +151,7 @@ class InxMixin: def _load_inx_schemas(): _SCHEMA_CLASSES = { ".rng": etree.RelaxNG, - ".schema": etree.Schematron, # "pre-ISO-Schematron" + ".schema": isoschematron.Schematron, } if sys.version_info > (3, 9): -- GitLab