DOMi Documentation

DOMi 1.1

DOMNode AttachToXml ( mixed $Data, string $Prefix, DOMNode $ParentNode )
DOMNode ConvertToXml ( mixed $Data, string $Prefix )
DOMi DOMi ( string $MainNodeName )
string Render ( mixed $StylesheetList, string $Mode )

AttachToXml

DOMNode AttachToXml ( mixed $Data, string $Prefix, DOMNode $ParentNode )
AttachToXml is the primary function to add new data to the XML tree. Passing only the first two parameters is the most common method, with the first parameter often being an object or array of data. This data is then recursively built onto the XML tree, mirroring the structure it had prior to be passed to AttachToXml.
mixed Data
The data that is be attached to the XML tree. Any PHP data type can be processed, including custom made objects.
string Prefix
The name of the new node to be created. Each call to AttachToXml will attempt to create a new node to house the provided data, with the value of this parameter determing the name of the node.
DOMNode ParentNode
The node to which the new node will be appended. Default is the root node of the DOMDocument.

ConvertToXml

DOMNode ConvertToXml ( mixed $Data, string $Prefix )
ConvertToXml operates similar to AttachToXml, except ConvertToXml will not attach the resulting DOMNode onto the DOM tree at any point.
mixed Data
The data that is be attached to the XML tree. Any PHP data type can be processed, including custom made objects.
string Prefix
The name of the new node to be created. Each call to AttachToXml will attempt to create a new node to house the provided data, with the value of this parameter determing the name of the node.

DOMi

DOMi DOMi ( string $MainNodeName )
Constructor function to set up the DOMi object.
string MainNodeName
An optional parameter that will be used as the root node name. If nothing is provided, 'root' is the default option.

Render

string Render ( mixed $StylesheetList, string $Mode )
Render displays the final output of the XSLTProcessor conversion, or in the case of DOMi::RENDER_XML, the current DOMDocument.
mixed StylesheetList
A string or array of strings representing file locations of XSL stylesheets to be used in the rendering process. This file or files will be imported to the XSLTProcessor for the rendering process.
string Mode
This parameter accepts one of three constants - DOMi::RENDER_HTML, DOMi::RENDER_XML, DOMi::RENDER_VIEW. DOMi::RENDER_HTML is the default option and will convert the XML and XSL into HTML through the XSLTProcessor and display as HTML. DOMi::RENDER_XML will display the DOMDocument output as XML and is useful during debugging and creation of the XSL stylesheet. DOMi::RENDER_VIEW is a combination of the two systems - displaying the result of the XSLTProcessor as XML. This is primarily intended for XML API systems.