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: <4.2.0.58.J.20010313165928.035f6190@sh.w3.mag.keio.ac.jp>
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.



test.xml:

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


test.dtd:

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:31 GMT