mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 01:24:27 +02:00
Work in progress: API XML output without templates
This commit is contained in:
parent
de6f48365b
commit
bc2c565060
2 changed files with 65 additions and 106 deletions
|
@ -27,8 +27,11 @@ class xml {
|
|||
foreach ($namespaces AS $nskey => $nsvalue)
|
||||
$key .= " xmlns".($nskey == "" ? "":":").$nskey.'="'.$nsvalue.'"';
|
||||
|
||||
$root = new SimpleXMLElement("<".$key."/>");
|
||||
self::from_array($value, $root, $remove_header, $namespaces, false);
|
||||
if (is_array($value)) {
|
||||
$root = new SimpleXMLElement("<".$key."/>");
|
||||
self::from_array($value, $root, $remove_header, $namespaces, false);
|
||||
} else
|
||||
$root = new SimpleXMLElement("<".$key.">".xmlify($value)."</".$key.">");
|
||||
|
||||
$dom = dom_import_simplexml($root)->ownerDocument;
|
||||
$dom->formatOutput = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue