ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
The Reader class expands upon PHP's built-in XMLReader. More...
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\Deserializer\enum(), Sabre\Xml\Deserializer\keyValue(), Sabre\Xml\Reader\parseAttributes(), Sabre\DAV\Xml\Element\Prop\parseCurrentElement(), Sabre\Xml\Reader\parseCurrentElement(), Sabre\DAV\Xml\Element\Prop\xmlDeserialize(), and Sabre\DAV\Xml\Element\Response\xmlDeserialize().
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().
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().
Referenced by Sabre\Xml\ReaderTest\testParseGetElements(), and Sabre\Xml\ReaderTest\testParseGetElementsNoElements().
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(), Sabre\CalDAV\Xml\Filter\ParamFilter\xmlDeserialize(), Sabre\CardDAV\Xml\Filter\PropFilter\xmlDeserialize(), Sabre\CardDAV\Xml\Filter\ParamFilter\xmlDeserialize(), Sabre\CalDAV\Xml\Filter\PropFilter\xmlDeserialize(), and Sabre\CalDAV\Xml\Filter\CompFilter\xmlDeserialize().
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\Deserializer\keyValue(), Sabre\Xml\Reader\parse(), Sabre\Xml\Reader\parseInnerTree(), Sabre\Xml\Deserializer\valueObject(), and Sabre\DAV\Xml\Element\Response\xmlDeserialize().
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().
Referenced by Sabre\Xml\Deserializer\repeatingElements(), Sabre\Xml\ReaderTest\testParseGetElements(), Sabre\Xml\ReaderTest\testParseGetElementsNoElements(), and Sabre\CalDAV\Xml\Request\Share\xmlDeserialize().
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(), Sabre\CalDAV\Xml\Filter\ParamFilter\xmlDeserialize(), Sabre\CardDAV\Xml\Filter\ParamFilter\xmlDeserialize(), Sabre\CardDAV\Xml\Filter\AddressData\xmlDeserialize(), Sabre\CardDAV\Xml\Filter\PropFilter\xmlDeserialize(), Sabre\CalDAV\Xml\Filter\CompFilter\xmlDeserialize(), Sabre\CalDAV\Xml\Filter\PropFilter\xmlDeserialize(), Sabre\CalDAV\Xml\Filter\CalendarData\xmlDeserialize(), Sabre\DAVACL\Xml\Request\ExpandPropertyReport\xmlDeserialize(), Sabre\CalDAV\Xml\Request\FreeBusyQueryReport\xmlDeserialize(), Sabre\CalDAV\Xml\Request\MkCalendar\xmlDeserialize(), Sabre\DAV\Xml\Request\MkCol\xmlDeserialize(), Sabre\DAV\Xml\Request\ShareResource\xmlDeserialize(), Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport\xmlDeserialize(), Sabre\DAVACL\Xml\Request\PrincipalPropertySearchReport\xmlDeserialize(), Sabre\CalDAV\Xml\Request\CalendarMultiGetReport\xmlDeserialize(), Sabre\CalDAV\Xml\Request\CalendarQueryReport\xmlDeserialize(), Sabre\DAV\Xml\Request\PropPatch\xmlDeserialize(), Sabre\DAV\Xml\Property\GetLastModified\xmlDeserialize(), Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet\xmlDeserialize(), Sabre\CardDAV\Xml\Request\AddressBookQueryReport\xmlDeserialize(), Sabre\DAV\Xml\Response\MultiStatus\xmlDeserialize(), Sabre\DAVACL\Xml\Property\CurrentUserPrivilegeSet\xmlDeserialize(), Sabre\DAV\Xml\Property\ShareAccess\xmlDeserialize(), Sabre\DAV\Xml\Property\Href\xmlDeserialize(), Sabre\DAVACL\Xml\Property\Acl\xmlDeserialize(), Sabre\DAVACL\Xml\Property\Principal\xmlDeserialize(), and Sabre\DAV\Xml\Element\Response\xmlDeserialize().
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.