Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class jala.XmlWriter

    Object
       |
       +--jala.XmlWriter

Direct Known Subclasses:
  jala.Rss20Writer

class jala.XmlWriter

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.
Defined in XmlWriter.js

Constructor Summary
`jala.XmlWriter (<String> header)` Construct a new XML writer.

Method Summary
`jala.XmlWriter.XmlElement` | `addNamespace(<String> name, <String> url)` Add a namespace to this writer.
`jala.XmlWriter` | `clone(obj)` Clone this XML writer.
`jala.XmlWriter.XmlElement` | `createElement(<Object> data)` Get a newly created XML element.
`jala.XmlWriter` | `extend(<Object> template, <Object> ext)` Extend a template object.
`jala.XmlWriter.XmlElement` | `getRoot()` Get the root XML element of this writer.
`String` | `toString()` Get the XML output as string.
`void` | `write()` Write the XML to the response buffer.

Constructor Detail

### jala.XmlWriter

    jala.XmlWriter(<String> header)

Construct a new XML writer.

Parameters:

`header` - An optional XML header.

Returns:

A new XML writer.

Method Detail

### addNamespace

    jala.XmlWriter.XmlElement addNamespace(<String> name, <String> url)

Add a namespace to this writer.

Parameters:

`name` - The name of the namespace.

`url` - The URL string of the namespace.

Returns:

The XML root element.

### clone

    jala.XmlWriter clone(obj)

Clone this XML writer.

Parameters:

`The` - clone templare.

Returns:

The cloned XML writer.

### createElement

    jala.XmlWriter.XmlElement createElement(<Object> data)

Get a newly created XML element.

Parameters:

`data` - The XML data as object tree.

Returns:

The resulting XML element.

### extend

    jala.XmlWriter extend(<Object> template, <Object> ext)

Extend a template object.

Parameters:

`template` - The template object.

`ext` - The extension object.

Returns:

The XML writer.

### getRoot

    jala.XmlWriter.XmlElement getRoot()

Get the root XML element of this writer.

Returns:

The root XML element.

### toString

    String toString()

Get the XML output as string.

Returns:

The XML output.

### write

    void write()

Write the XML to the response buffer.

Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Tue Jan 8 15:45:31 2008