[lxml-dev] RelaxNG validation result depending of python version

Hi, I' have a issue with RelaxNG validation depending of version of python used. xmllint => No errors Python 2.6.4 => No Errors Python 2.4.6 => Errors as the version of libraries are the same, i don't know how to find the weakness in my python2.4 installation. Do you have any clue to help me understanding this issue ? Nicolas # xmllint --version xmllint: using libxml version 20706 For both python2.4 and python2.6
etree.LXML_VERSION
(2, 2, 4, 0)
etree.LIBXML_VERSION (2, 7, 6) etree.LIBXML_COMPILED_VERSION (2, 7, 6) etree.LIBXSLT_VERSION (1, 1, 20) etree.LIBXSLT_COMPILED_VERSION (1, 1, 20)
PS: I try to validate ODF content with oasis rng http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-schema-v1.1.rng -- Nicolas Delaby Nexedi: Consulting and Development of Libre / Open Source Software http://www.nexedi.com/

Nicolas Delaby, 11.12.2009 19:45:
I' have a issue with RelaxNG validation depending of version of python used.
xmllint => No errors Python 2.6.4 => No Errors Python 2.4.6 => Errors
What kind of errors?
as the version of libraries are the same, i don't know how to find the weakness in my python2.4 installation.
Do you have any clue to help me understanding this issue ?
Nicolas
# xmllint --version xmllint: using libxml version 20706
For both python2.4 and python2.6
etree.LXML_VERSION (2, 2, 4, 0) etree.LIBXML_VERSION (2, 7, 6) etree.LIBXML_COMPILED_VERSION (2, 7, 6) etree.LIBXSLT_VERSION (1, 1, 20) etree.LIBXSLT_COMPILED_VERSION (1, 1, 20)
Do you have the libxml2 Python bindings installed in any of the Python versions? Is 2.7.6 the only libxml2 version that is installed on your system? Stefan

Stefan Behnel a écrit :
Nicolas Delaby, 11.12.2009 19:45:
I' have a issue with RelaxNG validation depending of version of python used.
xmllint => No errors Python 2.6.4 => No Errors Python 2.4.6 => Errors
What kind of errors?
It said that xml document is not compliant against Rng. <string>:2:0:ERROR:VALID:DTD_UNKNOWN_ID: IDREF attribute control references an unknown ID "control1"
Do you have the libxml2 Python bindings installed in any of the Python versions?
I tried with and without, for both python version. The result is still the same.
Is 2.7.6 the only libxml2 version that is installed on your system?
Yes it is. Nicolas -- Nicolas Delaby Nexedi: Consulting and Development of Libre / Open Source Software http://www.nexedi.com/

Hi, I provide more materials, maybe it will help. XML source: http://pastebin.com/m7c9849d RNG: http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-schema-v1.1.rng sample which show that error occurs only with lxml but libxml2: http://pastebin.com/m1cc51ed9 more information about python-libxml2 package of my system rpm -qi python2.4-libxml2 Name : python2.4-libxml2 Relocations: (not relocatable) Version : 2.6.29 Vendor: Mandriva If you need more details do not hesitate to ask. Thanks for having a look, Nicolas -- Nicolas Delaby Nexedi: Consulting and Development of Libre / Open Source Software http://www.nexedi.com/

Nicolas Delaby, 16.12.2009 17:44:
more information about python-libxml2 package of my system rpm -qi python2.4-libxml2 Name : python2.4-libxml2 Relocations: (not relocatable) Version : 2.6.29 Vendor: Mandriva
Hmm, didn't you say that 2.7.6 was the only libxml2 version installed on your system? Looks like this uses 2.6.29! Stefan

Stefan Behnel a écrit :
Nicolas Delaby, 16.12.2009 17:44:
more information about python-libxml2 package of my system rpm -qi python2.4-libxml2 Name : python2.4-libxml2 Relocations: (not relocatable) Version : 2.6.29 Vendor: Mandriva
Hmm, didn't you say that 2.7.6 was the only libxml2 version installed on your system? Looks like this uses 2.6.29!
I'm not expert, but as far I can understand, python2.4 bindings was compiled against libxml2 2.6.29 but it doesn't mean libxml2 2.6.29 is installed. I'm almost sure that only libxml2-2.7.6 is installed. # ldconfig -v | grep libxml2 libxml2.so.2 -> libxml2.so.2.7.6 I am wrong ? Anyway python2.4-libxml2 (2.6.29) seems validate the document against RNG like xmllint (2.7.6) does (see http://pastebin.com/m1cc51ed9). Nicolas -- Nicolas Delaby Nexedi: Consulting and Development of Libre / Open Source Software http://www.nexedi.com/

Nicolas Delaby, 16.12.2009 17:44:
Hi, I provide more materials, maybe it will help.
XML source: http://pastebin.com/m7c9849d RNG: http://docs.oasis-open.org/office/v1.1/OS/OpenDocument-schema-v1.1.rng
sample which show that error occurs only with lxml but libxml2: http://pastebin.com/m1cc51ed9
more information about python-libxml2 package of my system rpm -qi python2.4-libxml2 Name : python2.4-libxml2 Relocations: (not relocatable) Version : 2.6.29 Vendor: Mandriva
Ok, I tried and I can't reproduce this. $ python2.4 -c 'import lxml.etree as et; print et.RelaxNG(file="OpenDocument-schema-v1.1.rng").validate(et.parse("m7c9849d.xml"))' True $ python2.4 -c 'import lxml.etree as et; print et.RelaxNG(et.parse("OpenDocument-schema-v1.1.rng")).validate(et.parse("m7c9849d.xml"))' True For the above I tried python 2.4.5/2.6.4 and libxml2 2.6.32/2.7.6 with lxml trunk (with no RelaxNG changes since 2.2 that I'm aware of). I also tried the validation with the libxml2 Python bindings in Python 2.4, which works nicely as well. Stefan
participants (2)
-
Nicolas Delaby
-
Stefan Behnel