Skip to content

Commit 62b9d47

Browse files
committed
incorporated philipashlock#19
1 parent 938f5d6 commit 62b9d47

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

convert.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@
4444
// Load XML file
4545
$file = file_get_contents($arguments['filename']);
4646

47+
libxml_use_internal_errors(true);
48+
4749
$xml = str_replace('xmlns=', 'ns=', $file); //$string is a string that contains xml...
4850

49-
$xml = new SimpleXMLElement($xml);
51+
//$xml = new SimpleXMLElement($xml);
52+
try { $xml = new SimpleXMLElement($xml, LIBXML_COMPACT | LIBXML_PARSEHUGE); } catch (Exception $e) { echo $e; }
5053

54+
foreach(libxml_get_errors() as $error) {
55+
echo "\t", $error->message;
56+
}
5157

5258
$result = $xml->xpath('page');
5359
$count = 0;

0 commit comments

Comments
 (0)