ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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, 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  {
118  $this->myDOMDocument = $source;
119  $this->success = true;
120  }
121  else
122  {
123  if ($file)
124  {
125  $this->success = @$this->myDOMDocument->load($source,$a_mode);
126  $this->success = @$this->myDOMDocument->load($source,$a_mode);
127  }
128  else
129  {
130  $this->success = $this->myDOMDocument->loadXML($source,$a_mode);
131  }
132  }
133 
134  // Restore error handling
135  ini_set('html_errors', $old);
136  restore_error_handler();
137 
138  if (!$this->success)
139  {
140  $this->error_arr = staticxmlerror(null, null, null, null, null, true);
141  foreach($this->error_arr as $error)
142  {
143  $error = str_replace("DOMDocument::loadXML():", "", $error);
144  $this->error.= $error."<br />";
145  }
146  }
147  }
$error
Definition: Error.php:17
staticxmlerror($errno, $errstr, $errfile, $errline, $errcontext, $ret=false)
$old
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

Member Function Documentation

◆ create_attribute() [1/2]

php4DOMDocument::create_attribute (   $name,
  $value 
)

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

References php4DOMAttr\php4DOMAttr().

136  {
137  $myAttr=$this->myDOMDocument->createAttribute($name);
138  $myAttr->value=$value;
139 
140  return new php4DOMAttr($myAttr);
141  }
+ Here is the call graph for this function:

◆ create_attribute() [2/2]

php4DOMDocument::create_attribute (   $name,
  $value 
)

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

References php4DOMAttr\php4DOMAttr().

195  {
196  $myAttr=$this->myDOMDocument->createAttribute($name);
197  $myAttr->value=$value;
198 
199  return new php4DOMAttr($myAttr);
200  }
+ Here is the call graph for this function:

◆ create_cdata_section() [1/2]

php4DOMDocument::create_cdata_section (   $content)

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

144  {
145  return new php4DOMCDATASection($this->myDOMDocument->createCDATASection($content));
146  }

◆ create_cdata_section() [2/2]

php4DOMDocument::create_cdata_section (   $content)

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

203  {
204  return new php4DOMCDATASection($this->myDOMDocument->createCDATASection($content));
205  }

◆ create_comment() [1/2]

php4DOMDocument::create_comment (   $data)

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

References $data.

149  {
150  return new php4DOMElement($this->myDOMDocument->createComment($data));
151  }
php4DomElement

◆ create_comment() [2/2]

php4DOMDocument::create_comment (   $data)

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

References $data.

208  {
209  return new php4DOMElement($this->myDOMDocument->createComment($data));
210  }
php4DomElement

◆ create_element() [1/2]

php4DOMDocument::create_element (   $name)

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

154  {
155  return new php4DOMElement($this->myDOMDocument->createElement($name));
156  }
php4DomElement

◆ create_element() [2/2]

php4DOMDocument::create_element (   $name)

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

213  {
214  return new php4DOMElement($this->myDOMDocument->createElement($name));
215  }
php4DomElement

◆ create_text_node() [1/2]

php4DOMDocument::create_text_node (   $content)

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

References php4DOMNode\php4DOMNode().

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

◆ create_text_node() [2/2]

php4DOMDocument::create_text_node (   $content)

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

References php4DOMNode\php4DOMNode().

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

◆ document_element() [1/2]

php4DOMDocument::document_element ( )

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

164  {
165  return new php4DOMElement($this->myDOMDocument->documentElement);
166  }
php4DomElement

◆ document_element() [2/2]

php4DOMDocument::document_element ( )

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

223  {
224  return new php4DOMElement($this->myDOMDocument->documentElement);
225  }
php4DomElement

◆ dump_file() [1/2]

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

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

References $filename.

169  {
170  return $this->myDOMDocument->save($filename);
171  }

◆ dump_file() [2/2]

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

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

References $filename.

228  {
229  return $this->myDOMDocument->save($filename);
230  }

◆ dump_mem() [1/2]

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

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

174  {
175  return $this->myDOMDocument->saveXML();
176  }

◆ dump_mem() [2/2]

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

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

References $r.

233  {
234  $r = $this->myDOMDocument->saveXML();
235  return $r;
236  }
$r
Definition: example_031.php:79

◆ dump_node() [1/2]

php4DOMDocument::dump_node (   $node)

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

119  {
120  $str = $this->myDOMDocument->saveXML($node->myDOMNode);
121  return $str;
122  }

◆ dump_node() [2/2]

php4DOMDocument::dump_node (   $node)

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

167  {
168  $str = $this->myDOMDocument->saveXML($node->myDOMNode);
169  return $str;
170  }

◆ free() [1/2]

php4DOMDocument::free ( )

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

107  {
108  unset($this->myDOMDocument);
109  }

◆ free() [2/2]

php4DOMDocument::free ( )

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

155  {
156  unset($this->myDOMDocument);
157  }

◆ get_elements_by_tagname() [1/2]

php4DOMDocument::get_elements_by_tagname (   $name)

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

References array.

179  {
180  $myDOMNodeList=$this->myDOMDocument->getElementsByTagName($name);
181  $nodeSet=array();
182  $i=0;
183  while ($node=$myDOMNodeList->item($i))
184  {
185  $nodeSet[]=new php4DOMElement($node);
186  $i++;
187  }
188 
189  return $nodeSet;
190  }
php4DomElement
Create styles array
The data for the language used.

◆ get_elements_by_tagname() [2/2]

php4DOMDocument::get_elements_by_tagname (   $name)

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

References array.

239  {
240  $myDOMNodeList=$this->myDOMDocument->getElementsByTagName($name);
241  $nodeSet=array();
242  $i=0;
243  while ($node=$myDOMNodeList->item($i))
244  {
245  $nodeSet[]=new php4DOMElement($node);
246  $i++;
247  }
248 
249  return $nodeSet;
250  }
php4DomElement
Create styles array
The data for the language used.

◆ html_dump_mem() [1/2]

php4DOMDocument::html_dump_mem ( )

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

193  {
194  return $this->myDOMDocument->saveHTML();
195  }

◆ html_dump_mem() [2/2]

php4DOMDocument::html_dump_mem ( )

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

253  {
254  return $this->myDOMDocument->saveHTML();
255  }

◆ php4DOMDocument()

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

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

References $file.

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

◆ validate() [1/2]

php4DOMDocument::validate ( $error)

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

References $error, $ok, and array.

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

◆ validate() [2/2]

php4DOMDocument::validate ( $error)

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

References $error, $ok, and array.

174  {
175  $ok = $this->myDOMDocument->validate();
176 
177  if (!$ok)
178  {
179  $error = array(array("0", "Unknown Error"));
180 
181  if (function_exists("libxml_get_last_error"))
182  {
183  $err = libxml_get_last_error();
184 
185  if (is_object($err))
186  {
187  $error = array(array($err->code, $err->message));
188  }
189  }
190  }
191  return $error;
192  }
$error
Definition: Error.php:17
Create styles array
The data for the language used.

◆ xpath_init() [1/2]

php4DOMDocument::xpath_init ( )

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

103  {
104  }

◆ xpath_init() [2/2]

php4DOMDocument::xpath_init ( )

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

151  {
152  }

◆ xpath_new_context() [1/2]

php4DOMDocument::xpath_new_context ( )

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

References xpath_new_context().

113  {
114  return xpath_new_context($this);
115  }
+ Here is the call graph for this function:

◆ xpath_new_context() [2/2]

php4DOMDocument::xpath_new_context ( )

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

References xpath_new_context().

161  {
162  return xpath_new_context($this);
163  }
+ 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: