The validator cannot associate the document element with a global element declaration in the supplied schema set. It has not yet reached the question of whether that element’s children are correct. Check the root and the selected schema before editing descendants.
What the message literally means
In this pair the XSD declares stock in urn:example:stock. The failing XML has an unqualified stock, which belongs to no namespace. Adding the intended default namespace changes stock and its unprefixed sku child into the expanded names expected by the qualified schema.
Three common causes to check first
The root namespace URI differs from targetNamespace, or the XML omits the required namespace entirely. Namespace names are exact identifiers, including case and trailing punctuation.
The wrong schema entry point was selected. A file containing only reusable types may have no global declaration for the application’s document root.
The root name or vocabulary version changed. A similar-looking declaration from a different release does not establish compatibility with the incoming document.
Repair and retest
Write down the root as {namespace URI}local-name and compare it with a top-level xs:element in the loaded entry schema. Confirm that the application explicitly supplies that schema. For multi-file contracts, load the full project and select its actual root XSD. Recheck qualification of descendants after correcting the root, since elementFormDefault can expose additional mismatches.
When this is a namespace problem
This specimen is a namespace error: the only XML change adds xmlns="urn:example:stock". Declaring xmlns:xsi or adding a schemaLocation hint alone would not put stock in that namespace. Conversely, changing only the prefix while retaining the correct binding leaves the expanded name unchanged.
System.Xml.Schema: unknown root warnings versus errors
With ReportValidationWarnings enabled, the tested .NET reader returned warnings for stock and sku, with no error event. Treat that as missing schema coverage, not proof of validity. Xerces, libxml2 and XSDHub’s second engine reject this same root. The strict-wildcard guide covers a different .NET message: “is not declared”.
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-elt.1.a: Cannot find the declaration of element 'stock'.
PASS
.NET 8.0.33 · System.Xml.Schema Validation
No error event; warnings:
Could not find schema information for the element 'stock'.
Could not find schema information for the element 'sku'.
PASS (no warnings)
XSDHub libxml2/WASM 0.7.2 Validation
Element 'stock': No matching global declaration available for the validation root.
PASS
XSDHub xmlschema 4.3.1 · XSD 1.0 Validation
'stock' is not an element of the schema
PASS
Saxon
EE comparison: cvc-elt.1.a 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.