ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
php4DOMNode Class Reference

php4DOMNode More...

+ Inheritance diagram for php4DOMNode:
+ Collaboration diagram for php4DOMNode:

Public Member Functions

 __construct ($aDomNode)
 
 append_child ($newnode)
 
 replace_node ($newnode)
 
 append_sibling ($newnode)
 
 attributes ()
 
 child_nodes ()
 
 children ()
 
 unlink_node ($aDomNode="")
 
 clone_node ($deep=false)
 
 first_child ()
 
 get_content ()
 
 has_attributes ()
 
 has_child_nodes ()
 
 insert_before ($newnode, $refnode)
 
 last_child ()
 
 next_sibling ()
 
 node_name ($a_local=false)
 
 node_type ()
 
 node_value ()
 
 parent_node ()
 
 previous_sibling ()
 
 remove_child ($oldchild)
 
 replace_child ($oldnode, $newnode)
 
 set_content ($text)
 
 php4DOMNode ($aDomNode)
 
 append_child ($newnode)
 
 replace_node ($newnode)
 
 append_sibling ($newnode)
 
 attributes ()
 
 child_nodes ()
 
 children ()
 
 unlink_node ($aDomNode="")
 
 clone_node ($deep=false)
 
 first_child ()
 
 get_content ()
 
 has_attributes ()
 
 has_child_nodes ()
 
 insert_before ($newnode, $refnode)
 
 last_child ()
 
 next_sibling ()
 
 node_name ()
 
 node_type ()
 
 node_value ()
 
 parent_node ()
 
 previous_sibling ()
 
 remove_child ($oldchild)
 
 replace_child ($oldnode, $newnode)
 
 set_content ($text)
 

Data Fields

 $myDOMNode
 

Detailed Description

php4DOMNode

Definition at line 335 of file inc.xml5compliance.php.

Constructor & Destructor Documentation

◆ __construct()

php4DOMNode::__construct (   $aDomNode)

Definition at line 339 of file inc.xml5compliance.php.

340  {
341  $this->myDOMNode = $aDomNode;
342  }

Member Function Documentation

◆ append_child() [1/2]

php4DOMNode::append_child (   $newnode)

Definition at line 286 of file inc.xml5compliance.php.

287  {
288  //echo "BH";
289  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
290  //{
291  $doc = &$this->myDOMNode->ownerDocument;
292  //echo "<br>BH1:".get_class($newnode).":";
293  $newnode->myDOMNode = &$doc->importNode($newnode->myDOMNode, true);
294  //echo "BH2";
295  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
296  //}
297  //else
298  //{
299  //}
300  }
php4DomElement

◆ append_child() [2/2]

php4DOMNode::append_child (   $newnode)

Definition at line 344 of file inc.xml5compliance.php.

345  {
346  //echo "BH";
347  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
348  //{
349  $doc = $this->myDOMNode->ownerDocument;
350  //echo "<br>BH1:".get_class($newnode).":";
351  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
352  //echo "BH2";
353  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
354  //}
355  //else
356  //{
357  //}
358  }
php4DomElement

◆ append_sibling() [1/2]

php4DOMNode::append_sibling (   $newnode)

Definition at line 307 of file inc.xml5compliance.php.

308  {
309  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
310  }
php4DomElement

◆ append_sibling() [2/2]

php4DOMNode::append_sibling (   $newnode)

Definition at line 365 of file inc.xml5compliance.php.

366  {
367  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
368  }
php4DomElement

◆ attributes() [1/2]

php4DOMNode::attributes ( )

Definition at line 312 of file inc.xml5compliance.php.

References $i, and php4DOMAttr\php4DOMAttr().

313  {
314  //echo "<br>node:".$this->myDOMNode->nodeName.":";
315  $myDOMNodeList = $this->myDOMNode->attributes;
316  $nodeSet = array();
317  $i = 0;
318  if (is_object($myDOMNodeList)) {
319  while ($node = $myDOMNodeList->item($i)) {
320  $nodeSet[] = new php4DOMAttr($node);
321  $i++;
322  }
323  }
324 
325  return $nodeSet;
326  }
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ attributes() [2/2]

php4DOMNode::attributes ( )

Definition at line 370 of file inc.xml5compliance.php.

References $i, and php4DOMAttr\php4DOMAttr().

