ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 Set this parser object's XML payload. More...
 
 registerNamespace ($prefix, $uri)
 Register a namespace with the XML parser. 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...
 
- 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)

Return the attributes of a specified node.

Parameters
mixed$nodeA node object from a previous call to $this->evalXPath().
Returns
array $attrs An array mapping attribute names to values.

Reimplemented from Auth_Yadis_XMLParser.

Definition at line 283 of file XML.php.

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

References $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)

Return the textual content of a specified node.

Parameters
mixed$nodeA node object from a previous call to $this->evalXPath().
Returns
string $content The content of this node.

Reimplemented from Auth_Yadis_XMLParser.

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 
)

Evaluate an XPath expression and return the resulting node list.

This should be overridden by subclasses.

Parameters
string$xpathThe XPath expression to be evaluated.
mixed$nodeA node object resulting from a previous evalXPath call. This node, if specified, provides the context for the evaluation of this xpath expression.
Returns
array $node_list An array of matching opaque node objects to be used with other methods of this parser class.

Reimplemented from Auth_Yadis_XMLParser.

Definition at line 255 of file XML.php.

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 }
$n
Definition: RandomTest.php:80

References $n, and $result.

◆ registerNamespace()

Auth_Yadis_dom::registerNamespace (   $prefix,
  $uri 
)

Register a namespace with the XML parser.

This should be overridden by subclasses.

Parameters
string$prefixThe namespace prefix to appear in XML tag names.
string$uriThe namespace URI to be used to identify the namespace in the XML.
Returns
boolean $result True if the registration succeeded; false otherwise.

Reimplemented from Auth_Yadis_XMLParser.

Definition at line 250 of file XML.php.

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

◆ setXML()

Auth_Yadis_dom::setXML (   $xml_string)

Set this parser object's XML payload.

This should be overridden by subclasses.

Parameters
string$xml_stringThe XML string to pass to this object's XML parser.
Returns
boolean $result True if the initialization succeeded; false otherwise.

Reimplemented from Auth_Yadis_XMLParser.

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: