ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
php4DOMNode Class Reference

php4DOMNode More...

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

Public Member Functions

 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 ($a_local=false)
 
 node_type ()
 
 node_value ()
 
 parent_node ()
 
 previous_sibling ()
 
 remove_child ($oldchild)
 
 replace_child ($oldnode, $newnode)
 
 set_content ($text)
 
 php4DOMNode ($aDomNode, $aOwnerDocument)
 
 __get ($name)
 
 add_child ($newnode)
 
 add_namespace ($uri, $prefix)
 
 append_child ($newnode)
 
 append_sibling ($newnode)
 
 attributes ()
 
 child_nodes ()
 
 children ()
 
 clone_node ($deep=false)
 
 dump_node ($node=null)
 
 first_child ()
 
 get_content ()
 
 has_attributes ()
 
 has_child_nodes ()
 
 insert_before ($newnode, $refnode)
 
 is_blank_node ()
 
 last_child ()
 
 new_child ($name, $content)
 
 next_sibling ()
 
 node_name ()
 
 node_type ()
 
 node_value ()
 
 owner_document ()
 
 parent_node ()
 
 prefix ()
 
 previous_sibling ()
 
 remove_child ($oldchild)
 
 replace_child ($newnode, $oldnode)
 
 replace_node ($newnode)
 
 set_content ($text)
 
 set_namespace ($uri, $prefix=null)
 
 unlink_node ()
 
 php4DOMNode ($aDomNode, $aOwnerDocument)
 
 __get ($name)
 
 append_child ($newnode)
 
 append_sibling ($newnode)
 
 attributes ()
 
 child_nodes ()
 
 children ()
 
 clone_node ($deep=false)
 
 first_child ()
 
 get_content ()
 
 has_attributes ()
 
 has_child_nodes ()
 
 insert_before ($newnode, $refnode)
 
 is_blank_node ()
 
 last_child ()
 
 new_child ($name, $content)
 
 next_sibling ()
 
 node_name ()
 
 node_type ()
 
 node_value ()
 
 owner_document ()
 
 parent_node ()
 
 prefix ()
 
 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)
 

Static Public Member Functions

static _newDOMElement ($aDOMNode, $aOwnerDocument)
 

Data Fields

 $myDOMNode
 
 $myOwnerDocument
 

Protected Member Functions

 _importNode ($newnode)
 

Detailed Description

php4DOMNode

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

Member Function Documentation

◆ __get() [1/2]

php4DOMNode::__get (   $name)

Definition at line 249 of file domxml-php4-to-php5.php.

250  {
251  switch ($name)
252  {
253  case 'type': return $this->myDOMNode->nodeType;
254  case 'tagname': return ($this->myDOMNode->nodeType===XML_ELEMENT_NODE) ? $this->myDOMNode->localName : $this->myDOMNode->tagName; //Avoid namespace prefix for DOMElement
255  case 'content': return $this->myDOMNode->textContent;
256  case 'value': return $this->myDOMNode->value;
257  default:
258  $myErrors=debug_backtrace();
259  trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
260  return false;
261  }
262  }

◆ __get() [2/2]

php4DOMNode::__get (   $name)

Definition at line 257 of file domxml-php4-php5.php.

258  {
259 echo "-U";
260  if ($name=='type') return $this->myDOMNode->nodeType;
261  elseif ($name=='tagname') return $this->myDOMNode->tagName;
262  elseif ($name=='content') return $this->myDOMNode->textContent;
263  else
264  {
265  $myErrors=debug_backtrace();
266  trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE);
267  return false;
268  }
269  }
if( $out) else

◆ _importNode()

php4DOMNode::_importNode (   $newnode)
protected

Definition at line 363 of file domxml-php4-to-php5.php.

363 {return $this->myOwnerDocument===$newnode->myOwnerDocument ? $newnode->myDOMNode : $this->myOwnerDocument->myDOMNode->importNode($newnode->myDOMNode,true);} //To import DOMNode from another DOMDocument

