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.
Where it bites
A definition on its own is trivia. These are the pages where this term decides whether a document works.
- Parse errorsUnsupported XML versionThe message a version nothing implements produces.
- Parse errorsMalformed declaration expecting versionWhat a declaration with no version at all reports.
Related terms
- XML declarationThe optional <?xml version="1.0" encoding="UTF-8"?> at the very start of a document, declaring its version and character encoding.
- Invalid XML characterA code point XML forbids in a document at all — most of the C0 control range — which cannot be included literally or as an escape.
- PrologEverything in a document before the root element's start tag: the XML declaration, any comments or processing instructions, and the document type declaration.
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.