473,545 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6199
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************ *********@news0 00.worldonline. dk>,
Soren Kuula <do**********@b itplanet.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
5335
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. My first try was: f = open('words.xml', 'r') s = f.read() xml.sax.parseString(s, MyParser()) This produced the following error:
3
3299
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 thoughts? My sample code snippet is: DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(in.xml); FileWriter file =...
4
2402
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
3029
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 XmlTextWriter do this?? Thanks. Amil
6
10593
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 XmlException with no real good useful info: An unhandled exception of type 'System.Xml.XmlException' occurred in System.Xml.dll
2
17156
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 what is going on? The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the...
4
10347
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 xtw = XmlTextWriter.Create(new StringWriter(xml), xws); .... But the xml it creates has encoding="utf-16"
3
18972
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
1541
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: import encoding.Encoding; thanks
0
7411
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7439
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5987
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.