[lxml-dev] Invalid Schematron

Hi all, i'm trying to validate an OVAL (http://oval.mitre.org) xml document against it's schematron rules ( http://oval.mitre.org/language/version5.7/ovaldefinition/schematron/oval-def... ) Following the manual (http://codespeak.net/lxml/validation.html) i wrote the following piece of code: from lxml import etree rule = open("oval-definitions-schematron.sch") defs = open("oval.xml") sct_doc = etree.parse(rule) try: schematron = etree.Schematron(sct_doc) except etree.SchematronParseError, e: print e.args print e.error_log print e.message doc = etree.parse(defs) print schematron.validate(doc) but i got the following error(s): Document is not a valid Schematron schema oval-definitions-schematron.sch:34:0:ERROR:SCHEMASP:SCHEMAP_NOROOT: Expecting a pattern element instead of phase (repeated N times) ... oval-definitions-schematron.sch:1547:0:ERROR:SCHEMASP:SCHEMAP_NOROOT: Failed to compile context expression oval-def:objects/*/*[@datatype='binary']|oval-def:states/*/*[@datatype='binary']|oval-def:states/*/* (repeated N times) $ dpkg -l | grep libxml2 ii libxml-libxml-perl 1.70.ds-1 Perl interface to the libxml2 library ii libxml2 2.7.6.dfsg-1ubuntu1 GNOME XML library ii libxml2-dev 2.7.6.dfsg-1ubuntu1 Development files for the GNOME XML library ii libxml2-utils 2.7.6.dfsg-1ubuntu1 XML utilities ii python-libxml2 2.7.6.dfsg-1ubuntu1 Python bindings for the GNOME XML library on Ubuntu 10.04 Can you help me? Thanks --- Masetto

masetto <masetto4ever <at> gmail.com> writes:
snip<
Can you help me?
Thanks---Masetto
I'm having the same problem. In my case I get the error Failed to compile context expression //*[gmd:identificationInfo/gmd:MD_DataIdentification] in the schematron rule: <sch:rule context="//*[gmd:identificationInfo/gmd:MD_DataIdentification]"> Thanks, Jim

masetto <masetto4ever <at> gmail.com> writes:
snip<
Can you help me?
Thanks---Masetto
I'm having the same problem. In my case I get the error Failed to compile context expression //*[gmd:identificationInfo/gmd:MD_DataIdentification] in the schematron rule: <sch:rule context="//*[gmd:identificationInfo/gmd:MD_DataIdentification]"> Thanks, Jim
participants (3)
-
James Long
-
masetto
-
Stefan Behnel