◆ _newDOMElement()

static php4DOMNode::_newDOMElement (   $aDOMNode,
  $aOwnerDocument 
)
static

Definition at line 364 of file domxml-php4-to-php5.php.

References php4DOMAttr\php4DOMAttr(), and php4DOMNode().

Referenced by php4DOMNodelist\php4DOMNodelist().

365  {//Check the PHP5 DOMNode before creating a new associated PHP4 DOMNode wrapper
366  if ($aDOMNode==null) return null;
367  switch ($aDOMNode->nodeType)
368  {
369  case XML_ELEMENT_NODE: return new php4DOMElement($aDOMNode,$aOwnerDocument);
370  case XML_TEXT_NODE: return new php4DOMText($aDOMNode,$aOwnerDocument);
371  case XML_ATTRIBUTE_NODE: return new php4DOMAttr($aDOMNode,$aOwnerDocument);
372  case XML_PI_NODE: return new php4DomProcessingInstruction($aDOMNode,$aOwnerDocument);
373  default: return new php4DOMNode($aDOMNode,$aOwnerDocument);
374  }
375  }
php4DomElement
php4DOMNode($aDomNode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_child()

php4DOMNode::add_child (   $newnode)

Definition at line 263 of file domxml-php4-to-php5.php.

References append_child().

263 {return append_child($newnode);}
append_child($newnode)
+ Here is the call graph for this function:

◆ add_namespace()

php4DOMNode::add_namespace (   $uri,
  $prefix 
)

Definition at line 264 of file domxml-php4-to-php5.php.

264 {return false;}

◆ append_child() [1/4]

php4DOMNode::append_child (   $newnode)

Definition at line 265 of file domxml-php4-to-php5.php.

265 {return self::_newDOMElement($this->myDOMNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);}

◆ append_child() [2/4]

php4DOMNode::append_child (   $newnode)

Definition at line 271 of file domxml-php4-php5.php.

References $myOwnerDocument.

272  {
273 echo "-V";
274  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);
275  }
php4DomElement

◆ append_child() [3/4]

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() [4/4]

php4DOMNode::append_child (   $newnode)

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

Referenced by add_child().

361  {
362 //echo "BH";
363  //if (strtolower(get_class($newnode)) != "php4domcdatasection")
364  //{
365  $doc = $this->myDOMNode->ownerDocument;
366  //echo "<br>BH1:".get_class($newnode).":";
367  $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, true);
368  //echo "BH2";
369  return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
370  //}
371  //else
372  //{
373  //}
374  }
php4DomElement
+ Here is the caller graph for this function:

◆ append_sibling() [1/4]

php4DOMNode::append_sibling (   $newnode)

Definition at line 266 of file domxml-php4-to-php5.php.

266 {return self::_newDOMElement($this->myDOMNode->parentNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);}

◆ append_sibling() [2/4]

php4DOMNode::append_sibling (   $newnode)

Definition at line 277 of file domxml-php4-php5.php.

References $myOwnerDocument.

278  {
279 echo "-W";
280  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode),$this->myOwnerDocument);
281  }
php4DomElement

◆ append_sibling() [3/4]

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() [4/4]

php4DOMNode::append_sibling (   $newnode)

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

382  {
383  return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
384  }
php4DomElement

◆ attributes() [1/4]

php4DOMNode::attributes ( )

Definition at line 267 of file domxml-php4-to-php5.php.

References php4DOMAttr\php4DOMAttr().

268  {
269  $myDOMNodeList=$this->myDOMNode->attributes;
270  if (!(isset($myDOMNodeList)&&$this->myDOMNode->hasAttributes())) return null;
271  $nodeSet=array();
272  $i=0;
273  while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument);
274  return $nodeSet;
275  }
+ Here is the call graph for this function:

◆ attributes() [2/4]

php4DOMNode::attributes ( )

Definition at line 283 of file domxml-php4-php5.php.

References php4DOMAttr\php4DOMAttr().

