Skip to content

XML to NSDictionary not working with XMLReader #2

@ghost

Description

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions