ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 356 of file inc.xml5compliance.php.

Constructor & Destructor Documentation

◆ __construct()

php4DOMNode::__construct (   $aDomNode)

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

361  {
362  $this->myDOMNode=$aDomNode;
363  }

Member Function Documentation

◆ append_child() [1/2]

php4DOMNode::append_child (   $newnode)

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

301  {
302 //echo "BH";
303  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
304  //{
305  $doc =& $this->myDOMNode->ownerDocument;
306  //echo "<br>BH1:".get_class($newnode).":";
307  $newnode->myDOMNode =& $doc->importNode($newnode->myDOMNode, true);
308  //echo "BH2";
309  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
310  //}
311  //else
312  //{
313  //}
314  }
php4DomElement

◆ append_child() [2/2]

php4DOMNode::append_child (   $newnode)

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

366  {
367 //echo "BH";
368  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
369  //{
370  $doc = $this->myDOMNode->ownerDocument;
371  //echo "<br>BH1:".get_class($newnode).":";
372  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
373  //echo "BH2";
374  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
375  //}
376  //else
377  //{
378  //}
379  }
php4DomElement

◆ append_sibling() [1/2]

php4DOMNode::append_sibling (   $newnode)

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

322  {
323  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
324  }
php4DomElement

◆ append_sibling() [2/2]

php4DOMNode::append_sibling (   $newnode)

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

387  {
388  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
389  }
php4DomElement

◆ attributes() [1/2]

php4DOMNode::attributes ( )

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

References array, and php4DOMAttr\php4DOMAttr().

