39 return $xpath_context->query($eval_str);
53 $this->myDOMAttr=$aDOMAttr;
58 return $this->myDOMAttr->name;
63 return $this->myDOMAttr->specified;
68 return $this->myDOMAttr->value;
74 public $myDOMCDATASection;
78 parent::php4DOMNode($aDOMCDATASection);
79 $this->myDOMCDATASection=$aDOMCDATASection;
85 public $myDOMDocument;
92 $this->myDOMDocument->load(
$source);
94 $this->myDOMDocument->loadXML(
$source);
105 unset($this->myDOMDocument);
117 $str = $this->myDOMDocument->saveXML($node->myDOMNode);
124 $ok = $this->myDOMDocument->validate();
133 $myAttr=$this->myDOMDocument->createAttribute(
$name);
134 $myAttr->value=$value;
156 return new php4DOMNode($this->myDOMDocument->createTextNode($content));
166 return $this->myDOMDocument->save(
$filename);
171 return $this->myDOMDocument->saveXML();
176 $myDOMNodeList=$this->myDOMDocument->getElementsByTagName(
$name);
179 while ($node=$myDOMNodeList->item(
$i)) {
189 return $this->myDOMDocument->saveHTML();
200 return $this->myDOMNode->getAttribute(
$name);
205 $myDOMNodeList=$this->myDOMNode->getElementsByTagName(
$name);
208 while ($node=$myDOMNodeList->item(
$i)) {
218 return $this->myDOMNode->hasAttribute(
$name);
223 return $this->myDOMNode->removeAttribute(
$name);
228 return $this->myDOMNode->setAttribute(
$name, $value);
233 return $this->myDOMNode->tagName;
246 $text_node =
new DOMText();
247 $text_node->appendData(
$text);
248 if (is_object($this->myDOMNode->firstChild)) {
249 $this->myDOMNode->replaceChild($text_node, $this->myDOMNode->firstChild);
251 $this->myDOMNode->appendChild($text_node);
258 $text_node =&$this->myDOMNode->firstChild;
260 if (is_object($text_node)) {
261 return $text_node->textContent;
270 parent::unlink_node($aDomNode);
283 $this->myDOMNode=$aDomNode;
291 $doc =&$this->myDOMNode->ownerDocument;
293 $newnode->myDOMNode =&$doc->importNode($newnode->myDOMNode,
true);
295 return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
304 return $this->
set_content($newnode->myDOMNode->textContent);
309 return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
315 $myDOMNodeList=$this->myDOMNode->attributes;
318 if (is_object($myDOMNodeList)) {
319 while ($node=$myDOMNodeList->item(
$i)) {
330 $myDOMNodeList=$this->myDOMNode->childNodes;
333 while ($node=$myDOMNodeList->item(
$i)) {
351 if (!is_object($aDomNode)) {
355 $parent =&$aDomNode->myDOMNode->parentNode;
356 if (is_object($parent)) {
357 $parent->removeChild($aDomNode->myDOMNode);
373 return $this->myDOMNode->textContent;
378 return $this->myDOMNode->hasAttributes();
383 return $this->myDOMNode->hasChildNodes();
390 $doc =&$this->myDOMNode->ownerDocument;
391 $newnode->myDOMNode =&$doc->importNode($newnode->myDOMNode,
true);
394 $mynewnode =&$newnode->myDOMNode;
395 $myrefnode =&$refnode->myDOMNode;
397 $domel =&$mydomnode->insertBefore($mynewnode, $myrefnode);
398 }
catch (DOMException $exception) {
400 $mydomnode =&$this->myDOMNode->parentNode;
401 $domel =&$mydomnode->insertBefore($mynewnode, $myrefnode);
410 $last =&$this->myDOMNode->lastChild;
412 if (is_object($last)) {
422 $next =&$this->myDOMNode->nextSibling;
424 if (is_object($next)) {
433 return $this->myDOMNode->nodeName;
438 return $this->myDOMNode->nodeType;
443 return $this->myDOMNode->nodeValue;
449 $parent =&$this->myDOMNode->parentNode;
451 if (is_object($parent)) {
461 $prev =&$this->myDOMNode->previousSibling;
463 if (is_object($prev)) {
472 return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
477 return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode, $newnode->myDOMNode));
482 $this->myDOMNode->textContent =
$text;
483 return $this->myDOMNode->textContent;
489 public $myDOMNodelist;
494 $this->myDOMNodelist=$aDOMNodelist;
495 $this->nodeset=
array();
497 while ($node=$this->myDOMNodelist->item(
$i)) {
516 $this->myDOMXPath=
new DOMXPath($dom_document->myDOMDocument);
526 return $this->myDOMXPath->registerNamespace($prefix, $namespaceURI);
xpath_register_ns($prefix, $namespaceURI)
set_attribute($name, $value)
xpath_new_context($dom_document)
php4DOMDocument($source, $file=true)
domxml_open_mem($str, $mode=0, &$error=null)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
dump_mem($format=false, $encoding=false)
dump_file($filename, $compressionmode=false, $format=false)
get_elements_by_tagname($name)
create_cdata_section($content)
get_elements_by_tagname($name)
insert_before($newnode, $refnode)
php4DOMNodelist($aDOMNodelist)
unlink_node($aDomNode="")
Create styles array
The data for the language used.
create_attribute($name, $value)
php4DOMXPath($dom_document)
create_text_node($content)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
replace_child($oldnode, $newnode)
domxml_open_file($filename)
php4DOMCDATASection($aDOMCDATASection)