284  {
285 echo "-X";
286  $myDOMNodeList=$this->myDOMNode->attributes;
287  $nodeSet=array();
288  $i=0;
289  if (isset($myDOMNodeList))
290  while ($node=$myDOMNodeList->item($i))
291  {
292  $nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument);
293  $i++;
294  }
295  return $nodeSet;
296  }
+ Here is the call graph for this function:

◆ attributes() [3/4]

php4DOMNode::attributes ( )

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

References 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  }
+ Here is the call graph for this function:

◆ attributes() [4/4]

php4DOMNode::attributes ( )

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

References php4DOMAttr\php4DOMAttr().

387  {
388 //echo "<br>node:".$this->myDOMNode->nodeName.":";
389  $myDOMNodeList=$this->myDOMNode->attributes;
390  $nodeSet=array();
391  $i=0;
392  if (is_object($myDOMNodeList))
393  {
394  while ($node=$myDOMNodeList->item($i))
395  {
396  $nodeSet[]=new php4DOMAttr($node);
397  $i++;
398  }
399  }
400 
401  return $nodeSet;
402  }
+ Here is the call graph for this function:

◆ child_nodes() [1/4]

php4DOMNode::child_nodes ( )

Definition at line 276 of file domxml-php4-to-php5.php.

277  {
278  $myDOMNodeList=$this->myDOMNode->childNodes;
279  $nodeSet=array();
280  $i=0;
281  if (isset($myDOMNodeList))
282  while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=self::_newDOMElement($node,$this->myOwnerDocument);
283  return $nodeSet;
284  }

◆ child_nodes() [2/4]

php4DOMNode::child_nodes ( )

Definition at line 298 of file domxml-php4-php5.php.

299  {
300 echo "-Y";
301  $myDOMNodeList=$this->myDOMNode->childNodes;
302  $nodeSet=array();
303  $i=0;
304  if (isset($myDOMNodeList))
305  while ($node=$myDOMNodeList->item($i))
306  {
307  $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
308  $i++;
309  }
310  return $nodeSet;
311  }
php4DomElement

◆ child_nodes() [3/4]

php4DOMNode::child_nodes ( )

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

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

◆ child_nodes() [4/4]

php4DOMNode::child_nodes ( )

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

Referenced by children().

405  {
406  $myDOMNodeList=$this->myDOMNode->childNodes;
407  $nodeSet=array();
408  $i=0;
409  while ($node=$myDOMNodeList->item($i))
410  {
411  $nodeSet[]=new php4DOMElement($node);
412  $i++;
413  }
414  return $nodeSet;
415  }
php4DomElement
+ Here is the caller graph for this function:

◆ children() [1/4]

php4DOMNode::children ( )

Definition at line 285 of file domxml-php4-to-php5.php.

References child_nodes().

285 {return $this->child_nodes();}
+ Here is the call graph for this function:

◆ children() [2/4]

php4DOMNode::children ( )

Definition at line 313 of file domxml-php4-php5.php.

References child_nodes().

313  {
314 echo "-Z";
315  return $this->child_nodes();
316  }
+ Here is the call graph for this function:

◆ children() [3/4]

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() [4/4]

php4DOMNode::children ( )

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

References child_nodes().

419  {
420 //echo "<br>php4DomNode::children"; flush();
421  return $this->child_nodes();
422  }
+ Here is the call graph for this function:

◆ clone_node() [1/4]

php4DOMNode::clone_node (   $deep = false)

Definition at line 286 of file domxml-php4-to-php5.php.

References $myOwnerDocument.

286 {return self::_newDOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);}

◆ clone_node() [2/4]

php4DOMNode::clone_node (   $deep = false)

Definition at line 318 of file domxml-php4-php5.php.

References $myOwnerDocument.

318  {
319 echo "-a";
320  return new php4DOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);
321  }
php4DomElement

◆ clone_node() [3/4]

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() [4/4]

php4DOMNode::clone_node (   $deep = false)

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

