Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML to NSDictionary not working with XMLReader #2

Open
ghost opened this issue Jan 2, 2013 · 6 comments
Open

XML to NSDictionary not working with XMLReader #2

ghost opened this issue Jan 2, 2013 · 6 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jan 2, 2013

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
`

<title>My Article</title> 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
Copy link
Member

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.

@ghost ghost assigned blakewatters Jan 16, 2013
@segiddins
Copy link
Member

Any progress on this?

@blakewatters
Copy link
Member

I believe @samkrishna has active development underway on this

@segiddins
Copy link
Member

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

@samkrishna
Copy link

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
Copy link
Member

Fixed with pull request #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants