473,410 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

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 6185
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gustaf Liljegren | last post by:
I'm using xml.sax.parseString to read an XML file. The XML file contains a few words in Russian, and is encoded in UTF-8 using C#. In the example below, MyParser() is my SAX ContentHandler class....
3
by: Mike Kennedy | last post by:
I have an XML Snippet <?xml version="1.0" encoding="UTF-8"?> and when I convert the entire xml file to a DOM and then generate a new file from the DOM, results in <?xml version="1.0"?>. Any...
4
by: peter | last post by:
When I transform a dataset to a xml file by applying a xslt file, why by default, a "encoding="utf-8" ?" is added to the output file?How to get rid of it? Thanks
2
by: Amil Hanish | last post by:
I am trying to use XmlTextWriter. I write the xml data fine, but the file is missing the first line that shows the version and encoding: <?xml version="1.0" encoding="utf-8"?> Can the...
6
by: | last post by:
Hi, I'm using .Net CF, and I'm trying to load an XML document that has a first line: <?xml version="1.0" encoding="ISO-8859-1"?> I'm loading this via XmlDocument.Load(). However, I get and...
2
by: dazedandconfused | last post by:
Building a site for a client, loaded it up, it works fine in Firefox but presents the below message when loading into ie 6 or ie 5, fine in 7 I think, but the client can not even view it in 7. So...
4
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I do the following: StringBuilder xml = new StringBuilder(); XmlWriterSettings xws = new XmlWriterSettings(); xws.Encoding = Encoding.GetEncoding("iso-8859-1"); xws.Indent = true; XmlWriter...
3
by: jariwaladivyesh | last post by:
Hi frnds, i have simple XML doc <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <data> <name> Divyesh Jariala</name> </data>
1
by: relrozen | last post by:
Hi, I ran into a code in class using some "Encoding" object. I can't seem to find it. is there a specific library I'm supposed to download? I'm kinda new at this. anyway, in the code there was:...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.