442  {
443  return new php4DOMElement($this->myDOMNode->cloneNode($deep));
444  }
php4DomElement

◆ dump_node()

php4DOMNode::dump_node (   $node = null)

Definition at line 288 of file domxml-php4-to-php5.php.

288 {return $node==null ? $this->myOwnerDocument->myDOMNode->saveXML($this->myDOMNode) : $this->myOwnerDocument->myDOMNode->saveXML($node->myDOMNode);}

◆ first_child() [1/4]

php4DOMNode::first_child ( )

Definition at line 289 of file domxml-php4-to-php5.php.

289 {return self::_newDOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);}

◆ first_child() [2/4]

php4DOMNode::first_child ( )

Definition at line 323 of file domxml-php4-php5.php.

323  {
324 echo "-b";
325  return new php4DOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);
326  }
php4DomElement

◆ first_child() [3/4]

php4DOMNode::first_child ( )

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

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

◆ first_child() [4/4]

php4DOMNode::first_child ( )

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

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

◆ get_content() [1/4]

php4DOMNode::get_content ( )

Definition at line 290 of file domxml-php4-to-php5.php.

290 {return $this->myDOMNode->textContent;}

◆ get_content() [2/4]

php4DOMNode::get_content ( )

Definition at line 327 of file domxml-php4-php5.php.

327  {
328 echo "-c";
329  return $this->myDOMNode->textContent;
330  }

◆ get_content() [3/4]

php4DOMNode::get_content ( )

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

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

◆ get_content() [4/4]

php4DOMNode::get_content ( )

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

452  {
453  return $this->myDOMNode->textContent;
454  }

◆ has_attributes() [1/4]

php4DOMNode::has_attributes ( )

Definition at line 291 of file domxml-php4-to-php5.php.

291 {return $this->myDOMNode->hasAttributes();}

◆ has_attributes() [2/4]

php4DOMNode::has_attributes ( )

Definition at line 332 of file domxml-php4-php5.php.

332  {
333 echo "-d";
334  return $this->myDOMNode->hasAttributes();
335  }

◆ has_attributes() [3/4]

php4DOMNode::has_attributes ( )

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

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

◆ has_attributes() [4/4]

php4DOMNode::has_attributes ( )

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

457  {
458  return $this->myDOMNode->hasAttributes();
459  }

◆ has_child_nodes() [1/4]

php4DOMNode::has_child_nodes ( )

Definition at line 292 of file domxml-php4-to-php5.php.

292 {return $this->myDOMNode->hasChildNodes();}

◆ has_child_nodes() [2/4]

php4DOMNode::has_child_nodes ( )

Definition at line 336 of file domxml-php4-php5.php.

337  {
338 echo "-e";
339  return $this->myDOMNode->hasChildNodes();
340  }

◆ has_child_nodes() [3/4]

php4DOMNode::has_child_nodes ( )

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

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

◆ has_child_nodes() [4/4]

php4DOMNode::has_child_nodes ( )

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

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

◆ insert_before() [1/4]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

Definition at line 293 of file domxml-php4-to-php5.php.

293 {return self::_newDOMElement($this->myDOMNode->insertBefore($this->_importNode($newnode),$refnode==null?null:$refnode->myDOMNode),$this->myOwnerDocument);}

◆ insert_before() [2/4]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

Definition at line 341 of file domxml-php4-php5.php.

References $myOwnerDocument.

342  {
343 echo "-f";
344  return new php4DOMElement($this->myDOMNode->insertBefore($newnode->myDOMNode,$refnode->myDOMNode),$this->myOwnerDocument);
345  }
php4DomElement

◆ insert_before() [3/4]

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() [4/4]

php4DOMNode::insert_before (   $newnode,
  $refnode 
)

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

References $myDOMNode.

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

◆ is_blank_node() [1/2]

php4DOMNode::is_blank_node ( )

Definition at line 294 of file domxml-php4-to-php5.php.

