Source for file xml.php
Documentation is available at xml.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* XML format handler for JRegistry.
* @package Joomla.Platform
* Converts an object into an XML formatted string.
* - If more than two levels of nested groups are necessary, since INI is not
* useful, XML or another format should be used.
* @param object $object Data source object.
* @param array $options Options used by the formatter.
* @return string XML formatted string.
$rootName =
(isset
($options['name'])) ?
$options['name'] :
'registry';
$nodeName =
(isset
($options['nodeName'])) ?
$options['nodeName'] :
'node';
// Iterate over the object members.
* Parse a XML formatted string and convert it into an object.
* @param string $data XML formatted string to convert.
* @param array $options Options used by the formatter.
* @return object Data object.
foreach ($xml->children() as $node)
* Method to get a PHP native value for a SimpleXMLElement object. -- called recursively
* @param object $node SimpleXMLElement object for which to get the native value.
* @return mixed Native value of the SimpleXMLElement object.
foreach ($node->children() as $child)
foreach ($node->children() as $child)
* Method to build a level of the XML string -- called recursively
* @param SimpleXMLElement $node SimpleXMLElement object to attach children.
* @param object $var Object that represents a node of the XML document.
* @param string $nodeName The name to use for node elements.
protected function getXmlChildren(SimpleXMLElement $node, $var, $nodeName)
// Iterate over the object members.
foreach ((array)
$var as $k =>
$v)
$n =
$node->addChild($nodeName, $v);
$n->addAttribute('name', $k);
$n->addAttribute('type', gettype($v));
$n =
$node->addChild($nodeName);
$n->addAttribute('name', $k);
$n->addAttribute('type', gettype($v));
Documentation generated on Tue, 19 Nov 2013 15:18:36 +0100 by phpDocumentor 1.4.3