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.

Names and namespaces

Expanded name

The pair of namespace URI and local name that a QName resolves to — what processors actually compare when they match a name.

Two elements are the same element type when their expanded names match. The prefix is not part of the comparison, which is why a document can rename every prefix it uses without changing meaning, and why a diff that compares tag text reports changes that are not there.

Some tooling writes expanded names in Clark notation — {http://www.w3.org/2005/Atom}entry — precisely because it is unambiguous where a prefixed name is not.

Defined in
Namespaces in XML 1.0 §2.1
Category
Names and namespaces
Also written
universal name, {uri}local

Shown, not asserted

All 2 claims are 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.

  • The namespace URI is the half that carries meaning.

    document.xml
    <r xmlns:a="urn:a"><a:c/></r>
    expression
    namespace-uri(//*[local-name()='c'])

    What the engine returns

    urn:a
  • The prefix is not: change it and the expanded name is unchanged.

    document.xml
    <r xmlns:zzz="urn:a"><zzz:c/></r>
    expression
    namespace-uri(//*[local-name()='c'])

    What the engine returns

    urn:a

What catches people out

  • A structural diff must compare expanded names. Comparing tag text reports a difference every time a prefix changes.
  • Clark notation is a convention of tooling, not of XML. You cannot write {uri}local in a document.
  • Attributes have expanded names too, and an unprefixed attribute's namespace URI is empty rather than the element's.

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.