function AtoX in Bibliography Module 6
Same name and namespace in other branches
- 7 includes/biblio_xml.inc \AtoX()
- 7.2 includes/biblio.xml.inc \AtoX()
1 call to AtoX()
File
- ./
biblio_xml.inc, line 53
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;
}