XmlWriter
12 Sep 20254 minutes to read
XmlWriter class provide method to create XML data
Properties
buffer Blob
Gets the content written to the {XmlWriter} as Blob.
Methods
destroy
Releases the resources used by XmlWriter.
Returns void
save
Saves the file with specified name and sends the file to 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 |
localName of element |
| namespace | string |
namespace URI associate 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 |
namespace prefix of element |
| localName | string |
localName of element |
| namespace | string |
namespace URI associate with element |
| value | string |
value of element |
Returns void
writeEndDocument
Closes any open tag or attribute and write the state back to start
Returns void
writeEndElement
Closes one element and pop corresponding namespace scope
Returns void
writeProcessingInstruction
Writes processing instruction with a space between the name and text
| Parameter | Type | Description |
|---|---|---|
| name | string |
name of the processing instruction |
| text | string |
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 Xml declaration with version and standalone attribute
| Parameter | Type | Description |
|---|---|---|
| standalone (optional) | boolean |
if true it write standalone=yes else standalone=no |
Returns void
writeStartElement
Writes the specified start tag and associates it with the given namespace and prefix.
| Parameter | Type | Description |
|---|---|---|
| prefix | string |
namespace prefix of element |
| localName | string |
-localName of element |
| namespace | string |
namespace URI associate with element |
Returns void
writeString
Writes the given text content
| Parameter | Type | Description |
|---|---|---|
| text | string |
text to write |
Returns void