Example #1
0
 /**
  * @param bool $bSplitLines
  * @return string
  */
 public function ToString($bSplitLines = false)
 {
     $sOutStr = '<' . '?' . 'xml version="1.0" encoding="utf-8"?' . '>';
     if ($bSplitLines) {
         $sOutStr .= "\r\n";
     }
     if (null !== $this->XmlRoot) {
         $sOutStr .= $this->XmlRoot->ToString($bSplitLines);
     }
     return $sOutStr;
 }
Example #2
0
 /**
  * @param CXmlDomNode $oXmlTree
  * @param string $sParentNode = ''
  *
  * @return void
  */
 protected function parseXmlToArray(CXmlDomNode &$oXmlTree, $sParentNode = '')
 {
     $oXml = new SimpleXMLElement($oXmlTree->ToString());
     $this->aContainer[$sParentNode] = array();
     foreach ($oXml as $oElement) {
         $aElement = array();
         foreach ($oElement as $oValue) {
             $aElement[$oValue->getName()] = (string) $oValue;
         }
         $this->aContainer[$sParentNode][$oElement->getName()] = $aElement;
     }
 }