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
string
XML Version i.e. "1.0"
string
XML Encoding i.e. "UTF-8"
addRoot(string $strNodeName, string $strNodeContent, array $arrNodeAttribs) : object
string
XML Node Name
string
XML Node Content
array
Attributes array('name'=>'value')
object
Reference to the root node objectdump(boolean $bolReturn) : string
boolean
Return content
string
Tree XMLsetIndent(int $string) : void
int
level
$_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 |
---|