This method will generate an empty tag that ends with "/>".
[Visual Basic] Overrides Public Sub WriteEmptyElement( _ ByVal name As String, _ ByVal ns As String _ ) [C#] public override void WriteEmptyElement( string name, string ns ); [C++] public: override void WriteEmptyElement( String* name, String* ns ); [JScript] public override function WriteEmptyElement( name : String, ns : String );
This tag is finished when you call WriteEndElement. The arguments have the same meaning as WriteStartElement. For example:
[C#]
writer.WriteEmptyElement("foo",null); writer.WriteAttribute("bar","123"); writer.WriteEndElement();
Generates the following:
[xml]
<foo bar="123"/>
XmlTextWriter Class | XmlTextWriter Members | System.NewXml Namespace