ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
php4DOMElement Class Reference

php4DomElement More...

+ Inheritance diagram for php4DOMElement:
+ Collaboration diagram for php4DOMElement:

Public Member Functions

 get_attribute ($name)
 
 owner_document ()
 
 get_elements_by_tagname ($name)
 
 has_attribute ($name)
 
 remove_attribute ($name)
 
 set_attribute ($name, $value)
 
 tagname ()
 
 set_content ($text)
 
 get_content ()
 
 unlink ($aDomNode)
 
 add_namespace ($uri, $prefix)
 
 get_attribute ($name)
 
 get_attribute_node ($name)
 
 get_elements_by_tagname ($name)
 
 has_attribute ($name)
 
 remove_attribute ($name)
 
 set_attribute ($name, $value)
 
 set_name ($name)
 
 tagname ()
 
 get_attribute ($name)
 
 get_elements_by_tagname ($name)
 
 has_attribute ($name)
 
 remove_attribute ($name)
 
 set_attribute ($name, $value)
 
 tagname ()
 
 get_attribute ($name)
 
 get_elements_by_tagname ($name)
 
 has_attribute ($name)
 
 remove_attribute ($name)
 
 set_attribute ($name, $value)
 
 tagname ()
 
 set_content ($text)
 
 get_content ()
 
 unlink ($aDomNode)
 
- Public Member Functions inherited from php4DOMNode
 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)
 

Additional Inherited Members

- Static Public Member Functions inherited from php4DOMNode
static _newDOMElement ($aDOMNode, $aOwnerDocument)
 
- Data Fields inherited from php4DOMNode
 $myDOMNode
 
 $myOwnerDocument
 
- Protected Member Functions inherited from php4DOMNode
 _importNode ($newnode)
 

Detailed Description

php4DomElement

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

Member Function Documentation

◆ add_namespace()

php4DOMElement::add_namespace (   $uri,
  $prefix 
)

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

186  {
187  if ($this->myDOMNode->hasAttributeNS('http://www.w3.org/2000/xmlns/',$prefix)) return false;
188  else
189  {
190  $this->myDOMNode->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:'.$prefix,$uri); //By Daniel Walker 2006-09-08
191  return true;
192  }
193  }

◆ get_attribute() [1/4]

php4DOMElement::get_attribute (   $name)

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

194 {return $this->myDOMNode->getAttribute($name);}

◆ get_attribute() [2/4]

php4DOMElement::get_attribute (   $name)

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

200  {
201 echo "-N";
202  return $this->myDOMNode->getAttribute($name);
203  }

◆ get_attribute() [3/4]

php4DOMElement::get_attribute (   $name)

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

205  {
206  return $this->myDOMNode->getAttribute($name);
207  }

◆ get_attribute() [4/4]

php4DOMElement::get_attribute (   $name)

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

260  {
261  return $this->myDOMNode->getAttribute($name);
262  }

◆ get_attribute_node()

php4DOMElement::get_attribute_node (   $name)

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

References php4DOMNode\$myOwnerDocument.

195 {return parent::_newDOMElement($this->myDOMNode->getAttributeNode($name),$this->myOwnerDocument);}

◆ get_content() [1/2]

php4DOMElement::get_content ( )

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

267  {
268  $text_node =& $this->myDOMNode->firstChild;
269 
270  if (is_object($text_node))
271  {
272  return $text_node->textContent;
273  }
274  else
275  {
276  return "";
277  }
278  }

◆ get_content() [2/2]

php4DOMElement::get_content ( )

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

327  {
328  $text_node = $this->myDOMNode->firstChild;
329 
330  if (is_object($text_node))
331  {
332  return $text_node->textContent;
333  }
334  else
335  {
336  return "";
337  }
338  }

◆ get_elements_by_tagname() [1/4]

php4DOMElement::get_elements_by_tagname (   $name)

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

197  {
198  $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
199  $nodeSet=array();
200  $i=0;
201  if (isset($myDOMNodeList))
202  while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
203  return $nodeSet;
204  }
php4DomElement