294 {return ($this->myDOMNode->nodeType===XML_TEXT_NODE)&&preg_match('%^\s*$%',$this->myDOMNode->nodeValue);}

◆ is_blank_node() [2/2]

php4DOMNode::is_blank_node ( )

Definition at line 347 of file domxml-php4-php5.php.

348  {
349 echo "-g";
350  $myDOMNodeList=$this->myDOMNode->childNodes;
351  $i=0;
352  if (isset($myDOMNodeList))
353  while ($node=$myDOMNodeList->item($i))
354  {
355  if (($node->nodeType==XML_ELEMENT_NODE)||
356  (($node->nodeType==XML_TEXT_NODE)&&!ereg('^([[:cntrl:]]|[[:space:]])*$',$node->nodeValue)))
357  return false;
358  $i++;
359  }
360  return true;
361  }

◆ last_child() [1/4]

php4DOMNode::last_child ( )

Definition at line 295 of file domxml-php4-to-php5.php.

295 {return self::_newDOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);}

◆ last_child() [2/4]

php4DOMNode::last_child ( )

Definition at line 363 of file domxml-php4-php5.php.

363  {
364 echo "-h";
365  return new php4DOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);
366  }
php4DomElement

◆ last_child() [3/4]

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() [4/4]

php4DOMNode::last_child ( )

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

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

◆ new_child() [1/2]

php4DOMNode::new_child (   $name,
  $content 
)

Definition at line 296 of file domxml-php4-to-php5.php.

References _entityDecode().

297  {
298  $mySubNode=$this->myDOMNode->ownerDocument->createElement($name);
299  $mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode(_entityDecode($content)));
300  $this->myDOMNode->appendChild($mySubNode);
301  return new php4DOMElement($mySubNode,$this->myOwnerDocument);
302  }
php4DomElement
_entityDecode($text)
+ Here is the call graph for this function:

◆ new_child() [2/2]

php4DOMNode::new_child (   $name,
  $content 
)

Definition at line 368 of file domxml-php4-php5.php.

369  {
370 echo "-i";
371  $mySubNode=$this->myDOMNode->ownerDocument->createElement($name);
372  $mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($content));
373  $this->myDOMNode->appendChild($mySubNode);
374  return new php4DOMElement($mySubNode,$this->myOwnerDocument);
375  }
php4DomElement

◆ next_sibling() [1/4]

php4DOMNode::next_sibling ( )

Definition at line 303 of file domxml-php4-to-php5.php.

303 {return self::_newDOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);}

◆ next_sibling() [2/4]

php4DOMNode::next_sibling ( )

Definition at line 377 of file domxml-php4-php5.php.

377  {
378 echo "-j";
379  return new php4DOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);
380  }
php4DomElement

◆ next_sibling() [3/4]

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() [4/4]

php4DOMNode::next_sibling ( )

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

507  {
508  $next = $this->myDOMNode->nextSibling;
509 
510  if (is_object($next))
511  {
512  return new php4DOMElement($next);
513  }
514  else
515  {
516  return false;
517  }
518  }
php4DomElement

◆ node_name() [1/4]

php4DOMNode::node_name ( )

Definition at line 304 of file domxml-php4-to-php5.php.

304 {return ($this->myDOMNode->nodeType===XML_ELEMENT_NODE) ? $this->myDOMNode->localName : $this->myDOMNode->nodeName;} //Avoid namespace prefix for DOMElement

◆ node_name() [2/4]

php4DOMNode::node_name ( )

Definition at line 382 of file domxml-php4-php5.php.

382  {
383 echo "-k";
384  return $this->myDOMNode->localName;
385  }

◆ node_name() [3/4]

php4DOMNode::node_name ( )

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

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

◆ node_name() [4/4]

php4DOMNode::node_name (   $a_local = false)

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

521  {
522  if ($a_local)
523  {
524  return $this->myDOMNode->localName;
525  }
526  else
527  {
528  return $this->myDOMNode->nodeName;
529  }
530  }

◆ node_type() [1/4]

