This xml should validate against this xsd1.0, but it does not

Bug #1794757 reported by Dominik Muth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Invalid
Undecided
Unassigned

Bug Description

I attached an xml and an xsd, as well as a script that validates the former against the latter.

This validation fails.

Validation succeeds with Altova XMLSpy.

System details:

C:\Users\gee3adm\Documents\tmp\xsd_error_minimal>pip install lxml
Requirement already satisfied: lxml in c:\users\gee3adm\appdata\roaming\python\python36\site-packages (4.2.4)

C:\[...]\xsd_error_minimal>pip show lxml
Name: lxml
Version: 4.2.4
Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
Home-page: http://lxml.de/
Author: lxml dev team
Author-email: <email address hidden>
License: BSD
Location: c:\users\gee3adm\appdata\roaming\python\python36\site-packages
Requires:
Required-by:

C:\[...]\xsd_error_minimal>python
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ## -- PLEASE PROVIDE THE FOLLOWING INFORMATION: --
... import sys
>>> from lxml import etree
>>>
>>> print("%-20s: %s" % ('Python', sys.version_info))
Python : sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)
>>> print("%-20s: %s" % ('lxml.etree', etree.LXML_VERSION))
lxml.etree : (4, 2, 4, 0)
>>> print("%-20s: %s" % ('libxml used', etree.LIBXML_VERSION))
libxml used : (2, 9, 5)
>>> print("%-20s: %s" % ('libxml compiled', etree.LIBXML_COMPILED_VERSION))
libxml compiled : (2, 9, 5)
>>> print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_VERSION))
libxslt used : (1, 1, 30)
>>> print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_COMPILED_VERSION))
libxslt compiled : (1, 1, 30)
>>> ## -----
...
>>> exit()

C:\[...]\xsd_error_minimal>python validate.py
ERROR: XSD validation failed
... Element 'productref': No match found for key-sequence ['p1'] of keyref 'refProduct'., line 8

Tags: xsd
Revision history for this message
Dominik Muth (dommut) wrote :
Revision history for this message
scoder (scoder) wrote :

XML schema validation is not implemented in lxml but in libxml2.

Changed in lxml:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.