How can I help you?
XmlWriter
6 Feb 20263 minutes to read
XmlWriter class provide method to create XML data
Properties
Get text string
Gets the current XML content as a string.
Note: This returns only the in-memory buffer and is intended for lightweight builders
where no explicit flush() to Blob has occurred.
Methods
writeAttributeString
Writes out the attribute with the specified prefix, local name, namespace URI, and value.
| Parameter | Type | Description |
|---|---|---|
| prefix | string |
Namespace prefix of element. |
| localName | string |
Local name of element. |
| namespace | string |
Namespace URI associated with element. |
| value | string |
Value of element. |
Returns void
writeElementString
Writes an element with the specified prefix, local name, namespace URI, and value.
| Parameter | Type | Description |
|---|---|---|
| prefix | string |
The namespace prefix of the element. |
| localName | string |
The local name of the element. |
| namespace | string |
The namespace URI associated with the element. |
| value | string |
The value of the element. |
Returns void
writeEndElement
Closes one element and pops the corresponding namespace scope.
Returns void
writeRaw
Write given text as raw data.
| Parameter | Type | Description |
|---|---|---|
| text | string |
Text to write. |
Returns void
writeStartDocument
Writes the XML declaration with version and standalone attribute.
| Parameter | Type | Description |
|---|---|---|
| standalone (optional) | boolean |
If true, writes standalone="yes", otherwise standalone="no". |
Returns void
writeStartElement
Writes the specified start tag and associates it with the given namespace and prefix.
| Parameter | Type | Description |
|---|---|---|
| prefix | string |
The namespace prefix of the element. |
| localName | string |
The local name of the element. |
| namespace | string |
The namespace URI associated with the element. |
Returns void
writeString
Writes the given text content.
| Parameter | Type | Description |
|---|---|---|
| text | string |
Text to write. |
Returns void