PARSER ERROR CODES

cvc-enumeration-valid: value outside the allowed set

XSDHub · Tested 5 November 2026 · How we test guides

The simple type restricts its value space to a finite set of enumeration entries. A value can be valid for the base datatype and still be disallowed by this list. The diagnostic usually prints the accepted alternatives or identifies the enumeration constraint.

What the message literally means

The status field is restricted to READY or SENT. HOLD is ordinary text and parses correctly, but it is absent from the allowed set. Replacing it with READY makes the specimen valid. In a real order, choose the status that truthfully represents the workflow rather than copying a convenient passing value.

Three common causes to check first

  1. The producer emits a display label instead of the agreed code. A translated label such as a UI status can differ from the schema’s stable interchange value.
  2. A new code was introduced upstream while the receiver still validates an older schema release. The list loaded at runtime determines what is accepted.
  3. Case or whitespace differs from the type’s value rules. String-based enumerations can preserve distinctions that token-based types normalize before comparison.

Repair and retest

Locate every xs:enumeration entry on the effective simple type and inspect its base. Compare the outgoing value with the receiver’s code list and schema version. Repair the mapping in the exporter so it emits an authorized value with the intended meaning. Validate every workflow state that the mapping can produce, including transitional states and unknown values, rather than testing only the happy path.

When this is a namespace problem

An enumeration diagnostic is usually a value problem, because the validator already reached a restriction. If the accepted list belongs to another vocabulary version, inspect targetNamespace and any xsi:type override. A correct namespace prefix cannot make HOLD part of a list containing only READY and SENT.

Reading equivalent reports

An enumeration is not necessarily a raw string comparison: datatype value equality and whitespace rules can matter. The example deliberately uses xs:token so surrounding whitespace is normalized, while case remains significant. Do not add an unrecognized enum entry locally unless both parties agree to accept that status.

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.

Enumeration facet / cvc-enumeration-valid

Broken XML

<status>HOLD</status>
Broken complete XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="status">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="READY"/>
        <xs:enumeration value="SENT"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
</xs:schema>

Download XML · Download XSD

Open broken pair →

Corrected XML

<status>READY</status>
Corrected complete XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="status">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="READY"/>
        <xs:enumeration value="SENT"/>
      </xs:restriction>
    </xs:simpleType>
  </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-enumeration-valid: Value 'HOLD' is not facet-valid with respect to enumeration '[READY, SENT]'. It must be a value from the enumeration.
cvc-type.3.1.3: The value 'HOLD' of element 'status' is not valid.
PASS
.NET 8.0.33 · System.Xml.Schema
Validation
The 'status' element is invalid - The value 'HOLD' is invalid according to its datatype 'Token' - The Enumeration constraint failed.
PASS (no warnings)
XSDHub libxml2/WASM 0.7.2
Validation
Element 'status': [facet 'enumeration'] The value 'HOLD' is not an element of the set {'READY', 'SENT'}.
PASS
XSDHub xmlschema 4.3.1 · XSD 1.0
Validation
value must be one of ['READY', 'SENT']
PASS
SaxonEE comparison: cvc-enumeration-valid 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