foreach($tmpIds as $tkey=>$tid)
{
if(strpos($key, $name)==0)
{
$id = $tid;
break;
}
}
}
return $rootNodeObj->getNodeById($id);
}
}
public function findNodeByPath($path)
{
$pos = strpos($path, '|');
if($pos<=0)
{
return $this->getNode($path);
}
else
{
$tmpObj = $this->getNode(substr($path, 0,
$pos));
return is_object($tmpObj)?
$tmpObj->findNodeByPath(substr($path,
$pos+1)):
null;
}
}
public function getSaveData()
{
$data = $this->values;
if(sizeof($this->attributes)>0)
$data[attrs] = $this->attributes;
$nodeList = $this->getNode();
if($nodeList==null)
return $data;
foreach($nodeList as $key=>$node)
{
$data[$key] = $node->getSaveData();
}
return $data;
}
public function getSaveXml($level=0)
{
$prefixSpace
= str_pad("",
$level, "\t");
$str = "$prefixSpace<$this->nodeTag";
foreach($this->attributes as $key=>$value)
$str .= " $key=\"$value\"";
$str .= ">\r\n";
foreach($this->values as $key=>$value){
if(is_array($value))
{
$str .= "$prefixSpace\t<$key";
foreach($value[attrs] as $attkey=>$attvalue)
$str .= " $attkey=\"$attvalue\"";
$tmpStr = $value[value];
}
else