OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to specify a Processing Instruction?

> From: ComCity [mailto:mikeb@comcity.com]
> Sent: Wednesday, August 29, 2001 7:35 PM
> To: Julian Reschke; xml-dev@lists.xml.org
> Subject: Re: How to specify a Processing Instruction?
> Well, this is not what I read.  I read that the encoding part of the
> processing instruction is something that will be used eventually by the

It isn't a processing instruction.

> server I'm sending it to.  Right now, I'm just creating the document from
> scratch so there really is "no" encoding.  I want to set the encoding so

The DOM doesn't have an encoding. The serialization as XML has an encoding.
Which encoding is used usually doesn't have anything to do with the contents
of the DOM (except for MSXML which uses the aforementioned hack).

> that the eventually server will be able to understand the XML
> document....it
> expects ISO-8859-1.  This seems a bit like a chicken and the egg....

Are you sure that the server expects ISO-8859-1? If it doesn't accept UTF-8
or UTF-16, then it's broken (because an XML parser *must* understand these

Maybe you're trying to solve a problem that doesn't exist?

> I basically want to start with an xml document that has the basic
> "framework" and then I want to add and change some of the nodes
> so that they
> have want the server expects and then I want to send this off.
> If I try to
> read the document in completely blank as only:
> <?xml version="1.0" encoding="ISO-8859-1"?>

A well-formed XML document *must* contain (exactly) one element node on the
top-level. This document doesn't, so it's not XML.

> It still gives me an error saying it can't read it in.  Of course, at that
> point, its not only not encoded, there's nothing there at all.
> This whole issue of how encoding in XML works is the weakest thing.....I
> went to Borders books yesterday and I looked at every single book on the
> shelf - a total of more than 40-50....it took me hours and there
> wasn't more
> than a page on encoding in any one book.  And, even then, it simply
> explained what encoding was and nothing practical.  How do you create a
> document from scratch with a particular encoding?  How do you change the

Usually, this is not an issue at all. Create documents in the default
encoding and let the XML parsers do their job.