Skip to main content
XMLDir

Search 309 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, blog and product.

Schemas and validity

Schema location

An attribute in an instance document pairing a namespace URI with a URL where a schema for it may be found — a hint, not an instruction.

xsi:schemaLocation takes pairs: namespace, then location, whitespace-separated. Its unnamespaced sibling, xsi:noNamespaceSchemaLocation, takes a location alone. Both live in the XMLSchema-instance namespace and both are advisory.

A validator is entirely free to ignore them, and most do — fetching a schema named by the document being validated is the same remote-fetch risk as an external entity. In practice you supply the schema yourself, which is also the only way to know which version was used.

Defined in
XSD 1.0 §2.6.3
Category
Schemas and validity
Also written
xsi:schemaLocation, xsi:noNamespaceSchemaLocation

Shown, not asserted

This claim is executed on every test run, against the same engines the tools use. If the behaviour changes, the test fails rather than this page quietly becoming wrong.

  • A schemaLocation pointing nowhere costs nothing: nothing fetches it.

    document.xml
    <x xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://example.invalid/nope.xsd">hi</x>

    What the engine returns

    Well-formed.

What catches people out

  • The paired form needs both halves. A namespace with no location, or a location with no namespace, is silently useless.
  • Do not treat a schemaLocation as provenance. Anyone can write any URL there.
  • Using the noNamespace form on a namespaced document is a common mix-up, and produces a validator that finds no declarations at all.

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.