Formatting fixes
This commit is contained in:
parent
12cc664bf1
commit
4cd00271df
@ -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("<?xml version=\"1.0\" encoding=\"utf-8\"?><$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("<?xml version=\"1.0\" encoding=\"utf-8\"?><$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();
|
||||
}
|
||||
|
@ -126,4 +126,4 @@ class Doctrine_Resource_Collection extends Doctrine_Resource_Access implements C
|
||||
$record->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user