[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to specify a Processing Instruction?

  • From: Julian Reschke <julian.reschke@g...>
  • To: ComCity <mikeb@c...>, xml-dev@l...
  • Date: Wed, 29 Aug 2001 20:00:38 +0200

processing instruction xml
> From: ComCity [mailto:mikeb@c...]
> Sent: Wednesday, August 29, 2001 7:35 PM
> To: Julian Reschke; xml-dev@l...
> 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
encodings).

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.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.