XmlTextWriter.WriteCharEntity Method forces the generation of a character entity for the specified Unicode character value. : XmlTextWriter « XML « VB.Net






XmlTextWriter.WriteCharEntity Method forces the generation of a character entity for the specified Unicode character value.

 

Imports System
Imports System.Xml

public class Sample 
  public shared sub Main() 
    Dim writer as XmlTextWriter = nothing
      try 
        writer = new XmlTextWriter (Console.Out)

        writer.WriteStartElement("address")
        writer.WriteString("someone")
        writer.WriteCharEntity("@"c)
        writer.WriteString("example")
        writer.WriteCharEntity("."c)
        writer.WriteString("com")
        writer.WriteEndElement()        
    finally 
      if not writer is nothing
        writer.Close()
      end if
    end try 
  end sub
end class

   
  








Related examples in the same category

1.XmlTextWriter.Close closes this stream and the underlying stream.
2.XmlTextWriter.Flush
3.XmlTextWriter.Formatting Property indicates how the output is formatted.
4.XmlTextWriter.Indentation
5.XmlTextWriter.WriteCData writes out a block
6.XmlTextWriter.WriteEndElement closes one element and pops the corresponding namespace scope.
7.XmlTextWriter.WriteFullEndElement closes one element and pops the corresponding namespace scope.
8.XmlTextWriter.WriteQualifiedName Method writes out the namespace-qualified name
9.XmlTextWriter.WriteRaw Method writes raw markup manually from a string.
10.XmlTextWriter.WriteWhitespace writes out the given white space.
11.Verifies name according to the W3C Extended Markup Language recommendation.