ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_Yadis_dom Class Reference
+ Inheritance diagram for Auth_Yadis_dom:
+ Collaboration diagram for Auth_Yadis_dom:

Public Member Functions

 Auth_Yadis_dom ()
 
 setXML ($xml_string)
 
 registerNamespace ($prefix, $uri)
 
evalXPath ($xpath, $node=null)
 
 content ($node)
 
 attributes ($node)
 
- Public Member Functions inherited from Auth_Yadis_XMLParser
 init ($xml_string, $namespace_map)
 Initialize an instance of Auth_Yadis_XMLParser with some XML and namespaces. More...
 
 registerNamespace ($prefix, $uri)
 Register a namespace with the XML parser. More...
 
 setXML ($xml_string)
 Set this parser object's XML payload. More...
 
evalXPath ($xpath, $node=null)
 Evaluate an XPath expression and return the resulting node list. More...
 
 content ($node)
 Return the textual content of a specified node. More...
 
 attributes ($node)
 Return the attributes of a specified node. More...
 

Detailed Description

Definition at line 219 of file XML.php.

Member Function Documentation

◆ attributes()

Auth_Yadis_dom::attributes (   $node)

Definition at line 283 of file XML.php.

References $result.

284  {
285  if ($node) {
286  $arr = $node->attributes;
287  $result = array();
288 
289  if ($arr) {
290  for ($i = 0; $i < $arr->length; $i++) {
291  $node = $arr->item($i);
292  $result[$node->nodeName] = $node->nodeValue;
293  }
294  }
295 
296  return $result;
297  }
298  }
$result

◆ Auth_Yadis_dom()

Auth_Yadis_dom::Auth_Yadis_dom ( )

Definition at line 220 of file XML.php.

221  {
222  $this->xml = null;
223  $this->doc = null;
224  $this->xpath = null;
225  $this->errors = array();
226  }

◆ content()

Auth_Yadis_dom::content (   $node)

Definition at line 276 of file XML.php.

277  {
278  if ($node) {
279  return $node->textContent;
280  }
281  }

◆ evalXPath()

& Auth_Yadis_dom::evalXPath (   $xpath,
  $node = null 
)

Definition at line 255 of file XML.php.

References $n, and $result.

256  {
257  if ($node) {
258  $result = @$this->xpath->query($xpath, $node);
259  } else {
260  $result = @$this->xpath->query($xpath);
261  }
262 
263  $n = array();
264 
265  if (!$result) {
266  return $n;
267  }
268 
269  for ($i = 0; $i < $result->length; $i++) {
270  $n[] = $result->item($i);
271  }
272 
273  return $n;
274  }
$result
$n
Definition: RandomTest.php:80

◆ registerNamespace()

Auth_Yadis_dom::registerNamespace (   $prefix,
  $uri 
)

Definition at line 250 of file XML.php.

251  {
252  return $this->xpath->registerNamespace($prefix, $uri);
253  }

◆ setXML()

Auth_Yadis_dom::setXML (   $xml_string)

Definition at line 228 of file XML.php.

229  {
230  $this->xml = $xml_string;
231  $this->doc = new DOMDocument;
232 
233  if (!$this->doc) {
234  return false;
235  }
236 
237  if (!@$this->doc->loadXML($xml_string)) {
238  return false;
239  }
240 
241  $this->xpath = new DOMXPath($this->doc);
242 
243  if ($this->xpath) {
244  return true;
245  } else {
246  return false;
247  }
248  }

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