ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_Yadis_domxml Class Reference
+ Inheritance diagram for Auth_Yadis_domxml:
+ Collaboration diagram for Auth_Yadis_domxml:

Public Member Functions

 Auth_Yadis_domxml ()
 
 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 136 of file XML.php.

Member Function Documentation

◆ attributes()

Auth_Yadis_domxml::attributes (   $node)

Definition at line 193 of file XML.php.

References $result.

194  {
195  if ($node) {
196  $arr = $node->attributes();
197  $result = array();
198 
199  if ($arr) {
200  foreach ($arr as $attrnode) {
201  $result[$attrnode->name] = $attrnode->value;
202  }
203  }
204 
205  return $result;
206  }
207  }
$result

◆ Auth_Yadis_domxml()

Auth_Yadis_domxml::Auth_Yadis_domxml ( )

Definition at line 137 of file XML.php.

138  {
139  $this->xml = null;
140  $this->doc = null;
141  $this->xpath = null;
142  $this->errors = array();
143  }

◆ content()

Auth_Yadis_domxml::content (   $node)

Definition at line 186 of file XML.php.

187  {
188  if ($node) {
189  return $node->get_content();
190  }
191  }

◆ evalXPath()

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

Definition at line 165 of file XML.php.

References $n, and $result.

166  {
167  if ($node) {
168  $result = @$this->xpath->xpath_eval($xpath, $node);
169  } else {
170  $result = @$this->xpath->xpath_eval($xpath);
171  }
172 
173  if (!$result) {
174  $n = array();
175  return $n;
176  }
177 
178  if (!$result->nodeset) {
179  $n = array();
180  return $n;
181  }
182 
183  return $result->nodeset;
184  }
$result
$n
Definition: RandomTest.php:80

◆ registerNamespace()

Auth_Yadis_domxml::registerNamespace (   $prefix,
  $uri 
)

Definition at line 160 of file XML.php.

References xpath_register_ns().

161  {
162  return xpath_register_ns($this->xpath, $prefix, $uri);
163  }
xpath_register_ns($xpath_context, $prefix, $namespaceURI)
+ Here is the call graph for this function:

◆ setXML()

Auth_Yadis_domxml::setXML (   $xml_string)

Definition at line 145 of file XML.php.

References DOMXML_LOAD_PARSING, and domxml_open_mem().

146  {
147  $this->xml = $xml_string;
148  $this->doc = @domxml_open_mem($xml_string, DOMXML_LOAD_PARSING,
149  $this->errors);
150 
151  if (!$this->doc) {
152  return false;
153  }
154 
155  $this->xpath = $this->doc->xpath_new_context();
156 
157  return true;
158  }
const DOMXML_LOAD_PARSING
domxml_open_mem($str, $mode=DOMXML_LOAD_PARSING, &$error=NULL)
+ Here is the call graph for this function:

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