XmlTree()
addRoot()
dump()
setIndent()
$_indentChar
$_objRoot
$_strRootAttribs
$_strRootContent
$_strRootName
$_strXml
$_strXmlEncoding
$_strXmlVersion
XmlTree class
Class to create XML tree structures from scratch without the need for a XML DOM
Example:
!! Attention, using '=&' is deprecated in PHP >= 5.3 and causes a deprecated runtime error don't use it any more (Ortwin Pinke, 2010-07-03
$tree = new XmlTree('1.0', 'ISO-8859-1'); $root =& $tree->addRoot('rootname', 'some content', array('foo'=>'bar'));
This genererates following XML:
$root now references the 'rootname' node object. To append childNodes use the appendChild method.
$foo =& $root->appendChild('foo', 'bar');
Note: From version 1.1 you can use the $obj->add() method as shortcut to appendchild
!! ALWAYS use '=&' with the addRoot and appendChild methods. !!
XmlTree(string $strXmlVersion, string $strXmlEncoding) : void
stringXML Version i.e. "1.0"
stringXML Encoding i.e. "UTF-8"
addRoot(string $strNodeName, string $strNodeContent, array $arrNodeAttribs) : object
stringXML Node Name
stringXML Node Content
arrayAttributes array('name'=>'value')
objectReference to the root node objectdump(boolean $bolReturn) : string
booleanReturn content
stringTree XMLsetIndent(int $string) : void
intlevel
$_indentChar : string
| access | private |
|---|
$_objRoot : object
| access | private |
|---|
$_strRootAttribs : array
| access | private |
|---|
$_strRootContent : string
| access | private |
|---|
$_strRootName : string
| access | private |
|---|
$_strXml : string
| access | private |
|---|
$_strXmlEncoding : string
| access | private |
|---|
$_strXmlVersion : string
| access | private |
|---|