W3C home > Mailing lists > Public > xml-editor@w3.org > January to March 2001

Difference between XML declaration and text declaration

From: Martin Duerst <duerst@w3.org>
Date: Tue, 13 Mar 2001 17:10:46 +0900
Message-Id: <>
To: xml-editor@w3.org
Cc: ht@cogsci.ed.ac.uk (Henry S. Thompson)
Dear XML specialists,

I have recently become aware of a difference between
the XML declaration, where 'encoding' is optional, and the
text declaration, where 'encoding' is mandatory.

It has also come to my attention that some parsers do not
reject XML documents even when they replace external
entities with text declarations without 'encoding'.

I have two requests:

1) Can you confirm that my understanding is correct?

2) Can you tell me whether there are already tests for this
    case? If not, can you either forward the test below
    to the appropriate person, or can you tell me where to
    send it?

Many thanks in advance,     Martin.


<?xml version='1.0' ?>
<!DOCTYPE resume SYSTEM "test.dtd" >
<em>Resume</em> means summary or curriculum vitae.


<?xml version='1.0' ?>
<!-- wrong: no encoding declaration in the text declaration on the previous 
line -->
<!ELEMENT resume (#PCDATA | em)* >
Received on Tuesday, 13 March 2001 03:11:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:37:40 UTC