ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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. 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 136 of file XML.php.

Member Function Documentation

◆ attributes()

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.

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

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

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.

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

◆ evalXPath()

& 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.

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

References $n, and $result.

◆ registerNamespace()

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.

161 {
162 return xpath_register_ns($this->xpath, $prefix, $uri);
163 }
xpath_register_ns($xpath_context, $prefix, $namespaceURI)

References xpath_register_ns().

+ Here is the call graph for this function:

◆ setXML()

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.

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)

References DOMXML_LOAD_PARSING, and domxml_open_mem().

+ Here is the call graph for this function:

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