NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlTextWriter.WriteEmptyElement

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
);

Parameters

name
The name of the element. The name argument can contain a prefix.
ns
The namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix then the writer will automatically write that prefix also.

Remarks

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"/>

See Also

XmlTextWriter Class | XmlTextWriter Members | System.NewXml Namespace