Empty documents always DTD-valid?

S

Soren Kuula

Hi,

Is an empty XML document valid by any valid DTD?

-- I guess it is .. after all, declarations apply just to elements in
the document, and hey, if there are none, there can be nothing wrong...

Soren
 
D

David Dorward

Soren said:
Is an empty XML document valid by any valid DTD?

I document can't be valid without a Doctype Declaration, and I'm pretty sure
it can't be valid without a root element.
 
R

Richard Tobin

Soren Kuula said:
Is an empty XML document valid by any valid DTD?

An empty document isn't even well-formed, let alone valid. An XML
document must contain exactly one top-level element.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,000
Messages
2,570,252
Members
46,848
Latest member
CristineKo

Latest Threads

Top