php4DOMNode::node_type ( )

Definition at line 305 of file domxml-php4-to-php5.php.

305 {return $this->myDOMNode->nodeType;}

◆ node_type() [2/4]

php4DOMNode::node_type ( )

Definition at line 387 of file domxml-php4-php5.php.

387  {
388 echo "-l";
389  return $this->myDOMNode->nodeType;
390  }

◆ node_type() [3/4]

php4DOMNode::node_type ( )

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

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

◆ node_type() [4/4]

php4DOMNode::node_type ( )

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

533  {
534  return $this->myDOMNode->nodeType;
535  }

◆ node_value() [1/4]

php4DOMNode::node_value ( )

Definition at line 306 of file domxml-php4-to-php5.php.

306 {return $this->myDOMNode->nodeValue;}

◆ node_value() [2/4]

php4DOMNode::node_value ( )

Definition at line 392 of file domxml-php4-php5.php.

393  {
394 echo "-m";
395  return $this->myDOMNode->nodeValue;
396  }

◆ node_value() [3/4]

php4DOMNode::node_value ( )

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

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

◆ node_value() [4/4]

php4DOMNode::node_value ( )

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

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

◆ owner_document() [1/2]

php4DOMNode::owner_document ( )

Definition at line 307 of file domxml-php4-to-php5.php.

References $myOwnerDocument.

◆ owner_document() [2/2]

php4DOMNode::owner_document ( )

Definition at line 398 of file domxml-php4-php5.php.

References $myOwnerDocument.

399  {
400 echo "-n";
401  return $this->myOwnerDocument;
402  }

◆ parent_node() [1/4]

php4DOMNode::parent_node ( )

Definition at line 308 of file domxml-php4-to-php5.php.

308 {return self::_newDOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);}

◆ parent_node() [2/4]

php4DOMNode::parent_node ( )

Definition at line 404 of file domxml-php4-php5.php.

404  {
405 echo "-o";
406  return new php4DOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);
407  }
php4DomElement

◆ parent_node() [3/4]

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() [4/4]

php4DOMNode::parent_node ( )

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

544  {
545  $parent = $this->myDOMNode->parentNode;
546 
547  if (is_object($parent))
548  {
549  return new php4DOMElement($parent);
550  }
551  else
552  {
553  return false;
554  }
555  }
php4DomElement

◆ php4DOMNode() [1/4]

php4DOMNode::php4DOMNode (   $aDomNode,
  $aOwnerDocument 
)

Definition at line 244 of file domxml-php4-to-php5.php.

245  {
246  $this->myDOMNode=$aDomNode;
247  $this->myOwnerDocument=$aOwnerDocument;
248  }

◆ php4DOMNode() [2/4]

php4DOMNode::php4DOMNode (   $aDomNode,
  $aOwnerDocument 
)

Definition at line 250 of file domxml-php4-php5.php.

251  {
252 echo "-T";
253  $this->myDOMNode=$aDomNode;
254  $this->myOwnerDocument=$aOwnerDocument;
255  }

◆ php4DOMNode() [3/4]

php4DOMNode::php4DOMNode (   $aDomNode)

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

296  {
297  $this->myDOMNode=$aDomNode;
298  }

◆ php4DOMNode() [4/4]

php4DOMNode::php4DOMNode (   $aDomNode)

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

Referenced by _newDOMElement(), php4DOMDocument\create_cdata_section(), php4DOMDocument\create_comment(), php4DOMDocument\create_entity_reference(), and php4DOMDocument\create_text_node().

356  {
357  $this->myDOMNode=$aDomNode;
358  }
+ Here is the caller graph for this function:

◆ prefix() [1/2]

php4DOMNode::prefix ( )

Definition at line 309 of file domxml-php4-to-php5.php.

309 {return $this->myDOMNode->prefix;}

◆ prefix() [2/2]

php4DOMNode::prefix ( )

Definition at line 409 of file domxml-php4-php5.php.