◆ get_elements_by_tagname() [2/4]

php4DOMElement::get_elements_by_tagname (   $name)

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

206  {
207 echo "-O";
208  $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
209  $nodeSet=array();
210  $i=0;
211  if (isset($myDOMNodeList))
212  while ($node=$myDOMNodeList->item($i))
213  {
214  $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument);
215  $i++;
216  }
217  return $nodeSet;
218  }
php4DomElement

◆ get_elements_by_tagname() [3/4]

php4DOMElement::get_elements_by_tagname (   $name)

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

210  {
211  $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
212  $nodeSet=array();
213  $i=0;
214  while ($node=$myDOMNodeList->item($i))
215  {
216  $nodeSet[]=new php4DOMElement($node);
217  $i++;
218  }
219 
220  return $nodeSet;
221  }
php4DomElement

◆ get_elements_by_tagname() [4/4]

php4DOMElement::get_elements_by_tagname (   $name)

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

270  {
271  $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
272  $nodeSet=array();
273  $i=0;
274  while ($node=$myDOMNodeList->item($i))
275  {
276  $nodeSet[]=new php4DOMElement($node);
277  $i++;
278  }
279 
280  return $nodeSet;
281  }
php4DomElement

◆ has_attribute() [1/4]

php4DOMElement::has_attribute (   $name)

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

205 {return $this->myDOMNode->hasAttribute($name);}

◆ has_attribute() [2/4]

php4DOMElement::has_attribute (   $name)

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

221  {
222 echo "-P";
223  return $this->myDOMNode->hasAttribute($name);
224  }

◆ has_attribute() [3/4]

php4DOMElement::has_attribute (   $name)

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

224  {
225  return $this->myDOMNode->hasAttribute($name);
226  }

◆ has_attribute() [4/4]

php4DOMElement::has_attribute (   $name)

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

284  {
285  return $this->myDOMNode->hasAttribute($name);
286  }

◆ owner_document()

php4DOMElement::owner_document ( )

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

265  {
266  return new php4DOMDocument($this->myDOMNode->ownerDocument);
267  }

◆ remove_attribute() [1/4]

php4DOMElement::remove_attribute (   $name)

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

206 {return $this->myDOMNode->removeAttribute($name);}

◆ remove_attribute() [2/4]

php4DOMElement::remove_attribute (   $name)

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

227  {
228 echo "-Q";
229  return $this->myDOMNode->removeAttribute($name);
230  }

◆ remove_attribute() [3/4]

php4DOMElement::remove_attribute (   $name)

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

229  {
230  return $this->myDOMNode->removeAttribute($name);
231  }

◆ remove_attribute() [4/4]

php4DOMElement::remove_attribute (   $name)

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

289  {
290  return $this->myDOMNode->removeAttribute($name);
291  }

◆ set_attribute() [1/4]

php4DOMElement::set_attribute (   $name,
  $value 
)

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

References php4DOMAttr\php4DOMAttr().

208  {
209  //return $this->myDOMNode->setAttribute($name,$value); //Does not return a DomAttr
210  $myAttr=$this->myDOMNode->ownerDocument->createAttribute($name);
211  $myAttr->value=htmlspecialchars($value,ENT_QUOTES); //Entity problem reported by AL-DesignWorks 2007-09-07
212  $this->myDOMNode->setAttributeNode($myAttr);
213  return new php4DOMAttr($myAttr,$this->myOwnerDocument);
214  }
+ Here is the call graph for this function:

◆ set_attribute() [2/4]

php4DOMElement::set_attribute (   $name,
  $value 
)

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

233  {
234 echo "-R";
235  return $this->myDOMNode->setAttribute($name,$value);
236  }

◆ set_attribute() [3/4]

php4DOMElement::set_attribute (   $name,
  $value 
)

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

234  {
235  return $this->myDOMNode->setAttribute($name,$value);
236  }

