encoding ignored in MSXML Load method

I'm not sure if this is the right list for this question.  If not, please
direct me to the appropriate place.  Thanks.

Here's the problem:

I'm using MSXML 4 and DOM to load an XML document into a DOMDocument
object.  I explicitly state the encoding of the XML document as UTF-8, but
when I use the Load or the LoadXML method of the DOMDocument object, the
encoding attribute of the 'xml' processing instruction is being ignored.
I read in the MSXML 4 documentation that "loadXML() will work only with
UTF-16 or UCS-2 encodings" so I suppose this means that I MUST use Load().

I've tried adding the byte-order mark (EF BB BF) for UTF-8 at the
beginning of the xml file, as well as making sure I'm using Line Feeds as
the line-endings, but I get the same result.

Here's the XML file (xmlfile.xml):

<?xml version="1.0" encoding="utf-8"?>
<fo:root>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="page">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block id="BaseFO"/>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

And the code to load it:

Set xmlFO = New MSXML2.DOMDocument
xmlFO.Load "xmlfile.xml"
Debug.Print xmlFO.xml

And the result of outputting xmlFO.xml:

<?xml version="1.0"?>
<fo:root>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="page">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block id="BaseFO"/>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

It's the same, except with no encoding attribute!  Any ideas?

TIA,

-TIM

Received on Friday, 9 November 2001 10:10:13 UTC