409  {
410 echo "-p";
411  return $this->myDOMNode->prefix;
412  }

◆ previous_sibling() [1/4]

php4DOMNode::previous_sibling ( )

Definition at line 310 of file domxml-php4-to-php5.php.

310 {return self::_newDOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);}

◆ previous_sibling() [2/4]

php4DOMNode::previous_sibling ( )

Definition at line 414 of file domxml-php4-php5.php.

414  {
415 echo "-q";
416  return new php4DOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);
417  }
php4DomElement

◆ previous_sibling() [3/4]

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() [4/4]

php4DOMNode::previous_sibling ( )

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

559  {
560  $prev = $this->myDOMNode->previousSibling;
561 
562  if (is_object($prev))
563  {
564  return new php4DOMElement($prev);
565  }
566  else
567  {
568  return false;
569  }
570  }
php4DomElement

◆ remove_child() [1/4]

php4DOMNode::remove_child (   $oldchild)

Definition at line 311 of file domxml-php4-to-php5.php.

References $myOwnerDocument.

311 {return self::_newDOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);}

◆ remove_child() [2/4]

php4DOMNode::remove_child (   $oldchild)

Definition at line 419 of file domxml-php4-php5.php.

References $myOwnerDocument.

420  {
421 echo "-r";
422  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);
423  }
php4DomElement

◆ remove_child() [3/4]

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() [4/4]

php4DOMNode::remove_child (   $oldchild)

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

573  {
574  return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
575  }
php4DomElement

◆ replace_child() [1/4]

php4DOMNode::replace_child (   $newnode,
  $oldnode 
)

Definition at line 312 of file domxml-php4-to-php5.php.

312 {return self::_newDOMElement($this->myDOMNode->replaceChild($this->_importNode($newnode),$oldnode->myDOMNode),$this->myOwnerDocument);}

◆ replace_child() [2/4]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

Definition at line 425 of file domxml-php4-php5.php.

References $myOwnerDocument.

425  {
426 echo "-s";
427  return new php4DOMElement($this->myDOMNode->replaceChild($oldnode->myDOMNode,$newnode->myDOMNode),$this->myOwnerDocument);
428  }
php4DomElement

◆ replace_child() [3/4]

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() [4/4]

php4DOMNode::replace_child (   $oldnode,
  $newnode 
)

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

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

◆ replace_node() [1/3]

php4DOMNode::replace_node (   $newnode)

Definition at line 313 of file domxml-php4-to-php5.php.

References $myDOMNode.

313 {return self::_newDOMElement($this->myDOMNode->parentNode->replaceChild($this->_importNode($newnode),$this->myDOMNode),$this->myOwnerDocument);}

◆ replace_node() [2/3]

php4DOMNode::replace_node (   $newnode)

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

References php4DOMAttr\set_content().

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

◆ replace_node() [3/3]

php4DOMNode::replace_node (   $newnode)

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

References php4DOMAttr\set_content().

377  {
378  return $this->set_content($newnode->myDOMNode->textContent);
379  }
+ Here is the call graph for this function:

◆ set_content() [1/4]

php4DOMNode::set_content (   $text)

Definition at line 314 of file domxml-php4-to-php5.php.

References _entityDecode().

314 {return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode(_entityDecode($text)));} //Entity problem reported by AL-DesignWorks 2007-09-07
_entityDecode($text)
+ Here is the call graph for this function:

◆ set_content() [2/4]

php4DOMNode::set_content (   $text)

Definition at line 430 of file domxml-php4-php5.php.

431  {
432 echo "-t";
433  if (($this->myDOMNode->hasChildNodes())&&($this->myDOMNode->firstChild->nodeType==XML_TEXT_NODE))
434  $this->myDOMNode->removeChild($this->myDOMNode->firstChild);
435  return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($text));
436  }

◆ set_content() [3/4]

php4DOMNode::set_content (   $text)

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

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

◆ set_content() [4/4]

php4DOMNode::set_content (   $text)

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

