function AtoX in Bibliography Module 7.2
Same name and namespace in other branches
- 6 biblio_xml.inc \AtoX()
- 7 includes/biblio_xml.inc \AtoX()
1 call to AtoX()
- biblio_xml_export in includes/
biblio.xml.inc
File
- includes/
biblio.xml.inc, line 52
Code
function AtoX($array, $DOM = null, $root = null) {
foreach ($array as $key => $value) {
if ($key == 'biblio_contributors') {
$name = 'contributor';
}
if (is_numeric($key)) {
$key = 'c_' . $key;
}
if (is_array($value) && count($value)) {
$subroot = $root
->appendChild($DOM
->createElement($key));
AtoX($value, $DOM, $subroot);
}
else {
if (!empty($value)) {
$root
->appendChild($DOM
->createElement($key, htmlspecialchars($value, ENT_QUOTES)));
}
}
}
return $DOM;
}