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

Re: How to specify a Processing Instruction?

  • From: "Simon St.Laurent" <simonstl@s...>
  • To: ComCity <mikeb@c...>
  • Date: Wed, 29 Aug 2001 13:48:02 -0400

msxml processing instructions
On 29 Aug 2001 10:35:25 -0700, ComCity wrote:
> 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....

The XML Declaration is not a processing instruction, as others have
noted.  However, MSXML 3.0 (and I think 4.0) treats it as a processing
instruction. 

You can assign an XML Declaration to an MSXML DOM by adding a processing
instruction to the DOM _before_ adding anything else:

var pi=xmldoc.CreateProcessingInstruction("xml"," version='1.0'
encoding='ISO-8859-1'");
xmldoc.appendChild(pi);

This PI must be the first thing in the DOM - no whitespace, nothing else
- or MSXML will ignore it.  

I don't currently have a functional MSXML parser, so this description is
based on old notes, but hopefully it will help.

There is also an excellent book, Unicode: A Primer, by Tony Graham,
which explains a lot of encoding issues, though it isn't focused on XML.

Simon St.Laurent
http://simonstl.com


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.