Can someone advise whether XMLSchema is currently able validate xml
schemas. I am on mac 10.4.9 using lxml 1.3 beta using macs default
libxml2. In my initial attempt, I am getting the following errors (after
catching the exception in the log). I am using XMLSchema.xsd to validate
against as you can see. The error comes before my next step - which
would validate the schema I am interested in.
Here is my session:
>>> import lxml.etree
>>> from am.xmlschema import …
[View More]xmlschema_path
>>> xmlschema_doc = lxml.etree.parse(xmlschema_path)
>>> try:
... xmlschema = lxml.etree.XMLSchema(xmlschema_doc)
... except Exception, e:
... print e.error_log
...
/Users/davidpratt/Desktop/xmlschemademo/dev/am.xmlschema/src/am/xmlschema/XMLSchema.xsd:655:ERROR:SCHEMASP:SCHEMAP_REDEFINED_ELEMENT:
Element 'element': A global element declaration with the name 'element'
does already exist.
/Users/davidpratt/Desktop/xmlschemademo/dev/am.xmlschema/src/am/xmlschema/XMLSchema.xsd:864:ERROR:SCHEMASP:SCHEMAP_REDEFINED_ELEMENT:
Element 'element': A global element declaration with the name 'group'
does already exist.
>>>
Many thanks
Regards
David
[View Less]
Hi there,
We're doing some stress testing before rolling some code based on lxml
into production and we've been able to reproduce a crash when reusing
the same XSLT object repeatedly. I will dump some information here in
the hope that anyone can shed a light before I go trying to compile
debug versions of everything and the kitchen sink.
The test is composed of a rather small XML file, and a rather big and
complex XSLT with several <xsl:import /> <xsl:include /> etc.
We fire up …
[View More]10 threads. Each one has it's own parsed XML file and XSLT,
they are not being shared across threads.
Each thread then goes on a loop, applying the XSLT to the XML file and
serializing the result to a string.
With a less than 1000 iterations the crash almost never happens. At
about 50000 iterations, the crash is pretty much guaranteed to happen.
There doesn't seem to be any memory leak or anything, memory usage is
quite stable.
This is using the 1.2.1 release.
This is a static build on Win32, against:
libxml2-2.6.26.win32
libxslt-1.1.17.win32
zlib-1.2.3.win32
iconv-1.9.2.win32
The crash information says its an 'access violation' and it happens
somewhere in etree.pyd, when I bring up the debugger only etree.pyd
and python24.dll are on the stack (which I guess is pretty useless
information). I am hoping to make a debug build to get more
information.
I can try running the same code on Linux and seeing if it happens
there too, or I can try a debug build, or hopefully someone will come
out and say I'm doing something wrong here or that the version of
libxml2 I'm using has known issues.
I can also provide the test code + data upon request.
--
Sidnei da Silva
Enfold Systems http://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
[View Less]