git-svn-id: svn://netflint.net/xmpphp@14 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy
2008-04-04 07:19:17 +00:00
parent 8478473813
commit aba0b3f7e7
2 changed files with 72 additions and 22 deletions

View File

@@ -45,6 +45,23 @@ class XMLObj {
}
}
function tostring($str='') {
$str .= "<{$this->name} xmlns='{$this->ns}' ";
foreach($this->attrs as $key => $value) {
if($key != 'xmlns') {
$value = htmlentities($value);
$str .= "$key='$value' ";
}
}
$str .= ">";
foreach($this->subs as $sub) {
$str .= $sub->tostring();
}
$body = htmlentities($this->data);
$str .= "$body</{$this->name}>";
return $str;
}
function hassub($name) {
foreach($this->subs as $sub) {
if($sub->name == $name) return True;