You are here

public function LingotekXMLElement::addCData in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lib/Drupal/lingotek/LingotekXMLElement.php \LingotekXMLElement::addCData()

File

lib/Drupal/lingotek/LingotekXMLElement.php, line 12
Defines LingotekXMLElement

Class

LingotekXMLElement
An extension of SimpleXMLElement to add CDATA

Code

public function addCData($text) {
  $xml = dom_import_simplexml($this);
  $doc = $xml->ownerDocument;
  $xml
    ->appendChild($doc
    ->createCDATASection($text));
}