function lingotek_attach_xml in Lingotek Translation 7.7
Same name and namespace in other branches
- 7.6 lingotek.module \lingotek_attach_xml()
1 call to lingotek_attach_xml()
File
- ./
lingotek.module, line 2988
Code
function lingotek_attach_xml($xml, $name, $value) {
if (is_object($value) || is_array($value)) {
$sub_xml = $xml
->addChild($name);
foreach ($value as $k => $v) {
lingotek_attach_xml($sub_xml, $k, $v);
}
}
else {
$sub_xml = $xml
->addChild($name);
if ($value) {
$element = $sub_xml
->addChild('element');
//TODO: encode $value to prevent xml corruption.
$element
->addCData(lingotek_filter_placeholders($value));
}
}
}