Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set programmaticaly in VB6 encoding of XML.

250 views
Skip to first unread message

Milan Lukac

unread,
Jun 28, 2001, 8:12:58 AM6/28/01
to
Hello everyone,
can someone help me with this problem ?

I have such code in VB:

Dim objXMLSchemaDoc As MSXML2.DOMDocument30
Dim objXMLSchemaElement As MSXML2.IXMLDOMElement
Dim objXMLInstruct As MSXML2.IXMLDOMProcessingInstruction

Set objXMLSchemaDoc = New MSXML2.DOMDocument30
objXMLSchemaDoc.loadXML "<Schema></Schema>"
Set objXMLSchemaElement = objXMLSchemaDoc.documentElement

Set objXMLInstruct = objXMLSchemaDoc.createProcessingInstruction("xml",
"version=""1.0""")
objXMLSchemaDoc.insertBefore objXMLInstruct, objXMLSchemaElement

MsgBox objXMLSchemaDoc.xml

The result of this is :

<?xml version="1.0"?>
<Schema></Schema>

I need to have:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Schema></Schema>

Can someone tell me how to set programmaticaly in VB6 this encoding in XML ?

Thanks, Ing. Milan Lukac.


Joe H

unread,
Jun 30, 2001, 10:56:45 AM6/30/01
to
Set objXMLInstruct = objXMLSchemaDoc.createProcessingInstruction("xml",
"version=""1.0""")

should be

Set objXMLInstruct = objXMLSchemaDoc.createProcessingInstruction("xml",

"version=""1.0"" encoding=""iso-8859-1""")

* all quotes are double-quotes.


"Milan Lukac" <milan...@softproject.de> wrote in message
news:u$LyLu8$AHA.1292@tkmsftngp02...

Milan Lukac

unread,
Jun 30, 2001, 11:15:00 AM6/30/01
to
Thank you,
it is working. I was also trying something like this, but I putted in quotes
also encoding, therefore it didn't work.

Thank you, once more.

"Joe H" <jha...@webcom.com> wrote in message
news:u2T9vUXABHA.2328@tkmsftngp02...

0 new messages