How to set programmaticaly in VB6 encoding of XML. 
Author Message
 How to set programmaticaly in VB6 encoding of XML.

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.



Mon, 15 Dec 2003 20:12:58 GMT  
 How to set programmaticaly in VB6 encoding of XML.
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.


Quote:
> 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.



Wed, 17 Dec 2003 22:56:45 GMT  
 How to set programmaticaly in VB6 encoding of XML.
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.


Quote:
> 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.



> > 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",

- Show quoted text -

Quote:
> > "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.



Wed, 17 Dec 2003 23:15:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting encoding for XML in ADO?

2. Setting date & decimal format programmaticaly

3. VB6 DataCombo - how to select certain entry programmaticaly?

4. XML and character encoding

5. xmldoc.xml & string = bstr / Problem with encoding

6. xmldoc.xml & string = bstr / Problem with encoding

7. xml-encode?

8. Read XML using VB6 DOM 4.0 with Namespaces - See Sample XML

9. base64 encoding in XML (in eVB)

10. HELP - Setting encoding of Message subject in CDO 2000 to windows-1251 (or koi8-r)

11. Set the encoding of a Web Browser control

12. ASCII encoding and character sets...

 

 
Powered by phpBB® Forum Software