Mono Class Library: System.Xml.XmlWriter Overview | MembersSystem.Xml.XmlWriter.WriteStartElement Method |
Writes a start element with the specified name, and associates it with the given namespace and prefix. [Edit]
|
Type Reason InvalidOperationException The XmlWriter.WriteState is WriteState.Closed. [Edit]
Operation
This method writes a start element and name, and associates it with a namespace and prefix. If the namespace is already in scope and has an associated prefix, that prefix is automatically written also.
If any of the input parameters are null or string.Empty, the start element is written with that parameter missing.
Note to Inheritors
When overriding this method, also override the XmlWriter.WriteEndElement, XmlWriter.WriteString(string), and XmlWriter.WriteRaw(Char[], int, int) methods so they close any open start element.Usage
Use this method to write a specified start element and name, and associate it with a given namespace and prefix. Write any attributes using the XmlWriter.WriteStartAttribute(string, string), XmlWriter.WriteString(string), and XmlWriter.WriteEndAttribute methods, then close the element using the XmlWriter.WriteEndElement method. [Edit]
See XmlTextWriter.WriteStartElement(string, string, string) for an example demonstrating this method.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0