/** * Function createXmlNode: Creates an Xml_Node object storing * the data of $this Xml_Field. * * @author David S. Callizaya S. <*****@*****.**> * @access public * @return Xml_Node */ public function createXmlNode($includeDefaultValues = false) { /* Start Comment: Creates the corresponding XML Tag for $this * object. */ $attributesList = $this->getXmlAttributes($includeDefaultValues); $node = new Xml_Node($this->name, 'open', $this->sql, $attributesList); /* End Comment */ /* Start Comment: Creates the languages nodes and options * if exist. */ $node->addChildNode(new Xml_Node('', 'cdata', "\n")); $node->addChildNode(new Xml_Node($this->language, 'open', $this->label)); if (isset($this->option)) { foreach ($this->option as $k => $v) { $node->children[1]->addChildNode(new Xml_Node('option', 'open', $v, array('name' => $k))); } } /* End Comment */ return $node; }
/** * Function &findNode * * @author David S. Callizaya S. <*****@*****.**> * @access public * @param eter string xpath * @return string */ public function &findNode($xpath) { if (substr($xpath, 0, 1) == '/') { return parent::findNode(substr($xpath, 1)); } else { if (isset($this->currentNode)) { if ($this->currentNode->name === $this->name) { return parent::findNode($xpath); } else { return $this->currentNode->findNode($xpath); } } else { return $null; } } }