GNOME Bugzilla – Bug 136678
wrong validating schema (xsd)
Last modified: 2009-08-15 18:40:50 UTC
Attribute use="required" doesn't work. Demonstration: bug.xsd ------- <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="bug"> <xsd:complexType> <xsd:sequence> <xsd:element ref="item" minOccurs="1" maxOccurs="unbounded"> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="item"> <xsd:complexType> <xsd:attribute name="id" type="xsd:integer" use="required" /> </xsd:complexType> </xsd:element> </xsd:schema> bug.xml ------- <?xml version="1.0"?> <bug> <item id="1" /> <item /> </bug> test ---- xmllint --schema bug.xsd bug.xml
Kasimier Buchcik provided a fix for this, which I just commited to CVS: paphio:~/XML -> xmllint --noout --schema bug.xsd bug.xml bug.xml:4: element item: Schemas validity error : required attribute id on item is missing bug.xml:4: element item: Schemas validity error : required attribute id on item is missing bug.xml:4: element item: Schemas validity error : required attribute id on item is missing bug.xml fails to validate paphio:~/XML -> I don't know why the error is reported 3 times, but except for that small trouble this seems fine :-) Daniel
This should be closed by release 2.6.9, thanks, Daniel