# src-resolve: the schema reference cannot be resolved

src-resolve is a schema-compilation diagnostic. The XSD names a component such as a type, element or group that the validator cannot resolve. Instance data cannot repair a missing definition inside the schema set.

## Literal meaning

The amount element refers to MoneyTypo while the same schema defines Money. The complete corrected pair leaves the XML value 12.50 unchanged and changes only the type reference in the XSD. This separates a schema symbol error from an invalid decimal amount.

## Three common causes

1. A QName reference is misspelled or points to the wrong component kind. A named element is not interchangeable with a named simple type merely because their local names match.
2. The reference prefix resolves to the wrong namespace, or a needed import is absent. QName-valued attributes must resolve to the namespace containing the component.
3. A dependency was not loaded or the wrong schema entry file was selected. An include or import chain can be syntactically correct while its required document is unavailable.

## Repair

Compile the XSD first and identify the unresolved QName in the first src-resolve diagnostic. Find a declaration of the correct kind and compare namespace URI plus local name. For the same target namespace, inspect includes; for another target namespace, inspect imports and their namespace attributes. Load dependencies as a complete local project rather than relying on remote retrieval. Only then validate the instance XML.

## Namespace checks

This particular typo is not a namespace mismatch: both Money and its corrected reference are in the schema’s no-namespace component space. In namespaced schemas, bind a prefix to targetNamespace and use it consistently in type or ref. A prefix declaration supplies a QName binding but does not import that namespace’s component definitions.

The workbench’s corrected button loads a different XSD as well as the XML. Comparing only the visible amount would miss the actual repair. Avoid creating an empty placeholder type to satisfy lookup, since it can accidentally weaken validation while leaving the intended money constraints unloaded.

## Unknown schema type / src-resolve — Broken

```xml
<amount>12.50</amount>
```

```xml
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="amount" type="MoneyTypo"/>
  <xs:simpleType name="Money">
    <xs:restriction base="xs:decimal"/>
  </xs:simpleType>
</xs:schema>
```

[Open broken pair](https://xsdhub.com/?example=parser-src-resolve&variant=bad#workbench)

## Unknown schema type / src-resolve — Corrected

```xml
<amount>12.50</amount>
```

```xml
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="amount" type="Money"/>
  <xs:simpleType name="Money">
    <xs:restriction base="xs:decimal"/>
  </xs:simpleType>
</xs:schema>
```

[Open corrected pair](https://xsdhub.com/?example=parser-src-resolve&variant=good#workbench)

### Apache Xerces-J 2.12.2

```text
src-resolve: Cannot resolve the name 'MoneyTypo' to a(n) 'type definition' component.
```

Corrected: PASS.

### .NET 8.0.33 · System.Xml.Schema

```text
Type 'MoneyTypo' is not declared.
```

Corrected: PASS.

### XSDHub libxml2/WASM 0.7.2

```text
element decl. 'amount', attribute 'type': The QName value 'MoneyTypo' does not resolve to a(n) type definition.
```

Corrected: PASS.

### XSDHub xmlschema 4.3.1 · XSD 1.0

```text
unknown type 'MoneyTypo':

Schema component:

  <xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="amount" type="MoneyTypo" />

Path: /xs:schema/xs:element

Schema URL: schema.xsd

```

Corrected: PASS.

Saxon EE was not available; no measured Saxon wording is claimed.

[All parser codes](https://xsdhub.com/learn#parser-error-codes)
[Download engine evidence](https://xsdhub.com/parser-error-examples/engine-evidence.json)
