You are here

LingotekXMLElement.php in Lingotek Translation 7.6

Same filename and directory in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekXMLElement.php

Defines LingotekXMLElement

File

lib/Drupal/lingotek/LingotekXMLElement.php
View source
<?php

/**
 * @file
 * Defines LingotekXMLElement
 */

/**
 * An extension of SimpleXMLElement to add CDATA
 */
class LingotekXMLElement extends SimpleXMLElement {
  public function addCData($text) {
    $xml = dom_import_simplexml($this);
    $doc = $xml->ownerDocument;
    $xml
      ->appendChild($doc
      ->createCDATASection($text));
  }

}

Classes

Namesort descending Description
LingotekXMLElement An extension of SimpleXMLElement to add CDATA