Skip to content

StartElement

Starts a new element with the specified name.

1
myXmlWriter.StartElement(name: string):XmlWriter

Starts a new element with the specified name and namespace.

1
myXmlWriter.StartElement(name: string, ns: string):XmlWriter

Parameters

string name
    Name of the element to start.

string ns
    Namespace URI of the element.

Returns

The current XmlWriter instance, allowing for method chaining. The current XmlWriter instance, allowing for method chaining.

Remarks

This method creates a new element with the specified name and makes it the current element for subsequent operations.

Example

1
2
3
4
var writer = $Xml.Create();
writer.StartElement('Customer');
writer.EndElement();
var xml = writer.ToXml();

This method creates a new element with the specified name and namespace and makes it the current element for subsequent operations.

Example

1
2
3
4
var writer = $Xml.Create();
writer.StartElement('Customer', 'http://tempuri.org/');
writer.EndElement();
var xml = writer.ToXml();

See Also