XML error reference · XV023
Illegal character in document
A raw control character appears in the document, which XML 1.0 does not permit.
What your parser calls it
The same problem, reported differently by each parser. If you arrived here from one of these strings, you are in the right place.
| Parser | Message |
|---|---|
| libxml2 / xmllint | PCDATA invalid Char value 12 |
| Python ElementTree | not well-formed (invalid token) |
What causes it
The same restriction as for character references applies to literal bytes: a raw form feed, vertical tab, NUL or escape character is not valid XML 1.0 content anywhere, including inside CDATA sections. These usually arrive from legacy mainframe exports, terminal output captured with ANSI colour codes, or copying out of a PDF.
See it happen
<log>starteddone</log><log>started done</log>How to fix it
Filter the input for characters outside the allowed set before serialising. Most XML libraries do not do this for you. They will happily write a document they cannot read back.
Fix your own document
Paste your own document below. Press Sample if you want the broken example above loaded instead. Nothing you paste leaves this tab.
XML Validator
Well-formedness and schema validation. Nothing is uploaded.
Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.