Writes an empty tag that ends with "/>".
[Visual Basic] MustOverride Public Sub WriteEmptyElement( _ ByVal name As String, _ ByVal ns As String _ ) [C#] public abstract void WriteEmptyElement( string name, string ns ); [C++] public: virtual void WriteEmptyElement( String* name, String* ns ) = 0; [JScript] public abstract 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:
<foo bar="123"/>
XmlWriter Class | XmlWriter Members | System.NewXml Namespace