Followup to recent libxml2 update: http://rhn.redhat.com/errata/RHBA-2013-0591.html and likely a result of the following bugfix: https://bugzilla.redhat.com/show_bug.cgi?id=915350 Something in the update seems to trigger a new bug related to schema validation: https://bugzilla.gnome.org/show_bug.cgi?id=670865 and it's fix: https://git.gnome.org/browse/libxml2/commit/?id=c70d185a2a3d09b0762560d4f93205da5d43396c Certainly after updating to this version, I saw errors very similar to the ones reported above. The problems went away when I downgraded again. Please can someone look at issuing another update for this?
Just for clarity (this info is on the gnome bug) Test case: Create a schema with the following content: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="rules"> <xs:complexType> <xs:sequence> <xs:element name="rule" minOccurs="0" maxOccurs="unbounded"/> <xs:sequence minOccurs="0" maxOccurs="1"> <xs:element name="specialRule" minOccurs="1" maxOccurs="1"/> <xs:element name="rule" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Validate it with: xmllint --schema foo.xsd It will print out usage info, but ignore that, just look at the errors above the usage which will state: $ xmllint --schema foo.xsd foo.xsd:4: element complexType: Schemas parser error : local complex type: The content model is not determinist. WXS schema foo.xsd failed to compile However further testing would suggest it's not actually a regression with the above commit *in this particular test case*, but does fail on others!! I will attempt to get a valid test case to you that highlights the before/after problems better...
OK, the following schema appears to show a difference for me before and after the update: <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foobar.org/wibble" elementFormDefault="qualified"> <xs:element name="foo"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="bar" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="wibble" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> <xs:attribute name="version" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:schema> Before: $ xmllint --schema test.xsd 2>&1 | head -n 4 Usage : xmllint [options] XMLfiles ... Parse the XML files and output the result of the parsing --version : display the version of the XML library used --debug : dump a debug tree of the in-memory document After: $ xmllint --schema test.xsd 2>&1 | head -n 4 test.xsd:6: element complexType: Schemas parser error : local complex type: The content model is not determinist. WXS schema test.xsd failed to compile Usage : xmllint [options] XMLfiles ... Parse the XML files and output the result of the parsing
I suspect that this is the same as Bug #922450.
This is indeed the same bug, applying the 2 patches indicated in Bug #922450 fixes the problem: thinkpad:~/XML -> ./xmllint --schema 924785.xsd --noout foo.xml foo.xml validates thinkpad:~/XML -> cat 924785.xsd <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foobar.org/wibble" elementFormDefault="qualified"> <xs:element name="foo"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="bar" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="wibble" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> <xs:attribute name="version" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:schema> thinkpad:~/XML -> cat foo.xml <foo xmlns="http://foobar.org/wibble" version="1"/> thinkpad:~/XML -> Daniel *** This bug has been marked as a duplicate of bug 922450 ***
What is going on with this one? I tried to find more information of Bug #922450, but it told me I am not authorized to access it.
An update fixing it will be pushed soon. Daniel