XML parsing exception
Hello sir, I am trying to parse XML response using this library. But while parsing I am having a ParserException in XML.php line 37: 'Failed To Parse XML'. Thanks in advance.
Do you have some sample XML, that you trying to parse?
I am trying to parse the sample xml which is provided here only.
In my controller parsing code is like,
$parser = new \Nathanmac\Utilities\Parser\Parser();
$parsedjson = $parser->json('
{
"message": {
"to": "Jack Smith",
"from": "Jane Doe",
"subject": "Hello World",
"body": "Hello, whats going on..."
}
}');
echo "JSON:"; print_r($parsedjson);
$parsed = $parser->xml('
XML:"; print_r($parsed);
JSON part is working fine, but not xml.
When posting code on GitHub, please indent it four spaces, or wrap it in a code fence, so it doesn't get mangled by the formatter. Also, take advantage of the Preview tab to ensure your posts look right before hitting "Comment".
(sample code fence:)
```php
// ...code here...
```
(I only say this because we can't actually read the sample you posted...)