コード例 #1
0
ファイル: common.php プロジェクト: ashanrupasinghe/slbcv2
 /**
  * Get and parse file content to xml element
  *
  * @param string $xmlfile   Xml file path
  * @param bool   $array     Convert to array or not
  *
  * @return mixed NULL if load or parse file fail, Array if array is true, otherwise JSimpleXML
  */
 public static function getXML($xmlfile, $array = true)
 {
     /*
             $xml = JFactory::getXMLParser('Simple');
             if ($xml->loadFile($xmlfile)) {
                 if ($array)
                     return T3Common::xmltoarray($xml->document);
                 return $xml->document;
             }
             return null;
     */
     //$xml = JFactory::getXML ($xmlfile);
     if (!class_exists('JSimpleXML')) {
         t3import('core.joomla.simplexml');
     }
     $xml = new JSimpleXML();
     if ($xml->loadFile($xmlfile)) {
         if ($array) {
             return T3Common::xmltoarray($xml->document);
         }
         return $xml->document;
     }
     return null;
 }
コード例 #2
0
ファイル: common.php プロジェクト: rlee1962/diylegalcenter
 function getXML($xmlfile, $array = true)
 {
     $xml =& JFactory::getXMLParser('Simple');
     if ($xml->loadFile($xmlfile)) {
         if ($array) {
             return T3Common::xmltoarray($xml->document);
         }
         return $xml->document;
     }
     return null;
 }