cvc-complex-type.2.3

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 message: cvc-complex-type.2.3: Element ''{0}'' cannot have character [children], because the type''s content type is element-only.

Error description in schema standard: http://www.w3.org/TR/2007/WD-xmlsche...c-complex-type

Possible causes for this error:

  • Element has text content while schema definition says it must only have element content i.e. children elements.
  • In addition, double "larger than" character at the end of closing tag is considered as element data, thus triggering this error. Make sure following is not present in XML: </Name>> or </Name>&gt; (if the report contains myriad amount of data and this error is given in odd location, it might be a good idea to search for ">>" and ">&gt;")

An example

<letter>
  Dear Mr./Mrs.<Name>Neo</Name>.
</letter>

Error messageError cvc-complex-type.2.3: Element 'letter' cannot have character [children], because the type's content type is element-only.

Meaning of error: Data is given inside complexType element <letter> and not inside simpleType <Name>. ComplexType elements may only contain elements and not data.

How to fix: This issue can be fixed by removing the text content of the given element and using valid elements only as a content.

<letter>
  <Name>Neo</Name>              
</letter>