cold
2005-06-20 14:07:25 UTC
I'm using VB6 and MSXML3. I create a XML file using the XML DOM but I have a
problem with the createProcessingInstruction() function, because I need to
specify that the file is encoded with UTF-8 encoding. My code is very
simple:
Dim pi As IXMLDOMProcessingInstruction
Set pi = doc.createProcessingInstruction("xml", "version=""1.0""
encoding=""UTF-8""")
Call doc.appendChild(pi)
Now, after this call, the pi.Text value is
version="1.0" encoding="UTF-8"
but the pi.xml property value is
<?xml version="1.0"?>
Why? I tried with UTF-16 encoding, and it works fine...is UTF-8 the default,
so MSXML ignores my specification? Anyway, I need to specify the encoding,
as the program that is supposed to read the XML file won't be able to parse
the file correctly without that.
Thank you in advance for your help
Sebastiano
problem with the createProcessingInstruction() function, because I need to
specify that the file is encoded with UTF-8 encoding. My code is very
simple:
Dim pi As IXMLDOMProcessingInstruction
Set pi = doc.createProcessingInstruction("xml", "version=""1.0""
encoding=""UTF-8""")
Call doc.appendChild(pi)
Now, after this call, the pi.Text value is
version="1.0" encoding="UTF-8"
but the pi.xml property value is
<?xml version="1.0"?>
Why? I tried with UTF-16 encoding, and it works fine...is UTF-8 the default,
so MSXML ignores my specification? Anyway, I need to specify the encoding,
as the program that is supposed to read the XML file won't be able to parse
the file correctly without that.
Thank you in advance for your help
Sebastiano