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.

Encoding and characters

XML 1.1

A revision of XML that widens the legal name characters and permits most control characters as escapes — almost never used, and best avoided.

XML 1.1 exists to solve two narrow problems: names using characters Unicode added after 1998, and documents from mainframe systems carrying control characters. It also changed line-ending normalization to cover NEL, which is the mainframe half of the same story.

The practical position is that consumer support is patchy and the benefit is negligible. libxml2 — and therefore this site — accepts version="1.1", but plenty of tooling does not, and a document declaring it will be rejected somewhere you did not expect.

Defined in
XML 1.1
Category
Encoding and characters
Also written
version="1.1"

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.

  • Our parser accepts a 1.1 declaration.

    document.xml
    <?xml version="1.1"?>
    <x>hi</x>

    What the engine returns

    Well-formed.
  • A version that does not exist is a different matter.

    document.xml
    <?xml version="2.0"?>
    <x>hi</x>

    What the engine returns

    Unsupported version '2.0' (line 1)

What catches people out

  • There is no XML 2.0. A declaration naming one is a typo or a misunderstanding, and it is fatal.
  • Accepting 1.1 is a parser's choice. Declaring it makes your document less portable for a benefit you almost certainly do not need.
  • The line-ending rules differ between 1.0 and 1.1, so the same bytes can produce different text content under each.

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.