ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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)
 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 136 of file XML.php.

Member Function Documentation

Auth_Yadis_domxml::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 193 of file XML.php.

References $result.

{
if ($node) {
$arr = $node->attributes();
$result = array();
if ($arr) {
foreach ($arr as $attrnode) {
$result[$attrnode->name] = $attrnode->value;
}
}
return $result;
}
}
Auth_Yadis_domxml::Auth_Yadis_domxml ( )

Definition at line 137 of file XML.php.

{
$this->xml = null;
$this->doc = null;
$this->xpath = null;
$this->errors = array();
}
Auth_Yadis_domxml::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 186 of file XML.php.

{
if ($node) {
return $node->get_content();
}
}
& Auth_Yadis_domxml::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 165 of file XML.php.

References $n, and $result.

{
if ($node) {
$result = @$this->xpath->xpath_eval($xpath, $node);
} else {
$result = @$this->xpath->xpath_eval($xpath);
}
if (!$result) {
$n = array();
return $n;
}
if (!$result->nodeset) {
$n = array();
return $n;
}
return $result->nodeset;
}
Auth_Yadis_domxml::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 160 of file XML.php.

References xpath_register_ns().

{
return xpath_register_ns($this->xpath, $prefix, $uri);
}

+ Here is the call graph for this function:

Auth_Yadis_domxml::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 145 of file XML.php.

References DOMXML_LOAD_PARSING, and domxml_open_mem().

{
$this->xml = $xml_string;
$this->doc = @domxml_open_mem($xml_string, DOMXML_LOAD_PARSING,
$this->errors);
if (!$this->doc) {
return false;
}
$this->xpath = $this->doc->xpath_new_context();
return true;
}

+ Here is the call graph for this function:


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