1
votes

I want to add xml declaration like

?xml version="1.0" encoding="UTF-8" standalone="no"?

this text in my xml. How to do it with vb.net ? any idea?

1
Why do you need to add a header? Would it not be easier to create a document, then add nodes to it? In this case, it will already have the header in place. - Neolisk
@Neolisk its not adding the header automatically. for my stuff I need to add it. - istiaq2379

1 Answers

3
votes
Dim xmlDoc As New XmlDocument()
xmlDoc.AppendChild(.CreateXmlDeclaration("1.0", "utf-8", Nothing))

Refer to MSDN for more information: http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.createxmldeclaration.aspx