/** * Constructor * * @param string $strTag The tag name * @param string|null $strValue The CDATA value * @param array $arrAttributes Associative array with attributes * @param Xml|Bean $objParent The parent element */ public function __construct($strTag = 'xml', $strValue = null, $arrAttributes = array(), $objParent = null) { // Initialize the node's attributes $this->strTag = $strTag; $this->strValue = $strValue; $this->arrAttributes = is_array($arrAttributes) ? $arrAttributes : array(); // DEBUG // $this->intIndex = $intIndex; if ($objParent) { $this->objRoot = $objParent->root(); $this->objParent = null; } else { $this->intIndex = 0; $this->objRoot = $this; $this->objParent = $objParent; } // Initialize the node's building functions. // Child nodes may have additional functions to handle the tag's events such as // opening or closing the tag. $this->build(); }