GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Validator
  • E-invoice
  • Schemas
  • XML formatter Pretty-print or minify XML
  • XML viewer A document as a tree you can search
  • XML to PDF Any XML as a readable PDF
  • XML to JSON Arrays where the XSD allows
  • XPath tester XPath 3.1, matches with their lines
  • JSON to XML @keys as attributes, arrays repeated
  • XSLT transformer XSLT 3.0 with SaxonJS
  • XML to CSV Invoice lines and records as rows
  • XML diff Compare two documents as trees
  • XSD generator An XML Schema from sample XML
  • XML from XSD A sample document from a schema

This view

  • Original page
  • New address

GeezerVison is showing xmlvalid.com — “Document is empty”: XML error explained | xmlvalid

Document is empty

There is no element in the document at all

The message, as the validator reports it
Document is empty

Why it happens

  • An empty file, or one with only whitespace, comments or an XML declaration.
  • An export or download that failed and left a zero-byte file behind.

How to fix it

Check the file size and where the file came from. An XML document needs at least one element, its root.

Example

Reports the error
(an empty file)
Fixed
<note/>

Check your document

The validator lists every problem with its line and column, and links the ones explained here. It runs in your browser; nothing is uploaded

Open the validator

In Java and .NET

  • Premature end of file (Java)
  • Root element is missing (.NET)

More Well-formedness errors

  • Opening and ending tag mismatch
  • Premature end of data in tag
  • Extra content at the end of the document
  • Start tag expected, '<' not found
  • Entity not defined
  • xmlParseEntityRef: no name
All error messages →
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.