PARSER ERROR CODES

cvc-complex-type.2.4.b: the element has incomplete content

XSDHub · Tested 5 November 2026 · How we test guides

The parent closes before its content model reaches a permitted stopping point. Xerces can accept every child seen so far and still reject the document at the closing tag. The missing content belongs inside that parent.

What the message literally means

“The content of element is not complete” means at least one required particle remains unsatisfied. Here quantity is accepted, but price has its default minOccurs of one. The corrected order supplies a decimal price before closing order. A self-closing required child might satisfy occurrence counting but then fail its own datatype check.

Three common causes to check first

  1. A mandatory child was omitted during export. Empty database columns are often skipped by serializers even though the schema requires the corresponding element.
  2. A repeating group has fewer occurrences than its minimum. Check the surrounding sequence or choice as well as the minOccurs written on the immediate child.
  3. A choice branch was started but not completed. Selecting a branch can introduce additional required descendants before the enclosing element may end.

Repair and retest

Read the expected child names at the end of the diagnostic and locate their declarations beneath the failing parent. Count actual occurrences and account for required groups. Restore the missing business value in its declared position; if absence is legitimate, agree an appropriate schema revision with the schema owner. Validate the repaired subtree and then the complete XML so that sibling and identity rules also run.

When this is a namespace problem

An apparently present child can be a different expanded name because of xmlns="" or an unexpected inherited default namespace. That usually produces an earlier unexpected-child error followed by incompleteness. Start with the first diagnostic: appending a duplicate child in the correct namespace may hide a producer bug rather than repair it.

System.Xml.Schema: “The element … has incomplete content”

The .NET and libxml2 rows below show the closing-parent diagnosis for this exact pair. A successful XML syntax check only proves the tags balance. It cannot establish that the parent contains every required schema child, and it cannot substitute for XML plus XSD validation.

Complete tested XML and XSD pairs

Open either variant in the workbench, then choose Validate XML. Loading an example does not run validation or send documents; server checks require the existing permission checkbox.

These transcripts were captured on 5 November 2026 from the exact files shown below. Download all measured results and SHA-256 hashes.

Incomplete content / cvc-complex-type.2.4.b

Broken XML

<order>
  <quantity>3</quantity>
</order>
Broken complete XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="order">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="quantity" type="xs:positiveInteger"/>
        <xs:element name="price" type="xs:decimal"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Download XML · Download XSD

Open broken pair →

Corrected XML

<order>
  <quantity>3</quantity>
  <price>12.50</price>
</order>
Corrected complete XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="order">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="quantity" type="xs:positiveInteger"/>
        <xs:element name="price" type="xs:decimal"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Download XML · Download XSD

Open corrected pair →

Same specimen across engines

EngineBroken: actual reportCorrected
Apache Xerces-J 2.12.2
Validation
cvc-complex-type.2.4.b: The content of element 'order' is not complete. One of '{price}' is expected.
PASS
.NET 8.0.33 · System.Xml.Schema
Validation
The element 'order' has incomplete content. List of possible elements expected: 'price'.
PASS (no warnings)
XSDHub libxml2/WASM 0.7.2
Validation
Element 'order': Missing child element(s). Expected is ( price ).
PASS
XSDHub xmlschema 4.3.1 · XSD 1.0
Validation
The content of element 'order' is not complete. Tag 'price' expected.
PASS
SaxonEE comparison: cvc-complex-type.2.4.b describes the corresponding XSD constraint. No Saxon-EE run or wording is claimed; an EE licence is unavailable in this test environment. Saxon-HE does not provide XSD validation.Not run

Saxon comparison and test scope

Saxonica documents XSD processing as an Enterprise Edition feature. The Saxon rows map the named constraint, rather than presenting an invented message. The four measured rows are Xerces, .NET, the shipped workbench engine and XSDHub’s second engine.

The corrected results apply to these self-contained XSD 1.0 specimens. They do not establish business-rule acceptance for a different document or schema version.

Continue the diagnosis

All parser error codes · XML and XSD validator

Primary references