Populates the properties with a specified XML string based on ATOM
ENTRY schema.

@param string $xmlString An XML string representing a rule info instance
965774
public function parseXml($xmlString)
    {
        $this->_entry->parseXml($xmlString);
        $content = $this->_entry->getContent();
        if (is_null($content)) {
            $this->_ruleDescription = null;
        } else {
            $this->_ruleDescription = RuleDescription::create($content->getText());
        }
    }
1076372
public static function is_xml($string) {
        if (!defined('LIBXML_COMPACT')) {
            throw new \Exception('libxml is required to use Str::is_xml()');
        }

        $internal_errors = libxml_use_internal_errors();
        libxml_use_internal_errors(true);
        $result = simplexml_load_string($string) !== false;
        libxml_use_internal_errors($internal_errors);

        return $result;
    }
306075
public static String serialize(String xmlString) {
        StringWriter sw = new StringWriter();
        serialize(asStreamSource(xmlString), sw);
        return sw.toString();
    }
1054177
public function parseXml($xmlString)
    {
        $personXml = simplexml_load_string($xmlString);
        $personArray = (array) $personXml;

        if (array_key_exists('name', $personArray)) {
            $this->name = (string) $personArray['name'];
        }

        if (array_key_exists('uri', $personArray)) {
            $this->uri = (string) $personArray['uri'];
        }

        if (array_key_exists('email', $personArray)) {
            $this->email = (string) $personArray['email'];
        }
    }
425601
public function xmlShouldBeValid($xmlFile, $schemaPath)
    {
        $dom = new DomDocument();
        $dom->load($this->workingDir . '/' . $xmlFile);

        $dom->schemaValidate(__DIR__ . '/schema/' . $schemaPath);
    }
642221
public function splitIntoSeparateProperties($propertiesString)
    {
        $propertiesString = $this->cleanup($propertiesString);

        $properties = (array) explode(';', $propertiesString);
        $keysToRemove = array();
        $numberOfProperties = count($properties);

        for ($i = 0; $i < $numberOfProperties; $i++) {
            $properties[$i] = trim($properties[$i]);

            // if the new property begins with base64 it is part of the current property
            if (isset($properties[$i + 1]) && strpos(trim($properties[$i + 1]), 'base64,') === 0) {
                $properties[$i] .= ';' . trim($properties[$i + 1]);
                $keysToRemove[] = $i + 1;
            }
        }

        if (!empty($keysToRemove)) {
            foreach ($keysToRemove as $key) {
                unset($properties[$key]);
            }
        }

        return array_values($properties);
    }
668397
public static function xml2array($xmlstring)
    {
        $result = [];
        self::normalizeSimpleXML(simplexml_load_string($xmlstring, null, LIBXML_NOCDATA), $result);

        return $result;
    }
1266617
@Override
    public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
        internalStmt.setSQLXML(parameterIndex, xmlObject);
    }
