lxml 4.2.3: failure in isoschematron.Schematron()

Bug #1783890 reported by Alexis de Lattre on 2018-07-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Components version (on Ubuntu 18.04) :
Python : sys.version_info(major=2, minor=7, micro=15, releaselevel='candidate', serial=1)
lxml.etree : (4, 2, 3, 0)
libxml used : (2, 9, 8)
libxml compiled : (2, 9, 8)
libxslt used : (1, 1, 32)
libxslt compiled : (1, 1, 32)

Steps to reproduce the infinite loop:
cd /tmp
git clone https://github.com/CenPC434/validation.git

Then run the following python script:
#! /usr/bin/python2.7

from lxml import etree
from lxml import isoschematron

f = open('/tmp/validation/cii/schematron/EN16931-CII-validation.sch', 'r')
sct_root = etree.parse(f)
print("sct_root=%s" % sct_root)
# print(etree.tostring(sct_root, pretty_print=True))
schematron = isoschematron.Schematron(sct_root)
print("schematron=%s" % schematron)

And you get an infinite loop when you reach the line isoschematron.Schematron().
The same bug exists for this other schematron : "/tmp/validation/ubl/schematron/EN16931-UBL-model.sch"

Alexis de Lattre (alexis-via) wrote :

I was told I had to wait longer because it could take up to 30 minutes to generate XSLT from these schematron files. So I waited longer and, after 20 minutes, I get this crash:

Traceback (most recent call last):
  File "./fx-schematron.py", line 10, in <module>
    schematron = isoschematron.Schematron(sct_root, store_report=True)
  File "/usr/local/lib/python2.7/dist-packages/lxml/isoschematron/__init__.py", line 285, in __init__
    validator_xslt = self._compile(schematron, **compile_params)
  File "src/lxml/xslt.pxi", line 600, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Fail: This implementation of ISO Schematron does not work with
        schemas using the "xslt2" query language.

So the problem is not an infinite loop... but a missing feature ?

summary: - lxml 4.2.3: infinite loop in isoschematron.Schematron()
+ lxml 4.2.3: failure in isoschematron.Schematron()
scoder (scoder) wrote :

libxslt does not support XSLT2.

Changed in lxml:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers