[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 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 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.... 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"?> 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 encoding of an existing document? I can't really find any decent documentation on this anywhere. To top it all off its the heart and soul of how XML works....without it, XML is nothing but a dream. I could be able to read in an XML document and then there should be a basic MSXML method that will allow me to convert the document or a single node from one encoding style to another....it doesn't exist....how can that not exist? Is there some other method in VB that lets me change from encoding to another? I'm sure the problem is that I really don't understand something very basic but I admit it --- it has to be that way, otherwise, there are some major fundamental operations that seem to be critically missing on how to manipulate XML documents for the different encoding styles of the world. Thank You very much. Michael Barber ComCity Corporation 6690 Amador Plaza Rd., Suite 115 Dublin CA 925-556-6940 Fax: 925-556-6945 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 this e-mail. ----- Original Message ----- From: Julian Reschke <julian.reschke@g...> To: ComCity <mikeb@c...>; <xml-dev@l...> Sent: Wednesday, August 29, 2001 12:23 AM Subject: RE: How to specify a Processing Instruction? > > From: ComCity [mailto:mikeb@c...] > > Sent: Tuesday, August 28, 2001 11:43 PM > > To: xml-dev@l... > > Subject: How to specify a Processing Instruction? > > > > > > I need to create an MSXML document with a specific Processing Instruction > > and I'm finding it impossible to do. First, I tried create a template XML > > document on disk that I read in and modify it. > > > > Unfortunately, the XML file opens fine when it says this at the top > > <?xml version="1.0"?> > > > > but if I change it to this, which is what I need, it won't open. > > <?xml version="1.0" encoding="ISO-8859-1"?> > > > > Why? > > This will only work when the file actually *IS* encoded in ISO-8859-1. For > instance, it will fail for files encoded in UTF-8 or UTF-16. > > > I can't even seem to be a way to create a new XML document by scratch (or > > one that I can find) where you can create a new processing instruction > > beyond one that contains the version only even modify an existing XML > > document where you would change the > > processing instruction. > > The XML declaration isn't a processing instruction. It's a conformance bug > in MSXML to treat it this way. > > > There's IXMLDOMProcessingInstruction .... > > > > Very little documentation on it, but it only allow appears to let > > you set or > > change the XML version. I need to set the encoding as well. > > > > I need to be able to send an XML document and the processing instruction > > mus be: <?xml version="1.0" encoding="ISO-8859-1"?> > > So what you really want it is: specify the output encoding when saving the > contents of the DOM to an XML file. This is currently outside the scope of > the DOM spec (DOM level 2 doesn't treat saving at all). > > As far as I know, MSXML should support setting a processing instruction with > target "xml" and value "version='1.0' encoding='ISO-8859-1'" and later will > use the encoding value when saving. > >
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|