◆ set_attribute() [4/4]

php4DOMElement::set_attribute (   $name,
  $value 
)

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

294  {
295  return $this->myDOMNode->setAttribute($name,$value);
296  }

◆ set_content() [1/2]

php4DOMElement::set_content (   $text)

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

245  {
246  // the following replace has been added to conform with PHP4.
247  // A set_content("&") brought a get_content() = "&" there,
248  // whereas PHP5 gives a get_content() = "&"
249  $text = str_replace("&lt;", "<", $text);
250  $text = str_replace("&gt;", ">", $text);
251  $text = str_replace("&amp;", "&", $text);
252 
253  $text_node =& new DOMText();
254  $text_node->appendData($text);
255  if (is_object($this->myDOMNode->firstChild))
256  {
257  $this->myDOMNode->replaceChild($text_node, $this->myDOMNode->firstChild);
258  }
259  else
260  {
261  $this->myDOMNode->appendChild($text_node);
262  }
263  }

◆ set_content() [2/2]

php4DOMElement::set_content (   $text)

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

305  {
306  // the following replace has been added to conform with PHP4.
307  // A set_content("&amp;") brought a get_content() = "&" there,
308  // whereas PHP5 gives a get_content() = "&amp;"
309  $text = str_replace("&lt;", "<", $text);
310  $text = str_replace("&gt;", ">", $text);
311  $text = str_replace("&amp;", "&", $text);
312 
313  $text_node = new DOMText();
314  $text_node->appendData($text);
315  if (is_object($this->myDOMNode->firstChild))
316  {
317  $this->myDOMNode->replaceChild($text_node, $this->myDOMNode->firstChild);
318  }
319  else
320  {
321  $this->myDOMNode->appendChild($text_node);
322  }
323  }

◆ set_name()

php4DOMElement::set_name (   $name)

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

222  {
223  if ($this->myDOMNode->prefix=='') $newNode=$this->myDOMNode->ownerDocument->createElement($name);
224  else $newNode=$this->myDOMNode->ownerDocument->createElementNS($this->myDOMNode->namespaceURI,$this->myDOMNode->prefix.':'.$name);
225  $myDOMNodeList=$this->myDOMNode->attributes;
226  $i=0;
227  if (isset($myDOMNodeList))
228  while ($node=$myDOMNodeList->item($i++))
229  if ($node->namespaceURI=='') $newNode->setAttribute($node->name,$node->value);
230  else $newNode->setAttributeNS($node->namespaceURI,$node->nodeName,$node->value);
231  $myDOMNodeList=$this->myDOMNode->childNodes;
232  if (isset($myDOMNodeList))
233  while ($node=$myDOMNodeList->item(0)) $newNode->appendChild($node);
234  $this->myDOMNode->parentNode->replaceChild($newNode,$this->myDOMNode);
235  $this->myDOMNode=$newNode;
236  return true;
237  }

◆ tagname() [1/4]

php4DOMElement::tagname ( )

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

References php4DOMNode\$myDOMNode.

238 {return $this->tagname;}

◆ tagname() [2/4]

php4DOMElement::tagname ( )

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

References php4DOMNode\$myDOMNode, and php4DOMNode\$myOwnerDocument.

239  {
240 echo "-S";
241  return $this->myDOMNode->tagName;
242  }

◆ tagname() [3/4]

php4DOMElement::tagname ( )

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

239  {
240  return $this->myDOMNode->tagName;
241  }

◆ tagname() [4/4]

php4DOMElement::tagname ( )

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

299  {
300  return $this->myDOMNode->tagName;
301  }

◆ unlink() [1/2]

php4DOMElement::unlink (   $aDomNode)

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

References php4DOMNode\$myDOMNode.

282  {
283  parent::unlink_node($aDomNode);
284  }

◆ unlink() [2/2]

php4DOMElement::unlink (   $aDomNode)

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

342  {
343  parent::unlink_node($aDomNode);
344  }

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