Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration statement in XML

Status
Not open for further replies.

adasoft

Programmer
Jan 31, 2002
132
0
0
IN
Hi,

How can I insert declaration statement in XML document if I am creating XML document using DOM. For example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

When I am creating XML document using VB 6.0 with Msxml2.DOMDocument.4.0, it is not being inserted automatically.Can anyone help me?

Thanx.
 
Add those attributes to the document before you add any nodes.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Code:
Set XMLInstruct = XMLDocument.createProcessingInstruction ("xml", "version=""1.0"" encoding=""UTF-8"" standalone=""yes""")
If Instr(1,XMLDocument.childNodes(0).xml, "?xml") Then
	Set topNode = XMLDocument.childNodes(1)
Else
	Set topNode = XMLDocument.childNodes(0)
End If
XMLDocument.insertBefore XMLInstruct, topNode

Jon

"Asteroids do not concern me, Admiral. I want that ship, not excuses.
 
Hi,

Thanks very much for this valuable help.Its work fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top