Sfoglia il codice sorgente

added XML::xmlToArray()

Piotr Labudda 8 anni fa
parent
commit
26a9f60fd2
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      SE/se-lib/XML.php

+ 4 - 1
SE/se-lib/XML.php

@@ -11,7 +11,10 @@ Lib::loadClass('Core_XmlWriter');
 class XML {
 class XML {
 
 
 	public static function xmlToArray($xml) {
 	public static function xmlToArray($xml) {
-
+		$z = new XMLReader();
+		if (!$z) throw new HttpException("Class XMLReader not installed", 500);
+		if (!$z->xml($xml)) throw new Exception("Failed to parse xml", 500);
+		return self::xmlReadToArray($z);
 	}
 	}
 
 
 	public static function readXmlFileToArray($filePath) {
 	public static function readXmlFileToArray($filePath) {