Employ a dedicated XML library to write XML files
This commit is contained in:
@ -169,7 +169,7 @@ function generateHelpTooltip(string $identifier, string $title, string $explica,
|
||||
function printDOMDocToXML(DOMDocument $xmlDoc) {
|
||||
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>' . $xmlDoc->saveXML($xmlDoc->documentElement);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -183,7 +183,15 @@ function printDOMDocToXML(DOMDocument $xmlDoc) {
|
||||
*/
|
||||
function createTextDomElement(DOMDocument $xmlDoc, string $tag, string $content):DOMElement {
|
||||
|
||||
$element = $xmlDoc->createElement($tag);
|
||||
try {
|
||||
$element = $xmlDoc->createElement($tag);
|
||||
}
|
||||
catch (DOMException $e) {
|
||||
print_r($e);
|
||||
print_r($tag);
|
||||
exit;
|
||||
}
|
||||
|
||||
$element->appendChild($xmlDoc->createTextNode($content));
|
||||
|
||||
return $element;
|
||||
|
Reference in New Issue
Block a user