371  {
372  //echo "<br>node:".$this->myDOMNode->nodeName.":";
373  $myDOMNodeList = $this->myDOMNode->attributes;
374  $nodeSet = array();
375  $i = 0;
376  if (is_object($myDOMNodeList)) {
377  while ($node = $myDOMNodeList->item($i)) {
378  $nodeSet[] = new php4DOMAttr($node);
379  $i++;
380  }
381  }
382 
383  return $nodeSet;
384  }
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ child_nodes() [1/2]

php4DOMNode::child_nodes ( )

Definition at line 328 of file inc.xml5compliance.php.

References $i.

329  {
330  $myDOMNodeList = $this->myDOMNode->childNodes;
331  $nodeSet = array();
332  $i = 0;
333  while ($node = $myDOMNodeList->item($i)) {
334  $nodeSet[] = new php4DOMElement($node);
335  $i++;
336  }
337  return $nodeSet;
338  }
php4DomElement
$i
Definition: disco.tpl.php:19

◆ child_nodes() [2/2]

php4DOMNode::child_nodes ( )

Definition at line 386 of file inc.xml5compliance.php.

References $i.

Referenced by children().

387  {
388  $myDOMNodeList = $this->myDOMNode->childNodes;
389  $nodeSet = array();
390  $i = 0;
391  while ($node = $myDOMNodeList->item($i)) {
392  $nodeSet[] = new php4DOMElement($node);
393  $i++;
394  }
395  return $nodeSet;
396  }
php4DomElement
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ children() [1/2]

php4DOMNode::children ( )

Definition at line 341 of file inc.xml5compliance.php.

References child_nodes().

342  {
343  //echo "<br>php4DomNode::children"; flush();
344  return $this->child_nodes();
345  }
+ Here is the call graph for this function:

◆ children() [2/2]

php4DOMNode::children ( )

Definition at line 399 of file inc.xml5compliance.php.

References child_nodes().

400  {
401  //echo "<br>php4DomNode::children"; flush();
402  return $this->child_nodes();
403  }
+ Here is the call graph for this function:

◆ clone_node() [1/2]

php4DOMNode::clone_node (   $deep = false)

Definition at line 361 of file inc.xml5compliance.php.

362  {
363  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
364  }
php4DomElement

◆ clone_node() [2/2]

php4DOMNode::clone_node (   $deep = false)

Definition at line 420 of file inc.xml5compliance.php.

421  {
422  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
423  }
php4DomElement

◆ first_child() [1/2]

php4DOMNode::first_child ( )

Definition at line 366 of file inc.xml5compliance.php.

367  {
368  return new php4DOMElement($this->myDOMNode->firstChild);
369  }
php4DomElement

◆ first_child() [2/2]

php4DOMNode::first_child ( )

Definition at line 425 of file inc.xml5compliance.php.

426  {
427  return new php4DOMElement($this->myDOMNode->firstChild);
428  }
php4DomElement

◆ get_content() [1/2]

php4DOMNode::get_content ( )

Definition at line 371 of file inc.xml5compliance.php.

372  {
373  return $this->myDOMNode->textContent;
374  }

◆ get_content() [2/2]

php4DOMNode::get_content ( )

Definition at line 430 of file inc.xml5compliance.php.

431  {
432  return $this->myDOMNode->textContent;
433  }

◆ has_attributes() [1/2]

php4DOMNode::has_attributes ( )

Definition at line 376 of file inc.xml5compliance.php.

377  {
378  return $this->myDOMNode->hasAttributes();
379  }

◆ has_attributes() [2/2]

php4DOMNode::has_attributes ( )

Definition at line 435 of file inc.xml5compliance.php.

436  {
437  return $this->myDOMNode->hasAttributes();
438  }

◆ has_child_nodes() [1/2]

php4DOMNode::has_child_nodes ( )

Definition at line 381 of file inc.xml5compliance.php.

382  {
383  return $this->myDOMNode->hasChildNodes();
384  }

◆ has_child_nodes() [2/2]

php4DOMNode::has_child_nodes ( )

Definition at line 440 of file inc.xml5compliance.php.

441  {
442  return $this->myDOMNode->hasChildNodes();
443  }

◆ insert_before() [1/2]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

Definition at line 387 of file inc.xml5compliance.php.

References $myDOMNode.

