469,282 Members | 1,869 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

must specify "encoding" attribute in DTD. Why?

Hi,

Why is it required to specify the encoding pseudo attribute in
a DTD? For example, it is OK to have:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!ELEMENT ...>

But it causes Xerces to report an error of "more pseudo attributes
expected" if it is:

<?xml version="1.0"?>
<!ELEMENT ...>

Where is it mentioned in the W3C XML recommendation? Thanks
for any pointer!
Jul 20 '05 #1
4 6043
In article <c9**************************@posting.google.com >,
Kent Tong <ke**@cpttm.org.mo> wrote:
Why is it required to specify the encoding pseudo attribute in
a DTD?
I'm not sure; maybe it was thought that there was no point to it if
it didn't specify the encoding, but it might be useful just for
the version number.
Where is it mentioned in the W3C XML recommendation?


Production 77.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #2
ri*****@cogsci.ed.ac.uk (Richard Tobin) wrote in message news:<c1***********@pc-news.cogsci.ed.ac.uk>...
In article <c9**************************@posting.google.com >,
Kent Tong <ke**@cpttm.org.mo> wrote:
Why is it required to specify the encoding pseudo attribute in
a DTD?


I'm not sure; maybe it was thought that there was no point to it if
it didn't specify the encoding, but it might be useful just for
the version number.
Where is it mentioned in the W3C XML recommendation?


Production 77.


Thanks!
Jul 20 '05 #3
Kent Tong wrote:
Hi,

Why is it required to specify the encoding pseudo attribute in
a DTD? For example, it is OK to have:


You should always specify encoding. Otherwise, exchanging information
further than between your couple of computers :) eventually gets
somebody's headache.
We see all the time here in Denmark that some people still think ASCII
covers everyting (it's insufficient for anywhere but America), and, even
worse, the implicit assumption that everything is ISO8859-1.

--
Fjern de 4 bogstaver i min mailadresse som er indsat for at hindre s...
Remove the 4 letter word meaning "junk mail" in my mail address.

Jul 20 '05 #4
In article <FD*********************@news000.worldonline.dk> ,
Soren Kuula <do**********@bitplanet.net> wrote:
We see all the time here in Denmark that some people still think ASCII
covers everyting (it's insufficient for anywhere but America),


That's an exaggeration: ASCII is quite sufficient for most documents
in English. On the rare occasions that I might want to put, say, a
pound (sterling) symbol in an XML document, I can use a character
reference.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gustaf Liljegren | last post: by
4 posts views Thread by peter | last post: by
4 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
1 post views Thread by relrozen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.