Parser icon indicating copy to clipboard operation
Parser copied to clipboard

XML parsing exception

Open ashtech-krishna opened this issue 9 years ago • 3 comments

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.

ashtech-krishna avatar Apr 19 '16 08:04 ashtech-krishna

Do you have some sample XML, that you trying to parse?

nathanmac avatar Apr 19 '16 15:04 nathanmac

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(' Jack Smith Jane Doe Hello World '); echo "
XML:"; print_r($parsed);

JSON part is working fine, but not xml.

ashtech-krishna avatar Apr 21 '16 08:04 ashtech-krishna

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...)

danhunsaker avatar Jul 02 '16 20:07 danhunsaker