[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to specify a Processing Instruction?
- From: ComCity <email@example.com>
- To: Julian Reschke <firstname.lastname@example.org>, email@example.com
- Date: Wed, 29 Aug 2001 12:02:10 -0700
This is for UPS (United Parcel System) XML Cost calculator. I'm having to
transfer a node from one xml document to another. When I do this without
specifying the encoding which is what I was doing originally, the UPS parser
was complaining that the "text" in the node had changed during my transfer.
When I look at the text, I note that the text is originally one long set of
characters with black squares where carriage returns should be. I believe
this means that the node is originally "encoded". When I transfer it by
virtually any and every means I try with MSXML including setting a node,
replacing a child node,etc., the text is formated by MSXML and the carriage
returns are changed to real carriage returns, etc. According to UPS and
what I need to do, this "will not" work.
This access text must be preserved exactly as is and, in addition, the
encoding of ISO-8859-1 must be at the top of the XML document. If I create
a "fake" xml document using notepad preserving the "encoding" (or what I
believe to be encoding) of the text and putting the encoding specification
at the top, the XML document is accepted by UPS when they manually submit
So, I know what I need to do, but it totally escapes me on how I need to do
it. Why? Because, I have no way to keep MSXML from changing this text as
it is saved into the second XML document.....I was hoping that if I simply
create the document as ISO-8859-1 from the beginning, the MSXML parser will
leave this text "as is". But, I don't even know if this will work.....its a
pure hypothetical guess at this point. The only other solution I could come
up was to somehow tell MSXML "not" to change the encoding of this node, but
there's no way to do that that I know of.
I could send my XML document....what I currently am able to do and what UPS
says it needs to look like as an attachment if that would help.
Thank You very much.
6690 Amador Plaza Rd., Suite 115
DISCLAIMER: This e-mail contains proprietary information some or all of
which may be legally privileged. It is for the intended recipient(s) only.
If an addressing or transmission error has misdirected this e-mail, please
notify the author by replying to this e-mail. If you are not the intended
recipient you must not use, disclose, distribute, copy, print, or reply on
----- Original Message -----
From: Julian Reschke <firstname.lastname@example.org>
To: ComCity <email@example.com>; <firstname.lastname@example.org>
Sent: Wednesday, August 29, 2001 11:00 AM
Subject: RE: How to specify a Processing Instruction?
> > From: ComCity [mailto:email@example.com]
> > Sent: Wednesday, August 29, 2001 7:35 PM
> > To: Julian Reschke; firstname.lastname@example.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
> > 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
> Which encoding is used usually doesn't have anything to do with the
> 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
> 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
> 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
> > 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.