formatOutput = $_CONF['debug']; if ($namespace == NULL) { $node = $this->createElement($name); } else { $this->Namespace = $namespace; $name = $namespace . ':' . $name; if ($namespace_uri == NULL) { if (array_key_exists($namespace, $_CONF['namespaces'])) $this->NamespaceURI = $_CONF['namespaces'][$namespace]; else $this->NamespaceURI = $_CONF['namespaces']['exhibition'] . $namespace; } else { $this->NamespaceURI = $namespace_uri; } $node = $this->createElementNS($this->NamespaceURI, $name); } $this->appendChild($node); if ($value != NULL) $this->SetValue($value); } public function ForkChild($name, $value=NULL) { return new XMLement($name, $value, $this->Namespace); } public function SetValue($value) { $old = $this->ValueNode; $this->ValueNode = $this->createTextNode((string)$value); if ($this->ValueNode == false) return false; if ($old != NULL) $this->removeChild($this->firstChild); $this->firstChild->appendChild($this->ValueNode); } public function SetAttribute($name, $value) { $this->firstChild->setAttribute($name, $value); } public function AddElement($name, $value) { if ($this->Namespace == NULL) $this->AddChild(new XMLement($name, $value)); else $this->AddChild(new XMLement($name, $value, $this->Namespace)); } public function AddChild($child) { $node = $this->importNode($child->firstChild, true); $this->firstChild->appendChild($node); } public function Render() { return $this->saveXML(); } } ?>