original_string: public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NONET)
      {
          // remove the default namespace if it's the only namespace to make XPath expressions simpler
          if (!preg_match('/xmlns:/', $content)) {
              $content = str_replace('xmlns', 'ns', $content);
          }
  
          $internalErrors = libxml_use_internal_errors(true);
          $disableEntities = libxml_disable_entity_loader(true);
  
          $dom = new \DOMDocument('1.0', $charset);
          $dom->validateOnParse = true;
  
          if ('' !== trim($content)) {
              @$dom->loadXML($content, $options);
          }
  
          libxml_use_internal_errors($internalErrors);
          libxml_disable_entity_loader($disableEntities);
  
          $this->addDocument($dom);
  
          $this->isHtml = false;
      }
code: public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NONET)
      {
          // remove the default namespace if it's the only namespace to make XPath expressions simpler
          if (!preg_match('/xmlns:/', $content)) {
              $content = str_replace('xmlns', 'ns', $content);
          }
  
          $internalErrors = libxml_use_internal_errors(true);
          $disableEntities = libxml_disable_entity_loader(true);
  
          $dom = new \DOMDocument('1.0', $charset);
          $dom->validateOnParse = true;
  
          if ('' !== trim($content)) {
              @$dom->loadXML($content, $options);
          }
  
          libxml_use_internal_errors($internalErrors);
          libxml_disable_entity_loader($disableEntities);
  
          $this->addDocument($dom);
  
          $this->isHtml = false;
      }
code_tokens: public function addXmlContent ( $ content , $ charset = 'UTF-8' , $ options = LIBXML_NONET ) { // remove the default namespace if it's the only namespace to make XPath expressions simpler if ( ! preg_match ( '/xmlns:/' , $ content ) ) { $ content = str_replace ( 'xmlns' , 'ns' , $ content ) ; } $ internalErrors = libxml_use_internal_errors ( true ) ; $ disableEntities = libxml_disable_entity_loader ( true ) ; $ dom = new \ DOMDocument ( '1.0' , $ charset ) ; $ dom -> validateOnParse = true ; if ( '' !== trim ( $ content ) ) { @ $ dom -> loadXML ( $ content , $ options ) ; } libxml_use_internal_errors ( $ internalErrors ) ; libxml_disable_entity_loader ( $ disableEntities ) ; $ this -> addDocument ( $ dom ) ; $ this -> isHtml = false ; }
docstring: Adds an XML content to the list of nodes.
  
  The libxml errors are disabled when the content is parsed.
  
  If you want to get parsing errors, be sure to enable
  internal errors via libxml_use_internal_errors(true)
  and then, get the errors via libxml_get_errors(). Be
  sure to clear errors with libxml_clear_errors() afterward.
  
  @param string $content The XML content
  @param string $charset The charset
  @param int    $options Bitwise OR of the libxml option constants
  LIBXML_PARSEHUGE is dangerous, see
  http://symfony.com/blog/security-release-symfony-2-0-17-released
docstring_tokens: Adds an XML content to the list of nodes .