masetto <masetto4ever <at> gmail.com> writes:
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- definitions-schematron.sch) 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
snip<
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/*/*[ <at> datatype='binary']|oval-def:states/*/*[ <at> datatype='binary']|oval-def:states/*/* (repeated N times)
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