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!

XmlWriter.WriteEmptyElement

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

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:

<foo bar="123"/>

See Also

XmlWriter Class | XmlWriter Members | System.NewXml Namespace