Re: [lxml-dev] Whoops, Internal Error

Stefan, I can reproduce this problem on Cygwin and Fedora Core 6 which have libxml2 2.6.26 and 2.6.26 respectively. Sorry if I have confused things by sending that schema doc. There are 6 different schema documents involved: xccdf-1.1.xsd xccdfp-1.1.xsd xml.xsd platform-0.2.3.xsd cpe-1.0.xsd simpledc20021212.xsd They are available from nist.gov in the zip file at the URL I gave earlier. I only attached the CPE schema because the element causing the internal error belongs in the CPE namespace and I didn't want to attach documents that are publicly available. As it turns out, this is an error in libxml2.. if I use xmllint, I get the same error message. I'll send them a bug report. Thanks // M Quoting Stefan Behnel <stefan_ml@behnel.de>:
Hi Martin,
a quick test (after renaming cpe-1.0.xsd to xccdf-1.1.xsd) didn't show any problem with lxml trunk and libxml2 2.6.17. Since you didn't mention any of the versions of lxml or libxml2 you are using, I assume it's just a problem with an older libxml2 version. XML-Schema is still under development in libxml2, so any newer version is likely to provide better support and bug fixes. Please upgrade and retry.
Regards, Stefan
Martin Thomas wrote:
I have attached the file to be validated and the schema that was causing a problem (there are 5 more schemas involved but I didn't think you needed them - either download them or ask me to email them) as well as a python script that I used to create the problem.
The output is as follows: ios.xml:41:ERROR:SCHEMASV:SCHEMAV_INTERNAL: Internal error: xmlSchemaIDCRegisterMatchers, Could not find an augmented IDC item for an IDC definition. ios.xml:41:ERROR:SCHEMASV:SCHEMAV_INTERNAL: Internal error: xmlSchemaValidateElem, calling xmlSchemaValidateElemDecl(). ios.xml:41:ERROR:SCHEMASV:SCHEMAV_INTERNAL: Internal error: xmlSchemaDocWalk, calling xmlSchemaValidateElem().
The line number in ios.xml corresponds to a cpe-list that is defined in the attached schema. If I remove it from ios.xml, everything else passes.
Cheers // Martin
On Mon, 2007-04-30 at 11:12 -0500, martin@martinthomas.net wrote:
Using the lxml rpm for FC6 and Python 2.4, I get an internal error when I try validating a document against a XMLschema document. The xml document that I am trying to validate and the XMLschema which I am validating against both came from NIST (contained in the 'Complete 1.1.3 Schema Bundle .zip' at http://nvd.nist.gov/scap/xccdf/xccdf.cfm).
The error message reads Internal error: xmlSchemaIDCRegisterMatchers, Could not find an augmented IDC item for an IDC definition.
I'll write this up properly tonight and send in an error log, along with all the schema documents etc unless someone tells me otherwise.
Cheers // Martin
_______________________________________________ lxml-dev mailing list lxml-dev@codespeak.net http://codespeak.net/mailman/listinfo/lxml-dev
------------------------------------------------------------------------
from lxml import etree
xsd = etree.ElementTree(file='xccdf-1.1.xsd')
doc = etree.ElementTree(file='ios.xml')
xsv = etree.XMLSchema(xsd) try: xsv.validate(doc) except Exception, e: pass
print e.error_log
------------------------------------------------------------------------
_______________________________________________ lxml-dev mailing list lxml-dev@codespeak.net http://codespeak.net/mailman/listinfo/lxml-dev
participants (1)
-
martin@martinthomas.net