cvc-elt.3.1

Notice! This page describes the nature of the error using a hypothetical example and not the erroneous data of the input test file. You should however be able to apply this information to your error case.

General description of the error:

The format of the error messageError cvc-elt.3.1: Attribute '{0}' must not appear on element '{1}', because the {nillable} property of '{1}' is false.

Error description in schema standard: http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/#cvc-elt

Possible causes for this error:

  • Nillable attribute specifies whether an explicit null value can be assigned to the element. Default value is false so value can not be se to 'null' in the validated file. Error occurs when an element is set to null even though schema doesn't define nillable as true.

An example

<order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <product>XML Schema Tutorial Book</product>
  <price
xsi:nil="true"></price>
</order>

Error message: Error cvc-elt.3.1: Attribute 'http://www.w3.org/2001/XMLSchema-instance,nil' must not appear on element 'price', because the {nillable} property of 'price' is false.

How to fix: The error means that 'xsi:nil="true"' is given for 'price' element even though schema doesn't allow null value to be set for it. The error can be corrected by removing the 'xsi:nil' from the element.

<order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <product>XML Schema Tutorial Book</product>
  <price></price>
</order>