583  {
584  $this->myDOMNode->textContent = $text;
585  return $this->myDOMNode->textContent;
586  }

◆ set_namespace()

php4DOMNode::set_namespace (   $uri,
  $prefix = null 
)

Definition at line 316 of file domxml-php4-to-php5.php.

References $n.

317  {//Contributions by Daniel Walker 2006-09-08
318  $nsprefix=$this->myDOMNode->lookupPrefix($uri);
319  if ($nsprefix==null)
320  {
321  $nsprefix= $prefix==null ? $nsprefix='a'.sprintf('%u',crc32($uri)) : $prefix;
322  if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE)
323  {
324  if (($prefix!=null)&&$this->myDOMNode->ownerElement->hasAttributeNS('http://www.w3.org/2000/xmlns/',$nsprefix)&&
325  ($this->myDOMNode->ownerElement->getAttributeNS('http://www.w3.org/2000/xmlns/',$nsprefix)!=$uri))
326  {//Remove namespace
327  $parent=$this->myDOMNode->ownerElement;
328  $parent->removeAttributeNode($this->myDOMNode);
329  $parent->setAttribute($this->myDOMNode->localName,$this->myDOMNode->nodeValue);
330  $this->myDOMNode=$parent->getAttributeNode($this->myDOMNode->localName);
331  return;
332  }
333  $this->myDOMNode->ownerElement->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:'.$nsprefix,$uri);
334  }
335  }
336  if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE)
337  {
338  $parent=$this->myDOMNode->ownerElement;
339  $parent->removeAttributeNode($this->myDOMNode);
340  $parent->setAttributeNS($uri,$nsprefix.':'.$this->myDOMNode->localName,$this->myDOMNode->nodeValue);
341  $this->myDOMNode=$parent->getAttributeNodeNS($uri,$this->myDOMNode->localName);
342  }
343  elseif ($this->myDOMNode->nodeType===XML_ELEMENT_NODE)
344  {
345  $NewNode=$this->myDOMNode->ownerDocument->createElementNS($uri,$nsprefix.':'.$this->myDOMNode->localName);
346  foreach ($this->myDOMNode->attributes as $n) $NewNode->appendChild($n->cloneNode(true));
347  foreach ($this->myDOMNode->childNodes as $n) $NewNode->appendChild($n->cloneNode(true));
348  $xpath=new DOMXPath($this->myDOMNode->ownerDocument);
349  $myDOMNodeList=$xpath->query('namespace::*[name()!="xml"]',$this->myDOMNode); //Add old namespaces
350  foreach ($myDOMNodeList as $n) $NewNode->setAttributeNS('http://www.w3.org/2000/xmlns/',$n->nodeName,$n->nodeValue);
351  $this->myDOMNode->parentNode->replaceChild($NewNode,$this->myDOMNode);
352  $this->myDOMNode=$NewNode;
353  }
354  }
$n
Definition: RandomTest.php:80

◆ unlink_node() [1/3]

php4DOMNode::unlink_node ( )

Definition at line 355 of file domxml-php4-to-php5.php.

356  {
357  if ($this->myDOMNode->parentNode!=null)
358  {
359  if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE) $this->myDOMNode->parentNode->removeAttributeNode($this->myDOMNode);
360  else $this->myDOMNode->parentNode->removeChild($this->myDOMNode);
361  }
362  }

◆ unlink_node() [2/3]

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() [3/3]

php4DOMNode::unlink_node (   $aDomNode = "")

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

426  {
427  // sometimes the node to unlink is passed
428  if (!is_object($aDomNode))
429  {
430  $aDomNode = $this;
431  //$aDomNode = $this;
432  }
433 
434  $parent = $aDomNode->myDOMNode->parentNode;
435  if (is_object($parent))
436  {
437  $parent->removeChild($aDomNode->myDOMNode);
438  }
439  }

Field Documentation

◆ $myDOMNode

php4DOMNode::$myDOMNode

◆ $myOwnerDocument


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