<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/




 if (!defined('IN_CKFINDER')) exit; class Ckfinder_Connector_Utils_XmlNode { private $_attributes = array(); private $_childNodes = array(); private $_name; private $_value; function __construct($nodeName, $nodeValue = null) { $this->_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; } public function addAttribute($name, $value) { $this->_attributes[$name] = $value; } public function getAttribute($name) { return $this->_attributes[$name]; } public function setValue($value) { $this->_value = $value; } public function getValue() { return $this->_value; } public function addChild(&$node) { $this->_childNodes[] =& $node; } public function asXML() { $ret = "<" . $this->_name; if (sizeof($this->_attributes)>0) { foreach ($this->_attributes as $_name => $_value) { $ret .= " " . $_name . '="' . htmlspecialchars($_value) . '"'; } } if (is_null($this->_value) && !sizeof($this->_childNodes)) { $ret .= " />"; return $ret; } $ret .= ">"; if (!is_null($this->_value)) { $ret .= htmlspecialchars($this->_value); } if (sizeof($this->_childNodes)>0) { foreach ($this->_childNodes as $_node) { $ret .= $_node->asXml(); } } $ret .= "</" . $this->_name . ">"; return $ret; } } 