istiaq2379
istiaq2379

Reputation: 113

How to add a xml file header with vb.net

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?

Upvotes: 1

Views: 4022

Answers (1)

rory.ap
rory.ap

Reputation: 35270

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

Upvotes: 3

Related Questions