327  {
328 //echo "<br>node:".$this->myDOMNode->nodeName.":";
329  $myDOMNodeList=$this->myDOMNode->attributes;
330  $nodeSet=array();
331  $i=0;
332  if (is_object($myDOMNodeList))
333  {
334  while ($node=$myDOMNodeList->item($i))
335  {
336  $nodeSet[]=new php4DOMAttr($node);
337  $i++;
338  }
339  }
340 
341  return $nodeSet;
342  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ attributes() [2/2]

php4DOMNode::attributes ( )

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

References array, and php4DOMAttr\php4DOMAttr().

392  {
393 //echo "<br>node:".$this->myDOMNode->nodeName.":";
394  $myDOMNodeList=$this->myDOMNode->attributes;
395  $nodeSet=array();
396  $i=0;
397  if (is_object($myDOMNodeList))
398  {
399  while ($node=$myDOMNodeList->item($i))
400  {
401  $nodeSet[]=new php4DOMAttr($node);
402  $i++;
403  }
404  }
405 
406  return $nodeSet;
407  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ child_nodes() [1/2]

php4DOMNode::child_nodes ( )

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

References array.

345  {
346  $myDOMNodeList=$this->myDOMNode->childNodes;
347  $nodeSet=array();
348  $i=0;
349  while ($node=$myDOMNodeList->item($i))
350  {
351  $nodeSet[]=new php4DOMElement($node);
352  $i++;
353  }
354  return $nodeSet;
355  }
php4DomElement
Create styles array
The data for the language used.

◆ child_nodes() [2/2]

php4DOMNode::child_nodes ( )

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

References array.

Referenced by children().

410  {
411  $myDOMNodeList=$this->myDOMNode->childNodes;
412  $nodeSet=array();
413  $i=0;
414  while ($node=$myDOMNodeList->item($i))
415  {
416  $nodeSet[]=new php4DOMElement($node);
417  $i++;
418  }
419  return $nodeSet;
420  }
php4DomElement
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ children() [1/2]

php4DOMNode::children ( )

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

References child_nodes().

359  {
360 //echo "<br>php4DomNode::children"; flush();
361  return $this->child_nodes();
362  }
+ Here is the call graph for this function:

◆ children() [2/2]

php4DOMNode::children ( )

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

References child_nodes().

424  {
425 //echo "<br>php4DomNode::children"; flush();
426  return $this->child_nodes();
427  }
+ Here is the call graph for this function:

◆ clone_node() [1/2]

php4DOMNode::clone_node (   $deep = false)

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

381  {
382  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
383  }
php4DomElement

◆ clone_node() [2/2]

php4DOMNode::clone_node (   $deep = false)

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

447  {
448  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
449  }
php4DomElement

◆ first_child() [1/2]

php4DOMNode::first_child ( )

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

386  {
387  return new php4DOMElement($this->myDOMNode->firstChild);
388  }
php4DomElement

◆ first_child() [2/2]

php4DOMNode::first_child ( )

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

452  {
453  return new php4DOMElement($this->myDOMNode->firstChild);
454  }
php4DomElement

◆ get_content() [1/2]

php4DOMNode::get_content ( )

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

391  {
392  return $this->myDOMNode->textContent;
393  }

◆ get_content() [2/2]

php4DOMNode::get_content ( )

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

457  {
458  return $this->myDOMNode->textContent;
459  }

◆ has_attributes() [1/2]

php4DOMNode::has_attributes ( )

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

396  {
397  return $this->myDOMNode->hasAttributes();
398  }

◆ has_attributes() [2/2]

php4DOMNode::has_attributes ( )

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

462  {
463  return $this->myDOMNode->hasAttributes();
464  }

◆ has_child_nodes() [1/2]

php4DOMNode::has_child_nodes ( )

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

401  {
402  return $this->myDOMNode->hasChildNodes();
403  }

◆ has_child_nodes() [2/2]

php4DOMNode::has_child_nodes ( )

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

467  {
468  return $this->myDOMNode->hasChildNodes();
469  }

◆ insert_before() [1/2]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

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

References $myDOMNode.

407  {
408  //echo "BH";
409  $doc =& $this->myDOMNode->ownerDocument;
410  $newnode->myDOMNode =& $doc->importNode($newnode->myDOMNode, true);
411 
412  $mydomnode =& $this->myDOMNode;
413  $mynewnode =& $newnode->myDOMNode;
414  $myrefnode =& $refnode->myDOMNode;
415  try
416  {
417  $domel =& $mydomnode->insertBefore($mynewnode,$myrefnode);
418  }
419  catch (DOMException $exception)
420  {
421  // php 4 accepted $this == $refnode -> switch to parent of $this
422  $mydomnode =& $this->myDOMNode->parentNode;
423  $domel =& $mydomnode->insertBefore($mynewnode,$myrefnode);
424  }
425  $el = new php4DOMElement($domel);
426  return $el;
427  }
php4DomElement

◆ insert_before() [2/2]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

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

References $myDOMNode.

473  {
474  //echo "BH";
475  $doc = $this->myDOMNode->ownerDocument;
476  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
477 
478  $mydomnode = $this->myDOMNode;
479  $mynewnode = $newnode->myDOMNode;
480  $myrefnode = $refnode->myDOMNode;
481  try
482  {
483  $domel = $mydomnode->insertBefore($mynewnode,$myrefnode);
484  }
485  catch (DOMException $exception)
486  {
487  // php 4 accepted $this == $refnode -> switch to parent of $this
488  $mydomnode = $this->myDOMNode->parentNode;
489  $domel = $mydomnode->insertBefore($mynewnode,$myrefnode);
490  }
491  $el = new php4DOMElement($domel);
492  return $el;
493  }
php4DomElement

◆ last_child() [1/2]

php4DOMNode::last_child ( )

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

431  {
432  $last =& $this->myDOMNode->lastChild;
433 
434  if (is_object($last))
435  {
436  return new php4DOMElement($last);
437  }
438  else
439  {
440  return false;
441  }
442  }
php4DomElement

◆ last_child() [2/2]

php4DOMNode::last_child ( )

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

497  {
498  $last = $this->myDOMNode->lastChild;
499 
500  if (is_object($last))
501  {
502  return new php4DOMElement($last);
503  }
504  else
505  {
506  return false;
507  }
508  }
php4DomElement

◆ next_sibling() [1/2]

php4DOMNode::next_sibling ( )

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

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

◆ next_sibling() [2/2]

php4DOMNode::next_sibling ( )

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

512  {
513  $next = $this->myDOMNode->nextSibling;
514 
515  if (is_object($next))
516  {
517  return new php4DOMElement($next);
518  }
519  else
520  {
521  return false;
522  }
523  }
php4DomElement

◆ node_name() [1/2]

php4DOMNode::node_name ( )

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

460  {
461  return $this->myDOMNode->nodeName;
462  }

◆ node_name() [2/2]

php4DOMNode::node_name (   $a_local = false)

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

526  {
527  if ($a_local)
528  {
529  return $this->myDOMNode->localName;
530  }
531  else
532  {
533  return $this->myDOMNode->nodeName;
534  }
535  }

◆ node_type() [1/2]

php4DOMNode::node_type ( )

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

465  {
466  return $this->myDOMNode->nodeType;
467  }

◆ node_type() [2/2]

php4DOMNode::node_type ( )

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

538  {
539  return $this->myDOMNode->nodeType;
540  }

◆ node_value() [1/2]

php4DOMNode::node_value ( )

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

470  {
471  return $this->myDOMNode->nodeValue;
472  }

◆ node_value() [2/2]

php4DOMNode::node_value ( )

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

543  {
544  return $this->myDOMNode->nodeValue;
545  }

◆ parent_node() [1/2]

php4DOMNode::parent_node ( )

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

476  {
477  $parent =& $this->myDOMNode->parentNode;
478 
479  if (is_object($parent))
480  {
481  return new php4DOMElement($parent);
482  }
483  else
484  {
485  return false;
486  }
487  }
php4DomElement

◆ parent_node() [2/2]

php4DOMNode::parent_node ( )

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

549  {
550  $parent = $this->myDOMNode->parentNode;
551 
552  if (is_object($parent))
553  {
554  return new php4DOMElement($parent);
555  }
556  else
557  {
558  return false;
559  }
560  }
php4DomElement

◆ php4DOMNode()

php4DOMNode::php4DOMNode (   $aDomNode)

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

Referenced by php4DOMDocument\create_text_node().

296  {
297  $this->myDOMNode=$aDomNode;
298  }
+ Here is the caller graph for this function:

◆ previous_sibling() [1/2]

php4DOMNode::previous_sibling ( )

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

491  {
492  $prev =& $this->myDOMNode->previousSibling;
493 
494  if (is_object($prev))
495  {
496  return new php4DOMElement($prev);
497  }
498  else
499  {
500  return false;
501  }
502  }
php4DomElement

◆ previous_sibling() [2/2]

php4DOMNode::previous_sibling ( )

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

564  {
565  $prev = $this->myDOMNode->previousSibling;
566 
567  if (is_object($prev))
568  {
569  return new php4DOMElement($prev);
570  }
571  else
572  {
573  return false;
574  }
575  }
php4DomElement

◆ remove_child() [1/2]

php4DOMNode::remove_child (   $oldchild)

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

505  {
506  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
507  }
php4DomElement

◆ remove_child() [2/2]

php4DOMNode::remove_child (   $oldchild)

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

578  {
579  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
580  }
php4DomElement

◆ replace_child() [1/2]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

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

510  {
511  return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode,$newnode->myDOMNode));
512  }
php4DomElement

