XmlDocument.CreateDocumentType returns a new XmlDocumentType object.
Option Explicit
Option Strict
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim doc As New XmlDocument()
Dim doctype As XmlDocumentType
doctype = doc.CreateDocumentType("book", Nothing, Nothing, "<!ELEMENT book ANY>")
doc.AppendChild(doctype)
doc.AppendChild(doc.CreateElement("book"))
doc.Save(Console.Out)
End Sub
End Class
Related examples in the same category