If you paste the Objective-C models along with the XML somewhere we
can look at it, but if the XML is non-standard, it will probably need
custom parser support.
>If I add a new element, say <name>blabla</name> before
> the array element, it works! If the <name> elements comes after the
> array, then ObjectiveSupport crashes.
That's interesting. Could you paste your Objective-C models somewhere?
I can't test your XML without them.
> Why is not possible in ActiveResource to have a resource which has two
> arrays inside? In my example the resources <hobbies> could have two
> arrays: <old> and <new>.
It would be a little weird to have an attribute named "hobbies" in
Rails unless it's some sort of association. The XML that you posted
suggested that "hobbies" is a class name, with a single association
named "old" which is composed of "hobbies". If you could write some
Rails code that generates the XML in question that would be very
helpful. The current XML handling code in the project is somewhat
flexible, but it's really only designed to work with resource based
Rails apps that use the default to_xml (de)serialization. If you are
trying to make it parse atypical XML, there is a good chance that it
will require modification to handle those cases.
Ahh, I see the issue. The problem exists when you have an array type
attribute two levels deep.
<foo>
<bar>
<bazs type="array">
<baz><name>blat</name></baz>
</bazs>
<bar>
</foo>
Thanks for tracking this down Rodrigo!
I wrote a test to isolate this and added a slightly modified version
of your fix: http://github.com/yfactorial/objectivesupport/commit/f804c5f09e8720899f4826d46dd93e60626e0663
What do you think?