Zend\Json\Json::_processXml
_processXml - Contains the logic for xml2json
The logic in this function is a recursive one. The main caller of this function (i.e. fromXml) needs to provide only the first two parameters i.e. the SimpleXMLElement object and the flag for ignoring or not ignoring XML attributes. The third parameter will be used internally within this function during the recursive calls. This function converts the SimpleXMLElement object into a PHP array by calling a recursive (protected static) function in this class. Once all the XML elements are stored in the PHP array, it is returned to the caller.
Signature
protected function _processXml(SimpleXMLElement
$simpleXmlElementObject,
[bool
$ignoreXmlAttributes = 0,
[integer
$recursionDepth = 0]] )
Parameters
$simpleXmlElementObject
— object
$ignoreXmlAttributes
— object
$recursionDepth
— integer
Returns
- array
Errors/Exceptions
-
RecursionException
- if the XML tree is deeper than the allowed limit.