◆ replace_child() [2/2]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

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

583  {
584  return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode,$newnode->myDOMNode));
585  }
php4DomElement

◆ replace_node() [1/2]

php4DOMNode::replace_node (   $newnode)

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

References set_content().

317  {
318  return $this->set_content($newnode->myDOMNode->textContent);
319  }
+ Here is the call graph for this function:

◆ replace_node() [2/2]

php4DOMNode::replace_node (   $newnode)

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

References set_content().

382  {
383  return $this->set_content($newnode->myDOMNode->textContent);
384  }
+ Here is the call graph for this function:

◆ set_content() [1/2]

php4DOMNode::set_content (   $text)

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

References $text.

515  {
516  $this->myDOMNode->textContent = $text;
517  return $this->myDOMNode->textContent;
518  }
$text

◆ set_content() [2/2]

php4DOMNode::set_content (   $text)

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

References $text.

Referenced by replace_node().

588  {
589  $this->myDOMNode->textContent = $text;
590  return $this->myDOMNode->textContent;
591  }
$text
+ Here is the caller graph for this function:

◆ unlink_node() [1/2]

php4DOMNode::unlink_node (   $aDomNode = "")

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

366  {
367  // sometimes the node to unlink is passed
368  if (!is_object($aDomNode))
369  {
370  $aDomNode =& $this;
371  }
372 
373  $parent =& $aDomNode->myDOMNode->parentNode;
374  if (is_object($parent))
375  {
376  $parent->removeChild($aDomNode->myDOMNode);
377  }
378  }

◆ unlink_node() [2/2]

php4DOMNode::unlink_node (   $aDomNode = "")

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

431  {
432  // sometimes the node to unlink is passed
433  if (!is_object($aDomNode))
434  {
435  $aDomNode = $this;
436  //$aDomNode = $this;
437  }
438 
439  $parent = $aDomNode->myDOMNode->parentNode;
440  if (is_object($parent))
441  {
442  $parent->removeChild($aDomNode->myDOMNode);
443  }
444  }

Field Documentation

◆ $myDOMNode

php4DOMNode::$myDOMNode

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

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


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