388  {
389  //echo "BH";
390  $doc = &$this->myDOMNode->ownerDocument;
391  $newnode->myDOMNode = &$doc->importNode($newnode->myDOMNode, true);
392 
393  $mydomnode = &$this->myDOMNode;
394  $mynewnode = &$newnode->myDOMNode;
395  $myrefnode = &$refnode->myDOMNode;
396  try {
397  $domel = &$mydomnode->insertBefore($mynewnode, $myrefnode);
398  } catch (DOMException $exception) {
399  // php 4 accepted $this == $refnode -> switch to parent of $this
400  $mydomnode = &$this->myDOMNode->parentNode;
401  $domel = &$mydomnode->insertBefore($mynewnode, $myrefnode);
402  }
403  $el = new php4DOMElement($domel);
404  return $el;
405  }
php4DomElement

◆ insert_before() [2/2]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

Definition at line 446 of file inc.xml5compliance.php.

References $myDOMNode.

447  {
448  //echo "BH";
449  $doc = $this->myDOMNode->ownerDocument;
450  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
451 
452  $mydomnode = $this->myDOMNode;
453  $mynewnode = $newnode->myDOMNode;
454  $myrefnode = $refnode->myDOMNode;
455  try {
456  $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
457  } catch (DOMException $exception) {
458  // php 4 accepted $this == $refnode -> switch to parent of $this
459  $mydomnode = $this->myDOMNode->parentNode;
460  $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
461  }
462  $el = new php4DOMElement($domel);
463  return $el;
464  }
php4DomElement

◆ last_child() [1/2]

php4DOMNode::last_child ( )

Definition at line 408 of file inc.xml5compliance.php.

409  {
410  $last = &$this->myDOMNode->lastChild;
411 
412  if (is_object($last)) {
413  return new php4DOMElement($last);
414  } else {
415  return false;
416  }
417  }
php4DomElement

◆ last_child() [2/2]

php4DOMNode::last_child ( )

Definition at line 467 of file inc.xml5compliance.php.

468  {
469  $last = $this->myDOMNode->lastChild;
470 
471  if (is_object($last)) {
472  return new php4DOMElement($last);
473  } else {
474  return false;
475  }
476  }
php4DomElement

◆ next_sibling() [1/2]

php4DOMNode::next_sibling ( )

Definition at line 420 of file inc.xml5compliance.php.

421  {
422  $next = &$this->myDOMNode->nextSibling;
423 
424  if (is_object($next)) {
425  return new php4DOMElement($next);
426  } else {
427  return false;
428  }
429  }
php4DomElement

◆ next_sibling() [2/2]

php4DOMNode::next_sibling ( )

Definition at line 479 of file inc.xml5compliance.php.

480  {
481  $next = $this->myDOMNode->nextSibling;
482 
483  if (is_object($next)) {
484  return new php4DOMElement($next);
485  } else {
486  return false;
487  }
488  }
php4DomElement

◆ node_name() [1/2]

php4DOMNode::node_name ( )

Definition at line 431 of file inc.xml5compliance.php.

432  {
433  return $this->myDOMNode->nodeName;
434  }

◆ node_name() [2/2]

php4DOMNode::node_name (   $a_local = false)

Definition at line 490 of file inc.xml5compliance.php.

491  {
492  if ($a_local) {
493  return $this->myDOMNode->localName;
494  } else {
495  return $this->myDOMNode->nodeName;
496  }
497  }

◆ node_type() [1/2]

php4DOMNode::node_type ( )

Definition at line 436 of file inc.xml5compliance.php.

437  {
438  return $this->myDOMNode->nodeType;
439  }

◆ node_type() [2/2]

php4DOMNode::node_type ( )

Definition at line 499 of file inc.xml5compliance.php.

500  {
501  return $this->myDOMNode->nodeType;
502  }

◆ node_value() [1/2]

php4DOMNode::node_value ( )

Definition at line 441 of file inc.xml5compliance.php.

442  {
443  return $this->myDOMNode->nodeValue;
444  }

◆ node_value() [2/2]

php4DOMNode::node_value ( )

Definition at line 504 of file inc.xml5compliance.php.

505  {
506  return $this->myDOMNode->nodeValue;
507  }

◆ parent_node() [1/2]

php4DOMNode::parent_node ( )

Definition at line 447 of file inc.xml5compliance.php.

448  {
449  $parent = &$this->myDOMNode->parentNode;
450 
451  if (is_object($parent)) {
452  return new php4DOMElement($parent);
453  } else {
454  return false;
455  }
456  }
php4DomElement

◆ parent_node() [2/2]

php4DOMNode::parent_node ( )

Definition at line 510 of file inc.xml5compliance.php.

