ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
php4DOMDocument Class Reference
+ Collaboration diagram for php4DOMDocument:

Public Member Functions

 __construct ($source, $file=true, $a_mode=0)
 
 xpath_init ()
 
 free ()
 
 xpath_new_context ()
 
 dump_node ($node)
 
 validate (&$error)
 
 create_attribute ($name, $value)
 
 create_cdata_section ($content)
 
 create_comment ($data)
 
 create_element ($name)
 
 create_text_node ($content)
 
 document_element ()
 
 dump_file ($filename, $compressionmode=false, $format=false)
 
 dump_mem ($format=false, $encoding=false)
 
 get_elements_by_tagname ($name)
 
 html_dump_mem ()
 
 php4DOMDocument ($source, $file=true)
 
 xpath_init ()
 
 free ()
 
 xpath_new_context ()
 
 dump_node ($node)
 
 validate (&$error)
 
 create_attribute ($name, $value)
 
 create_cdata_section ($content)
 
 create_comment ($data)
 
 create_element ($name)
 
 create_text_node ($content)
 
 document_element ()
 
 dump_file ($filename, $compressionmode=false, $format=false)
 
 dump_mem ($format=false, $encoding=false)
 
 get_elements_by_tagname ($name)
 
 html_dump_mem ()
 

Data Fields

 $myDOMDocument
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

php4DOMDocument::__construct (   $source,
  $file = true,
  $a_mode = 0 
)

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

References $error, $file, $old, $source, and staticxmlerror().

110  {
111  $this->myDOMDocument=new DOMDocument();
112  // temporary set error handler
113  set_error_handler('staticxmlerror');
114  $old = ini_set('html_errors', false);
115 
116  if (is_object($source)) {
117  $this->myDOMDocument = $source;
118  $this->success = true;
119  } else {
120  if ($file) {
121  $this->success = @$this->myDOMDocument->load($source, $a_mode);
122  $this->success = @$this->myDOMDocument->load($source, $a_mode);
123  } else {
124  $this->success = $this->myDOMDocument->loadXML($source, $a_mode);
125  }
126  }
127 
128  // Restore error handling
129  ini_set('html_errors', $old);
130  restore_error_handler();
131 
132  if (!$this->success) {
133  $this->error_arr = staticxmlerror(null, null, null, null, null, true);
134  foreach ($this->error_arr as $error) {
135  $error = str_replace("DOMDocument::loadXML():", "", $error);
136  $this->error.= $error . "<br />";
137  }
138  }
139  }
staticxmlerror($errno, $errstr, $errfile, $errline, $errcontext, $ret=false)
$error
Definition: Error.php:17
$old
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ create_attribute() [1/2]

php4DOMDocument::create_attribute (   $name,
  $value 
)

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

References $name, and php4DOMAttr\php4DOMAttr().

132  {
133  $myAttr=$this->myDOMDocument->createAttribute($name);
134  $myAttr->value=$value;
135 
136  return new php4DOMAttr($myAttr);
137  }
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:

◆ create_attribute() [2/2]

php4DOMDocument::create_attribute (   $name,
  $value 
)

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

References $name, and php4DOMAttr\php4DOMAttr().

184  {
185  $myAttr=$this->myDOMDocument->createAttribute($name);
186  $myAttr->value=$value;
187 
188  return new php4DOMAttr($myAttr);
189  }
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:

◆ create_cdata_section() [1/2]

php4DOMDocument::create_cdata_section (   $content)

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

140  {
141  return new php4DOMCDATASection($this->myDOMDocument->createCDATASection($content));
142  }

◆ create_cdata_section() [2/2]

php4DOMDocument::create_cdata_section (   $content)

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

192  {
193  return new php4DOMCDATASection($this->myDOMDocument->createCDATASection($content));
194  }

◆ create_comment() [1/2]

php4DOMDocument::create_comment (   $data)

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

References $data.

145  {
146  return new php4DOMElement($this->myDOMDocument->createComment($data));
147  }
php4DomElement

◆ create_comment() [2/2]

php4DOMDocument::create_comment (   $data)

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

References $data.

197  {
198  return new php4DOMElement($this->myDOMDocument->createComment($data));
199  }
php4DomElement

◆ create_element() [1/2]

php4DOMDocument::create_element (   $name)

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

References $name.

150  {
151  return new php4DOMElement($this->myDOMDocument->createElement($name));
152  }
if($format !==null) $name
Definition: metadata.php:146
php4DomElement

◆ create_element() [2/2]

php4DOMDocument::create_element (   $name)

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

References $name.

202  {
203  return new php4DOMElement($this->myDOMDocument->createElement($name));
204  }
if($format !==null) $name
Definition: metadata.php:146
php4DomElement

◆ create_text_node() [1/2]

php4DOMDocument::create_text_node (   $content)

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

References php4DOMNode\php4DOMNode().

155  {
156  return new php4DOMNode($this->myDOMDocument->createTextNode($content));
157  }
+ Here is the call graph for this function:

◆ create_text_node() [2/2]

php4DOMDocument::create_text_node (   $content)

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

References php4DOMNode\php4DOMNode().

207  {
208  return new php4DOMNode($this->myDOMDocument->createTextNode($content));
209  }
+ Here is the call graph for this function:

◆ document_element() [1/2]

php4DOMDocument::document_element ( )

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

