[xml] Bug with nillable values.



   Hello,

   There seems to me to be a bug with nillable values in XML Schema.  Let us
consider the following excerpt:

...
<xsd:sequence>
  <xsd:element ref="student" maxOccurs="unbounded"/>
  <xsd:element name="defence" nillable="true">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="date"/>
        <xsd:element ref="time"/>
        <xsd:element name="room">
          <xsd:complexType>
            <xsd:attribute name="no" type="xsd:token" use="required"/>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="jury">
          ...
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:sequence>
...

If "defence" is "nil"led,

<student ...>
<defence xsi:nil="true"/>

   the validation fails with the message
m2pro-2006-for-xs.xml:29: element defence: Schemas validity error : Element 'defence': Missing child 
element(s). Expected is ( date ).
...
m2pro-2006-for-xs.xml fails to validate

   If we replace the definition of the "defence" element by:

<xsd:element name="defence" type="xsd:string" nillable="true"/>

everything' OK. I think that the validator of schema does not accept for a
nillable element to be a complex type. But as far as i know, that is not
specified in the official documents.

   Sincerely yours,

                                J.-M.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]