XmlWriter
16 Dec 20254 minutes to read
XmlWriter class provide method to create XML data
Properties
buffer Blob
Gets the content written to the XmlWriter as a Blob.
Methods
destroy
Releases the resources used by XmlWriter.
Returns void
save
Saves the file with the specified name and sends the file to the client browser.
| Parameter | Type | Description |
|---|---|---|
| fileName | string |
File name. |
Returns void
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
writeEndDocument
Closes any open tag or attribute and writes the state back to start.
Returns void
writeEndElement
Closes one element and pops the corresponding namespace scope.
Returns void
writeProcessingInstruction
Writes a processing instruction with a space between the name and text.
| Parameter | Type | Description |
|---|---|---|
| name | string |
The name of the processing instruction. |
| text | string |
The text to write in the processing instruction. |
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