Re: [lxml-dev] bug - lxml crash after broken schema instantiation
On Thu, 13 Apr 2006, Stefan Behnel wrote:
Hi Tom,
thanks for reporting this, I can reproduce it, even with a test case as simple as
from lxml.etree import XMLSchema, XML, ElementTree et = ElementTree(XML("<test/>")) XMLSchema(et)
So it is not related to RelaxNG or your schema. This problem does not appear if the parsed document is within the XML-Schema namespace (we have a test case for that), but only if the document is not XML-Schema at all.
This fact (and the Valgrind trace that shows xmlSchemaParse) makes me believe that this is a bug in libxml2, not lxml. Note that XML-Schema support is marked as "incomplete" even in the latest libxml2 versions.
I see you've submitted a libxml2 bug report too (#338303), which has already been marked as fixed. Remarkable stuff, this open source. :-)
I applied a work-around that checks if the root node of the document passed into XMLSchema is within the XMLSchema namespace and otherwise rejects the document without calling libxml2 at all.
That's great, thanks. Tom -- Brain: Pinky, are you pondering what I'm pondering? Pinky: I think so, Brain, but if we give peas a chance, won't the lima beans feel left out? -- Pinky and the Brain, 'All You Need is Narf'
participants (1)
-
Tom Lynn