- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
- Класс: CIBlockCMLExport
- Вызов: CIBlockCMLExport::formatXMLNode
function formatXMLNode($level, $tagName, $value)
{
if(is_array($value))
{
$xmlValue = "";
foreach($value as $k => $v)
{
if($k)
$xmlValue .= "n".rtrim($this->formatXMLNode($level+1, $k, $v), "n");
}
$xmlValue .= "n".str_repeat("t", $level);
}
else
{
$xmlValue = htmlspecialcharsbx($value);
}
return str_repeat("t", $level)."<".$tagName.">".$xmlValue."".$tagName.">n";
}