903507
function decodeXML( $xmlString )
    {
        $dom = new DOMDocument( '1.0', 'utf-8' );
        $success = $dom->loadXML( $xmlString );
        if ( $xmlString != "" )
        {
            // set the name of the node
            $nameArray = $dom->getElementsByTagName( "name" );
            $this->setName( $nameArray->item( 0 )->textContent );

            $columnsNode = $dom->getElementsByTagName( "columns" )->item( 0 );
            $numColumns = $columnsNode->getAttribute( 'number');

            $rowsNode = $dom->getElementsByTagName( "rows" )->item( 0 );
            $numRows = $rowsNode->getAttribute( 'number' );

            $namedColumns = $dom->getElementsByTagName( "column" );
            $namedColumnList = array();
            if ( $namedColumns->length > 0 )
            {
                foreach ( $namedColumns as $namedColumn )
                {
                    $columnName = $namedColumn->textContent;
                    $columnID = $namedColumn->getAttribute( 'id' );
                    $columnNumber = $namedColumn->getAttribute( 'num' );
                    $namedColumnList[$columnNumber] = array( 'name' => $columnName,
                                                             'column_number' => $columnNumber,
                                                             'column_id' => $columnID );
                }
            }
            $cellNodes = $dom->getElementsByTagName( "c" );
            $cellList = array();
            foreach ( $cellNodes as $cellNode )
            {
                $cellList[] = $cellNode->textContent;
            }

            $rows = array( 'sequential' => array() );
            $sequentialRows = array();

            for ( $i = 1; $i <= $numRows; $i++ )
            {
                $row = array( 'identifier' => 'row_' . $i ,
                              'name' => 'Row_' . $i );
                $rowColumns = array();
                for ( $j = 1; $j <= $numColumns; $j++ )
                {
                    $rowColumns[] = $cellList[ ($i-1) * $numColumns + $j-1];
                }
                $row['columns'] = $rowColumns;
                $sequentialRows[] = $row;
            }
            $rows['sequential'] = $sequentialRows;

            $columns = array( 'sequential' => array(),
                              'id' => array() );
            $sequentialColumns = array();
            $idColumns = array();

            for ( $i = 0; $i < $numColumns; $i++ )
            {
                if ( isset( $column ) )
                    unset( $column );
                $column = array();
                if ( isset( $namedColumnList[$i] ) && is_array( $namedColumnList[$i] ) )
                {
                    $column = array( 'identifier' => $namedColumnList[$i]['column_id'],
                                     'index' => $i,
                                     'name' => $namedColumnList[$i]['name'] );
                }
                else
                {
                    $column = array( 'identifier' => 'col_' . ($i + 1),
                                     'index' => $i,
                                     'name' => 'Col_' . ($i + 1) );

                }

                $columnRows = array();
                for( $j = 0; $j < $numRows; $j++ )
                {
                    $columnRows[] = $sequentialRows[$j]['columns'][$i];
                }
                $column['rows'] = $columnRows;
                $sequentialColumns[] = $column;
                $idColumns[$column['identifier']] = $column;
            }
            $columns['sequential'] = $sequentialColumns;
            $columns['id'] = $idColumns;

            $matrix = array( 'rows' => $rows,
                             'columns' => $columns,
                             'cells' => $cellList );

            $this->Matrix = $matrix;
            $this->NumRows = $numRows;
            $this->NumColumns = $numColumns;
            $this->Cells = $cellList;
        }
        else
        {
            $this->Cells = array();
            $this->Matrix = array();
        }
    }
1282769
public function saveXML(string $XMLfile): void
    {
        $file = new FileManager();
        $file->saveLittleFile($this->xmlData, $XMLfile);
    }
602094
public function parseString($xml, $type)
    {
        // parse xml string
        if ($xml != "") {

            // Create an XML parser.
            $this->parser = xml_parser_create();
            // Set the options for parsing the XML data.
            xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);

            // Set the object for the parser.
            xml_set_object($this->parser, $this);

            // Set the element handlers for the parser.
            if ($type == "schema") {
                xml_set_element_handler($this->parser, 'schemaStartElement', 'schemaEndElement');
                xml_set_character_data_handler($this->parser, 'schemaCharacterData');
            } elseif ($type == "xml") {
                xml_set_element_handler($this->parser, 'xmlStartElement', 'xmlEndElement');
                xml_set_character_data_handler($this->parser, 'xmlCharacterData');
            }

            // Parse the XML file.
            if (!xml_parse($this->parser, $xml, true)) {
                // Display an error message.
                $errstr = sprintf(
                    'XML error parsing XML schema on line %d: %s',
                    xml_get_current_line_number($this->parser),
                    xml_error_string(xml_get_error_code($this->parser))
                );
                $this->debug($errstr);
                $this->debug("XML payload:\n" . $xml);
                $this->setError($errstr);
            }

            xml_parser_free($this->parser);
        } else {
            $this->debug('no xml passed to parseString()!!');
            $this->setError('no xml passed to parseString()!!');
        }
    }
