An xs:ID value identifies one item within a document; an xs:IDREF refers to such an identifier. Xerces uses cvc-id.1 for a reference with no matching ID and cvc-id.2 when the same ID occurs more than once. These checks depend on the document’s identity relationships.
What the message literally means
The reference specimen declares item A1 but links to A2, which does not exist. Pointing the link to A1 repairs the binding. The duplicate specimen assigns A1 to two items; assigning A2 to the second item restores uniqueness. Changing an ID in production also requires updating every reference intended to point to that item.
Three common causes to check first
The referenced item was filtered out, moved to another document or renamed without updating its links. IDREF resolution concerns the current document, not a remote business database.
Two source records reuse one generated ID. Merging XML fragments can introduce collisions even when each original fragment was internally unique.
The schema does not type the relevant fields as xs:ID and xs:IDREF. An ordinary string attribute named id does not automatically acquire schema identity semantics.
Repair and retest
Collect all typed IDs and references from the complete document, then check uniqueness and missing targets separately. Follow the source record behind each collision before regenerating identifiers. Validate after all referenced records are present; forward references can be legal, so a reference appearing before its target is not itself proof of failure.
When this is a namespace problem
The ID values in these specimens are identifiers, not namespace-qualified element names. Changing xmlns does not create a missing A2 or make duplicate A1 values unique. Namespaces matter when they prevent an attribute or element from receiving the intended ID datatype; inspect the declaration and qualification before assuming an identity check actually ran.
Reading equivalent reports
The measured libxml2/WASM engine returns success for the missing-target specimen, while Xerces, .NET and XSDHub’s server engine reject it. The IDREF buttons therefore select the existing second engine and reveal its unchecked upload-permission control. Loading the pair sends nothing; grant permission and choose Validate XML to run it. Local duplicate-ID checking does fail as shown.
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.
cvc-id.1: There is no ID/IDREF binding for IDREF 'A2'.
PASS
.NET 8.0.33 · System.Xml.Schema Validation
Reference to undeclared ID is 'A2'.
PASS (no warnings)
XSDHub libxml2/WASM 0.7.2 Validation
PASS: no validation diagnostic.
PASS
XSDHub xmlschema 4.3.1 · XSD 1.0 Validation
IDREF 'A2' not found in XML document
PASS
Saxon
EE comparison: cvc-id.1 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.
cvc-id.2: There are multiple occurrences of ID value 'A1'.
cvc-attribute.3: The value 'A1' of attribute 'id' on element 'item' is not valid with respect to its type, 'ID'.
PASS
.NET 8.0.33 · System.Xml.Schema Validation
'A1' is already used as an ID.
PASS (no warnings)
XSDHub libxml2/WASM 0.7.2 Validation
Element 'item', attribute 'id': 'A1' is not a valid value of the atomic type 'xs:ID'.
PASS
XSDHub xmlschema 4.3.1 · XSD 1.0 Validation
attribute id='A1': duplicated xs:ID value 'A1'
PASS
Saxon
EE comparison: cvc-id.2 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.
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.