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.WriteStartElement (String, String)

Writes out the specified start tag and associates it with the given namespace.

[Visual Basic]
Overloads MustOverride Public Sub WriteStartElement( _
   ByVal name As String, _
   ByVal ns As String _
)
[C#]
public abstract void WriteStartElement(
   string name,
   string ns
);
[C++]
public: virtual void WriteStartElement(
   String* name,
   String* ns
) = 0;
[JScript]
public abstract function WriteStartElement(
   name : String,
   ns : String
);

Parameters

name
The name argument can contain a prefix in which case uses this prefix and associates this prefix with the given namespace for the scope of this element.
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.

Exceptions

Exception Type Condition
InvalidOperationException If writer is closed.

Remarks

After calling this method you can either write attributes, or you can go directly to content (WriteComment, WriteString, or WriteStartElement for child elements). You must close this element with WriteEndElement at which time a full end tag is written out. For example:

[C#]

writer.WriteStartElement("foo",null");
writer.WriteEndElement();

will generate the following output:

[C#]

<foo></foo>

If you want to write an empty element with the "/>" syntax, then use WriteEmptyElement .

See Also

XmlWriter Class | XmlWriter Members | System.NewXml Namespace | XmlWriter.WriteStartElement Overload List