882412
public void setXml(String s) {
        assertNotNull(s);
        xml = s;
        setLength(s.length());
    }
1180344
public function loadXMLString(string $xmlString): DOMDocument
    {
        $document = new DOMDocument();

        libxml_use_internal_errors(true);
        libxml_clear_errors();

        // Options:
        // - substitute entities
        // - disable network access
        // - relax parser limits for document size/complexity
        $success = $document->loadXML($xmlString, LIBXML_NOENT | LIBXML_NONET | LIBXML_PARSEHUGE);
        if (!$success) {
            throw new InvalidXmlException('$xmlString', libxml_get_errors());
        }

        return $document;
    }
746044
public static function innerXML(\DOMNode $node, $xmlstring)
    {
        $xmlstring = str_replace("<br>", "<br/>", $xmlstring);
        $len = strlen($xmlstring);
        $endText = "";
        $close = strrpos($xmlstring, '>');
        if ($close !== false && $close < $len - 1) {
            $endText = substr($xmlstring, $close + 1);
            $xmlstring = substr($xmlstring, 0, $close + 1);
        }
        $open = strpos($xmlstring, '<');
        if ($open === false) {
            $node->nodeValue .= $xmlstring;
        } else {
            if ($open > 0) {
                $text = substr($xmlstring, 0, $open);
                $xmlstring = substr($xmlstring, $open);
                $node->nodeValue .= $text;
            }
            $dom = XmlUtil::getOwnerDocument($node);
            $xmlstring = "<rootxml>$xmlstring</rootxml>";
            $sxe = @simplexml_load_string($xmlstring);
            if ($sxe === false) {
                throw new XmlUtilException("Cannot load XML string.", 252);
            }
            $domSimpleXml = dom_import_simplexml($sxe);
            if (!$domSimpleXml) {
                throw new XmlUtilException("XML Parsing error.", 253);
            }
            $domSimpleXml = $dom->importNode($domSimpleXml, true);
            $childs = $domSimpleXml->childNodes->length;
            for ($i = 0; $i < $childs; $i++) {
                $node->appendChild($domSimpleXml->childNodes->item($i)->cloneNode(true));
            }
        }
        if (!empty($endText) && $endText != "") {
            $textNode = $dom->createTextNode($endText);
            $node->appendChild($textNode);
        }
        return $node->firstChild;
    }
726851
function(xmlString) {
        var error, parser, xmlDoc;
        if ((typeof Ti !== "undefined" && Ti !== null) && Ti.XML) {
          try {
            xmlDoc = Ti.XML.parseString(xmlString);
          } catch (_error) {
            error = _error;
            xmlDoc = null;
          }
          return xmlDoc;
        } else if (window.DOMParser != null) {
          try {
            parser = new window.DOMParser();
            xmlDoc = parser.parseFromString(xmlString, "text/xml");
          } catch (_error) {
            error = _error;
            xmlDoc = null;
          }
          return xmlDoc;
        } else if (window.ActiveXObject && window.GetObject) {
          xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
          xmlDoc.async = "false";
          try {
            xmlDoc.loadXML(xmlString);
          } catch (_error) {
            error = _error;
            xmlDoc = null;
          }
          return xmlDoc;
        } else {
          throw new Error("No XML parser available");
        }
      }
956385
public function array2xml(string $xmlField = '', ?string $dataField = null): void
    {
        $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><' . $xmlField . '/>');
        $this->createXml($xml, $this->arrayData, $dataField);
        $this->xmlData = $xml->asXML();
    }
197902
public static Element parse(String xmlString) throws IOException
   {
      try
      {
         return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
      }
      catch (IOException e)
      {
         ROOT_LOGGER.cannotParse(xmlString);
         throw e;
      }
   }