ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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)
 Set this parser object's XML payload.
 registerNamespace ($prefix, $uri)
 Register a namespace with the XML parser.
evalXPath ($xpath, $node=null)
 Evaluate an XPath expression and return the resulting node list.
 content ($node)
 Return the textual content of a specified node.
 attributes ($node)
 Return the attributes of a specified 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.

Detailed Description

Definition at line 219 of file XML.php.

Member Function Documentation

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.

References $result.

{
if ($node) {
$arr = $node->attributes;
$result = array();
if ($arr) {
for ($i = 0; $i < $arr->length; $i++) {
$node = $arr->item($i);
$result[$node->nodeName] = $node->nodeValue;
}
}
return $result;
}
}
Auth_Yadis_dom::Auth_Yadis_dom ( )

Definition at line 220 of file XML.php.

{
$this->xml = null;
$this->doc = null;
$this->xpath = null;
$this->errors = array();
}
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.

{
if ($node) {
return $node->textContent;
}
}
& 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.

References $n, and $result.

{
if ($node) {
$result = @$this->xpath->query($xpath, $node);
} else {
$result = @$this->xpath->query($xpath);
}
$n = array();
if (!$result) {
return $n;
}
for ($i = 0; $i < $result->length; $i++) {
$n[] = $result->item($i);
}
return $n;
}
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.

{
return $this->xpath->registerNamespace($prefix, $uri);
}
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.

{
$this->xml = $xml_string;
$this->doc = new DOMDocument;
if (!$this->doc) {
return false;
}
if (!@$this->doc->loadXML($xml_string)) {
return false;
}
$this->xpath = new DOMXPath($this->doc);
if ($this->xpath) {
return true;
} else {
return false;
}
}

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