Class: XmlWriter

jala.XmlWriter(header)

This class defines a generic interface to write arbitrary and validating XML source code. This is done by first applying data objects onto template objects, both in a specified format. Then, the resulting object tree is transformed into XML. Moreover, template objects can be extended with other template objects to provide full flexibility in inheriting subclasses.

Constructor

new XmlWriter(header)

Construct a new XML writer.
Parameters:
Name Type Description
header String An optional XML header.
Source:
Returns:
A new XML writer.

Methods

addNamespace(name, url)

Add a namespace to this writer.
Parameters:
Name Type Description
name String The name of the namespace.
url String The URL string of the namespace.
Source:
Returns:
The XML root element.

clone(The)

Clone this XML writer.
Parameters:
Name Type Description
The Object clone templare.
Source:
Returns:
The cloned XML writer.

createElement(data)

Get a newly created XML element.
Parameters:
Name Type Description
data Object The XML data as object tree.
Source:
Returns:
The resulting XML element.

extend(template, ext)

Extend a template object.
Parameters:
Name Type Description
template Object The template object.
ext Object The extension object.
Source:
Returns:
The XML writer.

getRoot()

Get the root XML element of this writer.
Source:
Returns:
The root XML element.

toString()

Get the XML output as string.
Source:
Returns:
The XML output.

write()

Write the XML to the response buffer.
Source: