User management for the world wide web

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

GenieGate_XMLWriter Class Reference

Simple, basic XML writing class. More...

List of all members.

Public Member Functions

 GenieGate_XMLWriter ($header=TRUE, $format=FALSE)
 Construct an XMLWriter.

 out ($raw)
 send XML out.

 escape ($string)
 Escapes text for output.

 text ($string)
 Send text to the output.

 start ($tag, $attr=array())
 Start an element.

 atom ($tag, $attr=array())
 Send a self closing element.

 close ()
 closes the last opened element.

 finish ()
 Closes all the open tags.


Public Attributes

 $FORMAT = FALSE
 If set to TRUE the output is tab indented.


Detailed Description

Simple, basic XML writing class.

This class does very little except keep track of the tag order and escape the XML text.

Definition at line 163 of file utils.php.


Constructor & Destructor Documentation

GenieGate_XMLWriter header = TRUE,
format = FALSE
 

Construct an XMLWriter.

Parameters:
$header - Whether or not to start the XML declaration in the beginning.
$format - Whether or not to format the output. (insert tabs and newlines)

Definition at line 178 of file utils.php.

References out().


Member Function Documentation

atom tag,
attr = array()
 

Send a self closing element.

Parameters:
$tag - The tagname.
$attr - associative array of Attribute => Value

Definition at line 241 of file utils.php.

References escape(), and out().

close  ) 
 

closes the last opened element.

The last tag created with start() is closed.

Definition at line 258 of file utils.php.

References out().

Referenced by finish().

escape string  ) 
 

Escapes text for output.

It just uses the htmlentities() function. (Over-ride if needed)

Parameters:
$string - Text to be escaped.

Definition at line 200 of file utils.php.

Referenced by atom(), and start().

finish  ) 
 

Closes all the open tags.

It calls close() a number of times until all the opened elements are closed.

Definition at line 272 of file utils.php.

References close(), and out().

out raw  ) 
 

send XML out.

By default, it just echo's the XML to the current buffer. Override to send to a file handle, collection, etc..

Parameters:
$raw - Raw data to be sent out.

Definition at line 191 of file utils.php.

Referenced by atom(), close(), finish(), GenieGate_XMLWriter(), start(), and text().

start tag,
attr = array()
 

Start an element.

The order of tags is tracked, so calling close() will close the first tag.

Parameters:
$tag - Tagname of the element. (Must be valid XML, and is not checked)
$attr - Associative array of attribue => value tags.

Definition at line 219 of file utils.php.

References escape(), and out().

text string  ) 
 

Send text to the output.

Parameters:
$string - String to be inserted.

Definition at line 207 of file utils.php.

References out().


The documentation for this class was generated from the following file:
DoxyGen Documentation generated by DoxyGen