Skip to content

Commit

Permalink
incorporated philipashlock#19
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Dec 6, 2019
1 parent 938f5d6 commit 62b9d47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion convert.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@
// Load XML file
$file = file_get_contents($arguments['filename']);

libxml_use_internal_errors(true);

$xml = str_replace('xmlns=', 'ns=', $file); //$string is a string that contains xml...

$xml = new SimpleXMLElement($xml);
//$xml = new SimpleXMLElement($xml);
try { $xml = new SimpleXMLElement($xml, LIBXML_COMPACT | LIBXML_PARSEHUGE); } catch (Exception $e) { echo $e; }

foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}

$result = $xml->xpath('page');
$count = 0;
Expand Down

0 comments on commit 62b9d47

Please sign in to comment.