must specify "encoding" attribute in DTD. Why?

Kent Tong

Usenet Archive
Joined
Jul 15, 2003
Messages
10
Reaction score
0
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!
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
Kent Tong said:
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
 

Kent Tong

Usenet Archive
Joined
Jul 15, 2003
Messages
10
Reaction score
0
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.

Production 77.

Thanks!
 

Soren Kuula

Usenet Archive
Joined
Dec 14, 2003
Messages
168
Reaction score
0
Kent said:
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.
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
Soren Kuula said:
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
 

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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top