Hi,
I was now able to reproduce with several unit tests that reformatting the style sheet will get rid of the bug where lxml is reporting "<string>:0:0:ERROR:XSLT:ERR_OK: unknown error“ when it should not. Creating style sheets with Xerces/J instead of xsltproc did not help either.
I reported this as bug #1567633.
- Rainer
I still don't quite follow. While there seems to be different behaviour between xsltproc and etree.XSLT: How do you create the validating xsls from the schematron schema? Looks like this works just fine if I use lxml.isoschematron directly on the schematron schema:
from lxml import etree print etree.__version__3.6.0 print etree.LIBXML_VERSION, etree.LIBXML_COMPILED_VERSION (2, 9, 1) (2, 9, 1) print etree.LIBXSLT_VERSION, etree.LIBXSLT_COMPILED_VERSION (1, 1, 28) (1, 1, 28) schematron = isoschematron.Schematron(file="/tmp/rule04E_complete.sch", store_report=True) doc = etree.parse("/tmp/rule4_test1_idp_missing_key.xml") schematron.validate(doc) False print schematron.validation_report <?xml version="1.0" standalone="yes"?> <svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schold="http://www.ascc.net/xml/schematron" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:iso="http://purl.oclc.org/dsdl/schematron" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:rpi="urn:oasis:names:tc:SAML:metadata:rpi" xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui" xmlns:alg="urn:oasis:names:tc:SAML:metadata:algsupport" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init" title="" schemaVersion="ISO19757-3"> <!--
--> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:2.0:metadata" prefix="md"/> <svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2000/09/xmldsig#" prefix="ds"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:metadata:rpi" prefix="rpi"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:metadata:ui" prefix="mdui"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:metadata:algsupport" prefix="alg"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:2.0:assertion" prefix="saml"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" prefix="idpdisc"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:metadata:attribute" prefix="mdattr"/> <svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:tc:SAML:profiles:SSO:request-init" prefix="init"/> <svrl:active-pattern id="Rule04" name="Rule04"/> <svrl:fired-rule context="//md:IDPSSODescriptor"/> <svrl:failed-assert test="md:KeyDescriptor[@use='signing' or not (@use)]/ds:KeyInfo/ds:X509Data/ds:X509Certificate" location="/*[local-name ()='EntityDescriptor' and namespace-uri ()='urn:oasis:names:tc:SAML:2.0:metadata']/*[local-name ()='IDPSSODescriptor' and namespace-uri ()='urn:oasis:names:tc:SAML:2.0:metadata']"> <svrl:text> Error (04): Each IDPSSODescriptor must contain a signing key as X509Certificate (child element of X509Data) </svrl:text> </svrl:failed-assert> </svrl:schematron-output> Internally, lxml.isoschematron generates the validation stylesheets base on the isoschematron skeleton reference implementation (the XSLs are included in the lxml.isoschematron package). Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart