xml - Is xmllint handling a nillable compexType correctly? -


we have xsds , sample xmls created under .net (and presumably passed validation), fail validated under xmllint. we're trying determine if 1 side or other 'incorrect' or if ambiguous in spec. i've tried searching here , on google, can't find describes same problem. instead of posting original xsds & xml, i've created smaller test reproduces problem.

the xsd is:

<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"             elementformdefault="qualified"             attributeformdefault="unqualified">   <xs:complextype name="a">     <xs:sequence>       <xs:element name="b" nillable="true" type="b" />     </xs:sequence>   </xs:complextype>   <xs:element name="a" nillable="true" type="a" />   <xs:complextype name="b">     <xs:sequence>       <xs:element name="date"                    minoccurs="1"                    maxoccurs="50"                    nillable="true"                    type="xs:date" />     </xs:sequence>   </xs:complextype>   <xs:element name="b" nillable="true" type="b" /> </xs:schema> 

the xml is:

<?xml version="1.0" encoding="utf-8"?> <a xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:nonamespaceschemalocation="test.xsd">   <b xsi:nil="true"></b> </a> 

the xmllint command run is:

xmllint --schema test.xsd --noout test.xml 

and output of xmllint is:

test.xml:3: element b: schemas validity error : element 'b': missing child element(s). expected ( date ). test.xml fails validate 

i'm pretty beginner xsd/xml 'developer', feel free rip away. :)

the xml instance show schema-valid against xsd schema show. says xerces j, says msv, says saxon, , (for it's worth) i.

the xsd support in xmllint known incomplete; looks 1 of incomplete areas.

(nice job cutting problem down small test case, way. work!)


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -