XmlConvert.VerifyWhitespace : XmlConvert « XML « VB.Net






XmlConvert.VerifyWhitespace

 

Imports System
Imports System.Xml

Public Class Sample

  Public Shared Sub Main()
        Dim writer5 As XmlTextWriter = New XmlTextWriter("outFile.xml", Nothing)
        Dim illegalWhiteSpaceChar As Char = "_"

        Try
            writer5.WriteStartElement("root")
            writer5.WriteStartElement("legalElement")
            writer5.WriteString("ValueText" + XmlConvert.VerifyWhitespace("   " + illegalWhiteSpaceChar))
            writer5.WriteEndElement()
            writer5.WriteEndElement()
            writer5.Close()
        Catch e As XmlException
            Console.WriteLine(e.Message)
            writer5.Close()
        End Try
  End Sub
End Class

   
  








Related examples in the same category

1.XmlConvert.DecodeName
2.XmlConvert.ToDateTime converts the String to a DateTime equivalent.
3.XmlConvert.ToDateTimeOffset
4.XmlConvert.ToString converts the DateTime to a String.
5.Encode and decode a local name
6.Returns valid XML characters