160  {
161  return new php4DOMElement($this->myDOMDocument->documentElement);
162  }
php4DomElement

◆ document_element() [2/2]

php4DOMDocument::document_element ( )

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

212  {
213  return new php4DOMElement($this->myDOMDocument->documentElement);
214  }
php4DomElement

◆ dump_file() [1/2]

php4DOMDocument::dump_file (   $filename,
  $compressionmode = false,
  $format = false 
)

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

References $filename.

165  {
166  return $this->myDOMDocument->save($filename);
167  }

◆ dump_file() [2/2]

php4DOMDocument::dump_file (   $filename,
  $compressionmode = false,
  $format = false 
)

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

References $filename.

217  {
218  return $this->myDOMDocument->save($filename);
219  }

◆ dump_mem() [1/2]

php4DOMDocument::dump_mem (   $format = false,
  $encoding = false 
)

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

170  {
171  return $this->myDOMDocument->saveXML();
172  }

◆ dump_mem() [2/2]

php4DOMDocument::dump_mem (   $format = false,
  $encoding = false 
)

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

References $r.

222  {
223  $r = $this->myDOMDocument->saveXML();
224  return $r;
225  }
$r
Definition: example_031.php:79

◆ dump_node() [1/2]

php4DOMDocument::dump_node (   $node)

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

116  {
117  $str = $this->myDOMDocument->saveXML($node->myDOMNode);
118  return $str;
119  }

◆ dump_node() [2/2]

php4DOMDocument::dump_node (   $node)

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

159  {
160  $str = $this->myDOMDocument->saveXML($node->myDOMNode);
161  return $str;
162  }

◆ free() [1/2]

php4DOMDocument::free ( )

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

104  {
105  unset($this->myDOMDocument);
106  }

◆ free() [2/2]

php4DOMDocument::free ( )

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

147  {
148  unset($this->myDOMDocument);
149  }

◆ get_elements_by_tagname() [1/2]

php4DOMDocument::get_elements_by_tagname (   $name)

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

References $i, $name, and array.

175  {
176  $myDOMNodeList=$this->myDOMDocument->getElementsByTagName($name);
177  $nodeSet=array();
178  $i=0;
179  while ($node=$myDOMNodeList->item($i)) {
180  $nodeSet[]=new php4DOMElement($node);
181  $i++;
182  }
183 
184  return $nodeSet;
185  }
if($format !==null) $name
Definition: metadata.php:146
php4DomElement
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19

◆ get_elements_by_tagname() [2/2]

php4DOMDocument::get_elements_by_tagname (   $name)

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

References $i, $name, and array.

228  {
229  $myDOMNodeList=$this->myDOMDocument->getElementsByTagName($name);
230  $nodeSet=array();
231  $i=0;
232  while ($node=$myDOMNodeList->item($i)) {
233  $nodeSet[]=new php4DOMElement($node);
234  $i++;
235  }
236 
237  return $nodeSet;
238  }
if($format !==null) $name
Definition: metadata.php:146
php4DomElement
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19

◆ html_dump_mem() [1/2]

php4DOMDocument::html_dump_mem ( )

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

188  {
189  return $this->myDOMDocument->saveHTML();
190  }

◆ html_dump_mem() [2/2]

php4DOMDocument::html_dump_mem ( )

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

241  {
242  return $this->myDOMDocument->saveHTML();
243  }

◆ php4DOMDocument()

php4DOMDocument::php4DOMDocument (   $source,
  $file = true 
)

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

References $file, and $source.

89  {
90  $this->myDOMDocument=new DOMDocument();
91  if ($file) {
92  $this->myDOMDocument->load($source);
93  } else {
94  $this->myDOMDocument->loadXML($source);
95  }
96  }
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$source
Definition: linkback.php:22

◆ validate() [1/2]

php4DOMDocument::validate ( $error)

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

References $error, $ok, and array.

123  {
124  $ok = $this->myDOMDocument->validate();
125  if (!$ok) {
126  $error = array(array("0", "Unknown Error"));
127  }
128  return $error;
129  }
$error
Definition: Error.php:17
Create styles array
The data for the language used.

◆ validate() [2/2]

php4DOMDocument::validate ( $error)

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

References $error, $ok, and array.

166  {
167  $ok = $this->myDOMDocument->validate();
168 
169  if (!$ok) {
170  $error = array(array("0", "Unknown Error"));
171 
172  if (function_exists("libxml_get_last_error")) {
173  $err = libxml_get_last_error();
174 
175  if (is_object($err)) {
176  $error = array(array($err->code, $err->message));
177  }
178  }
179  }
180  return $error;
181  }
$error
Definition: Error.php:17
Create styles array
The data for the language used.

◆ xpath_init() [1/2]

php4DOMDocument::xpath_init ( )

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

100  {
101  }

◆ xpath_init() [2/2]

php4DOMDocument::xpath_init ( )

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

143  {
144  }

◆ xpath_new_context() [1/2]

php4DOMDocument::xpath_new_context ( )

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

References xpath_new_context().

110  {
111  return xpath_new_context($this);
112  }
+ Here is the call graph for this function:

◆ xpath_new_context() [2/2]

php4DOMDocument::xpath_new_context ( )

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

References xpath_new_context().

153  {
154  return xpath_new_context($this);
155  }
+ Here is the call graph for this function:

Field Documentation

◆ $myDOMDocument

php4DOMDocument::$myDOMDocument

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


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