RestKit / RKXMLReaderSerialization

A RestKit serialization format implementation for XML using XMLReader.
Apache License 2.0
14 stars 22 forks source link

XML to NSDictionary not working with XMLReader #2

Open ghost opened 11 years ago

ghost commented 11 years ago

Hi,

I'd highly recommend switching to TBXML+NSDictionary because XMLReader has some weird side effects. Let's suppose our XML has the same structure as the Article xml `<?xml version="1.0" encoding="UTF-8" ?>

My Article Blake Very cool!!
` (I choose this one because the one that I have to work with has exactly the same structure) If you choose to parse this xml with XMLReader you'll get something like this: NSDictionary: `{ article = { title = { text = "My Article"; }; author = { text = "Blake"; }; body = "Very cool!!"; }; }` Unfortunately RKObjectMappingOperation or RKObjectMapping, not quite sure, expects something like this: NSDictionary: `{ article = { title = "My Article"; author = "Blake"; body = "Very cool!!"; }; }` So you'll end up with an Article that has no properties initialised. If you take TBXML+NSDictionary everything works perfectly. Sincerely Martin
blakewatters commented 11 years ago

Thanks. This is a great suggestion. I really want to get reliable XML support available, but have not had the cycles to focus on it myself. Will take a look at the TBXML+NSDictionary implementation.

segiddins commented 11 years ago

Any progress on this?

blakewatters commented 11 years ago

I believe @samkrishna has active development underway on this

segiddins commented 11 years ago

I actually forked it and got it working with TBXML+NSDictionary

samkrishna commented 11 years ago

I'll check out the fork.

-S

On May 9, 2013, at 12:34 PM, segiddins notifications@github.com wrote:

I actually forked it and got it working with TBXML+NSDictionary

— Reply to this email directly or view it on GitHub.

segiddins commented 11 years ago

Fixed with pull request #3