must specify "encoding" attribute in DTD. Why?

K

Kent Tong

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!
 
R

Richard Tobin

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
 
K

Kent Tong

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!
 
S

Soren Kuula

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.
 
R

Richard Tobin

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

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top