芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resupres/javascript/ckfinder/core/connector/php/php4/Utils/XmlNode.php
_name = $nodeName; if (!is_null($nodeValue)) { $this->_value = $nodeValue; } } function &getChild($name) { foreach ($this->_childNodes as $i => $node) { if ($node->_name == $name) { return $this->_childNodes[$i]; } } return null; } /** * Add attribute * * @param string $name * @param string $value * @access public */ function addAttribute($name, $value) { $this->_attributes[$name] = $value; } /** * Get attribute value * * @param string $name * @access public */ function getAttribute($name) { return $this->_attributes[$name]; } /** * Set element value * * @param string $name * @param string $value * @access public */ function setValue($value) { $this->_value = $value; } /** * Get element value * * @param string $name * @param string $value * @access public */ function getValue() { return $this->_value; } /** * Adds new child at the end of the children * * @param Ckfinder_Connector_Utils_XmlNode $node * @access public */ function addChild(&$node) { $this->_childNodes[] =& $node; } /** * Return a well-formed XML string based on Ckfinder_Connector_Utils_XmlNode element * * @return string * @access public */ function asXML() { $ret = "<" . $this->_name; //print Attributes if (sizeof($this->_attributes)>0) { foreach ($this->_attributes as $_name => $_value) { $ret .= " " . $_name . '="' . htmlspecialchars($_value) . '"'; } } //if there is nothing more todo, close empty tag and exit if (is_null($this->_value) && !sizeof($this->_childNodes)) { $ret .= " />"; return $ret; } //close opening tag $ret .= ">"; //print value if (!is_null($this->_value)) { $ret .= htmlspecialchars($this->_value); } //print child nodes if (sizeof($this->_childNodes)>0) { foreach ($this->_childNodes as $_node) { $ret .= $_node->asXml(); } } $ret .= "" . $this->_name . ">"; return $ret; } }