Creates an XmlWhitespace node.
Option Explicit
Option Strict
Imports System
Imports System.Xml
Imports Microsoft.VisualBasic
Public Class Sample
Public Shared Sub Main()
Dim doc As New XmlDocument()
doc.LoadXml("<author>" & _
"<first-name>A</first-name>" & _
"<last-name>B</last-name>" & _
"</author>")
Console.WriteLine(doc.DocumentElement.InnerText)
Dim currNode as XmlNode = doc.DocumentElement
Dim ws As XmlWhitespace = doc.CreateWhitespace(ControlChars.CrLf)
currNode.InsertAfter(ws, currNode.FirstChild)
Console.WriteLine(doc.DocumentElement.InnerText)
End Sub
End Class 'Sample
Related examples in the same category