diff --git a/lib/Doctrine/Parser/Xml.php b/lib/Doctrine/Parser/Xml.php index cb08a0ae4..5fa3c12a0 100644 --- a/lib/Doctrine/Parser/Xml.php +++ b/lib/Doctrine/Parser/Xml.php @@ -33,23 +33,22 @@ class Doctrine_Parser_Xml extends Doctrine_Parser { public function arrayToXml($data, $rootNodeName = 'data', $xml = null) { - if ($xml === null) { - $xml = new SimpleXmlElement("<$rootNodeName/>"); - } - - foreach($data as $key => $value) - { - if (is_array($value)) { - $node = $xml->addChild($key); - - $this->arrayToXml($value, $rootNodeName, $node); - } else { - $value = htmlentities($value); - - $xml->addChild($key, $value); + if ($xml === null) { + $xml = new SimpleXmlElement("<$rootNodeName/>"); } - } + foreach($data as $key => $value) + { + if (is_array($value)) { + $node = $xml->addChild($key); + + $this->arrayToXml($value, $rootNodeName, $node); + } else { + $value = htmlentities($value); + + $xml->addChild($key, $value); + } + } return $xml->asXML(); } diff --git a/lib/Doctrine/Resource/Collection.php b/lib/Doctrine/Resource/Collection.php index 431701590..cc3f0f2cd 100644 --- a/lib/Doctrine/Resource/Collection.php +++ b/lib/Doctrine/Resource/Collection.php @@ -126,4 +126,4 @@ class Doctrine_Resource_Collection extends Doctrine_Resource_Access implements C $record->delete(); } } -} +} \ No newline at end of file