示例#1
0
 static function loadXML($sContent)
 {
     //TODO prepareXmlValueToXml should only be applied between <anwv/> tags
     $sContent = AnwXml::prepareXmlValueToXml($sContent);
     //we don't want &gt; and &lt; to be converted in normal chars but keep html entities as they are
     $sContent = str_replace('&', '&amp;', $sContent);
     $oDoc = self::newDomDocument();
     libxml_use_internal_errors(true);
     $bTest = $oDoc->loadXML($sContent);
     if (!$bTest) {
         throw new AnwUnexpectedException("loadXML failed");
     }
     return $oDoc->documentElement;
 }