ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
The XmlFragment element allows you to extract a portion of your xml tree, and get a well-formed xml string. More...
Public Member Functions | |
__construct ($xml) | |
getXml () | |
xmlSerialize (Writer $writer) | |
The xmlSerialize metod is called during xml writing. More... | |
Static Public Member Functions | |
static | xmlDeserialize (Reader $reader) |
The deserialize method is called during xml parsing. More... | |
Protected Attributes | |
$xml | |
The XmlFragment element allows you to extract a portion of your xml tree, and get a well-formed xml string.
This goes a bit beyond innerXml
and friends, as we'll also match all the correct namespaces.
Please note that the XML fragment:
Definition at line 23 of file XmlFragment.php.
Sabre\Xml\Element\XmlFragment::__construct | ( | $xml | ) |
Sabre\Xml\Element\XmlFragment::getXml | ( | ) |
Definition at line 33 of file XmlFragment.php.
References Sabre\Xml\Element\XmlFragment\$xml.
Referenced by Sabre\Xml\Element\XmlFragment\xmlSerialize().
|
static |
The deserialize method is called during xml parsing.
This method is called statictly, this is because in theory this method may be used as a type of constructor, or factory method.
Often you want to return an instance of the current class, but you are free to return other data as well.
You are responsible for advancing the reader to the next element. Not doing anything will result in a never-ending loop.
If you just want to skip parsing for this element altogether, you can just call $reader->next();
$reader->parseInnerTree() will parse the entire sub-tree, and advance to the next element.
Reader | $reader |
Implements Sabre\Xml\XmlDeserializable.
Definition at line 139 of file XmlFragment.php.
References $result.
Sabre\Xml\Element\XmlFragment::xmlSerialize | ( | Writer | $writer | ) |
The xmlSerialize metod is called during xml writing.
Use the $writer argument to write its own xml serialization.
An important note: do not create a parent element. Any element implementing XmlSerializble should only ever write what's considered its 'inner xml'.
The parent of the current element is responsible for writing a containing element.
This allows serializers to be re-used for different element names.
If you are opening new elements, you must also close them again.
Writer | $writer |
Implements Sabre\Xml\XmlSerializable.
Definition at line 58 of file XmlFragment.php.
References $reader, Sabre\Xml\Element\XmlFragment\$xml, Sabre\Xml\Element\XmlFragment\getXml(), Sabre\Xml\Writer\startElement(), and Sabre\Xml\Writer\writeAttribute().
|
protected |
Definition at line 25 of file XmlFragment.php.
Referenced by Sabre\Xml\Element\XmlFragment\__construct(), Sabre\Xml\Element\XmlFragment\getXml(), Sabre\DAV\Xml\Property\Complex\xmlDeserialize(), and Sabre\Xml\Element\XmlFragment\xmlSerialize().