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 );
Exception Type | Condition |
---|---|
InvalidOperationException | If writer is closed. |
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 .
XmlWriter Class | XmlWriter Members | System.NewXml Namespace | XmlWriter.WriteStartElement Overload List