|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
The Reader class expands upon PHP's built-in XMLReader. More...
Inheritance diagram for Sabre\Xml\Reader:
Collaboration diagram for Sabre\Xml\Reader:Public Member Functions | |
| getClark () | |
| Returns the current nodename in clark-notation. More... | |
| parse () | |
| Reads the entire document. More... | |
| parseGetElements (array $elementMap=null) | |
| parseGetElements parses everything in the current sub-tree, and returns a an array of elements. More... | |
| parseInnerTree (array $elementMap=null) | |
| Parses all elements below the current element. More... | |
| readText () | |
| Reads all text below the current element, and returns this as a string. More... | |
| parseCurrentElement () | |
| Parses the current XML element. More... | |
| parseAttributes () | |
| Grabs all the attributes from the current element, and returns them as a key-value array. More... | |
| getDeserializerForElementName ($name) | |
| Returns the function that should be used to parse the element identified by it's clark-notation name. More... | |
The Reader class expands upon PHP's built-in XMLReader.
The intended usage, is to assign certain XML elements to PHP classes. These need to be registered using the $elementMap public property.
After this is done, a single call to parse() will parse the entire document, and delegate sub-sections of the document to element classes.
Definition at line 20 of file Reader.php.
| Sabre\Xml\Reader::getClark | ( | ) |
Returns the current nodename in clark-notation.
For example: "{http://www.w3.org/2005/Atom}feed". Or if no namespace is defined: "{}feed".
This method returns null if we're not currently on an element.
Definition at line 34 of file Reader.php.
Referenced by Sabre\Xml\Reader\parseAttributes(), and Sabre\Xml\Reader\parseCurrentElement().
Here is the caller graph for this function:| Sabre\Xml\Reader::getDeserializerForElementName | ( | $name | ) |
Returns the function that should be used to parse the element identified by it's clark-notation name.
| string | $name |
Definition at line 300 of file Reader.php.
Referenced by Sabre\Xml\Reader\parseCurrentElement().
Here is the caller graph for this function:| Sabre\Xml\Reader::parse | ( | ) |
Reads the entire document.
This function returns an array with the following three elements:
This function will also disable the standard libxml error handler (which usually just results in PHP errors), and throw exceptions instead.
Definition at line 57 of file Reader.php.
References $errors, $result, and Sabre\Xml\Reader\parseCurrentElement().
Here is the call graph for this function:| Sabre\Xml\Reader::parseAttributes | ( | ) |
Grabs all the attributes from the current element, and returns them as a key-value array.
If the attributes are part of the same namespace, they will simply be short keys. If they are defined on a different namespace, the attribute name will be retured in clark-notation.
Definition at line 268 of file Reader.php.
References $attributes, $name, and Sabre\Xml\Reader\getClark().
Referenced by Sabre\Xml\Reader\parseCurrentElement().
Here is the call graph for this function:
Here is the caller graph for this function:| Sabre\Xml\Reader::parseCurrentElement | ( | ) |
Parses the current XML element.
This method returns arn array with 3 properties:
Definition at line 235 of file Reader.php.
References $attributes, $name, Sabre\Xml\Reader\getClark(), Sabre\Xml\Reader\getDeserializerForElementName(), and Sabre\Xml\Reader\parseAttributes().
Referenced by Sabre\Xml\Reader\parse(), and Sabre\Xml\Reader\parseInnerTree().
Here is the call graph for this function:
Here is the caller graph for this function:| Sabre\Xml\Reader::parseGetElements | ( | array | $elementMap = null | ) |
parseGetElements parses everything in the current sub-tree, and returns a an array of elements.
Each element has a 'name', 'value' and 'attributes' key.
If the the element didn't contain sub-elements, an empty array is always returned. If there was any text inside the element, it will be discarded.
If the $elementMap argument is specified, the existing elementMap will be overridden while parsing the tree, and restored after this process.
| array | $elementMap |
Definition at line 105 of file Reader.php.
References $result, and Sabre\Xml\Reader\parseInnerTree().
Here is the call graph for this function:| Sabre\Xml\Reader::parseInnerTree | ( | array | $elementMap = null | ) |
Parses all elements below the current element.
This method will return a string if this was a text-node, or an array if there were sub-elements.
If there's both text and sub-elements, the text will be discarded.
If the $elementMap argument is specified, the existing elementMap will be overridden while parsing the tree, and restored after this process.
| array | $elementMap |
Definition at line 129 of file Reader.php.
References $errors, $text, Sabre\Xml\Reader\parseCurrentElement(), Sabre\Xml\popContext(), and Sabre\Xml\pushContext().
Referenced by Sabre\Xml\Reader\parseGetElements().
Here is the call graph for this function:
Here is the caller graph for this function:| Sabre\Xml\Reader::readText | ( | ) |
Reads all text below the current element, and returns this as a string.
Definition at line 211 of file Reader.php.
References $result.