511  {
512  $parent = $this->myDOMNode->parentNode;
513 
514  if (is_object($parent)) {
515  return new php4DOMElement($parent);
516  } else {
517  return false;
518  }
519  }
php4DomElement

◆ php4DOMNode()

php4DOMNode::php4DOMNode (   $aDomNode)

Definition at line 281 of file inc.xml5compliance.php.

Referenced by php4DOMDocument\create_text_node().

282  {
283  $this->myDOMNode = $aDomNode;
284  }
+ Here is the caller graph for this function:

◆ previous_sibling() [1/2]

php4DOMNode::previous_sibling ( )

Definition at line 459 of file inc.xml5compliance.php.

460  {
461  $prev = &$this->myDOMNode->previousSibling;
462 
463  if (is_object($prev)) {
464  return new php4DOMElement($prev);
465  } else {
466  return false;
467  }
468  }
php4DomElement

◆ previous_sibling() [2/2]

php4DOMNode::previous_sibling ( )

Definition at line 522 of file inc.xml5compliance.php.

523  {
524  $prev = $this->myDOMNode->previousSibling;
525 
526  if (is_object($prev)) {
527  return new php4DOMElement($prev);
528  } else {
529  return false;
530  }
531  }
php4DomElement

◆ remove_child() [1/2]

php4DOMNode::remove_child (   $oldchild)

Definition at line 470 of file inc.xml5compliance.php.

471  {
472  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
473  }
php4DomElement

◆ remove_child() [2/2]

php4DOMNode::remove_child (   $oldchild)

Definition at line 533 of file inc.xml5compliance.php.

534  {
535  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
536  }
php4DomElement

◆ replace_child() [1/2]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

Definition at line 475 of file inc.xml5compliance.php.

476  {
477  return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode, $newnode->myDOMNode));
478  }
php4DomElement

◆ replace_child() [2/2]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

Definition at line 538 of file inc.xml5compliance.php.

539  {
540  return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode, $newnode->myDOMNode));
541  }
php4DomElement

◆ replace_node() [1/2]

php4DOMNode::replace_node (   $newnode)

Definition at line 302 of file inc.xml5compliance.php.

References set_content().

303  {
304  return $this->set_content($newnode->myDOMNode->textContent);
305  }
+ Here is the call graph for this function:

◆ replace_node() [2/2]

php4DOMNode::replace_node (   $newnode)

Definition at line 360 of file inc.xml5compliance.php.

References set_content().

361  {
362  return $this->set_content($newnode->myDOMNode->textContent);
363  }
+ Here is the call graph for this function:

◆ set_content() [1/2]

php4DOMNode::set_content (   $text)

Definition at line 480 of file inc.xml5compliance.php.

References $text.

481  {
482  $this->myDOMNode->textContent = $text;
483  return $this->myDOMNode->textContent;
484  }
$text
Definition: errorreport.php:18

◆ set_content() [2/2]

php4DOMNode::set_content (   $text)

Definition at line 543 of file inc.xml5compliance.php.

References $text.

Referenced by replace_node().

544  {
545  $this->myDOMNode->textContent = $text;
546  return $this->myDOMNode->textContent;
547  }
$text
Definition: errorreport.php:18
+ Here is the caller graph for this function:

◆ unlink_node() [1/2]

php4DOMNode::unlink_node (   $aDomNode = "")

Definition at line 348 of file inc.xml5compliance.php.

349  {
350  // sometimes the node to unlink is passed
351  if (!is_object($aDomNode)) {
352  $aDomNode = &$this;
353  }
354 
355  $parent = &$aDomNode->myDOMNode->parentNode;
356  if (is_object($parent)) {
357  $parent->removeChild($aDomNode->myDOMNode);
358  }
359  }

◆ unlink_node() [2/2]

php4DOMNode::unlink_node (   $aDomNode = "")

Definition at line 406 of file inc.xml5compliance.php.

407  {
408  // sometimes the node to unlink is passed
409  if (!is_object($aDomNode)) {
410  $aDomNode = $this;
411  //$aDomNode = $this;
412  }
413 
414  $parent = $aDomNode->myDOMNode->parentNode;
415  if (is_object($parent)) {
416  $parent->removeChild($aDomNode->myDOMNode);
417  }
418  }

Field Documentation

◆ $myDOMNode

php4DOMNode::$myDOMNode

Definition at line 337 of file inc.xml5compliance.php.

Referenced by insert_before(), and php4DOMElement\unlink().


The documentation for this class was generated from the following file: