Parser icon indicating copy to clipboard operation
Parser copied to clipboard

Parsing XML Example

Open cpb2948 opened this issue 8 years ago • 5 comments

Is it possible to just get a complete example of parsing XML for a specific key using the Facade?

Currently I'm able to convert the whole XML structure into an array using

$xml = Parser::xml($response);

however is there a way to specific pull keys? Using the documentation it would be something like

Parser::get('key', 'default value');

but I don't know how to tie it all together.

Thanks

cpb2948 avatar Feb 15 '17 15:02 cpb2948

Please read through the other most recent issues. This topic has come up a lot in the last week or so.

danhunsaker avatar Feb 15 '17 15:02 danhunsaker

Yeah documentation SUCKS. cannot figure out how to use get function.

Tommixoft avatar Jun 05 '17 18:06 Tommixoft

Basically, Parser::get(), along with all the other helper methods, can only look at the HTTP request body. If the data you want to parse isn't in there, you can't use the helpers. They cannot be used on variables.

danhunsaker avatar Jun 05 '17 20:06 danhunsaker

OH.... now it's more logic. I think you should add this info near function description or in documentation.

Tommixoft avatar Jun 05 '17 20:06 Tommixoft

Agreed.

(Note: this explanation had already been given in other, older issues.)

danhunsaker avatar Jun 05 '17 20:06 danhunsaker