This content has been marked as final. Show 4 replies
We haven't encountered this before , but a blind suggestion from the team:
Specify resultFormat = "e4x" on your HTTPService and please post an example XML snippet. resultFormat=e4x is just pass-through, so any renaming would be happening in the core player XML processing, and not in Flex. Also try using resultFormat="object" -- either way, there doesn't appear to be any code that would affect attribute names.
A quick test from the data services team:
Fetching this simple XML document via HTTPService yields the following.
<bar baz_baz="underscore attribute" biz-biz="dash attribute"/>
As an Object result, E4X result, and ObjectProxy result, the dashes and underscores are preserved -- you can verify this by adding a breakpoint and breaking open the result object. Perhaps your print code is on the fritz?
Thanks for the quick reply, I'll check things on my end
I am guessing that your problem is coming from the Rails side using the "to_xml" method. "to_xml" uses "dasherize" internally, which will convert the underscores in your XML doc. Rails 1.2.x gives you the option to turn off "dasherize".
Try the following:
some_obj.to_xml(:dasherize => false)
I got this tidbit from Flexible Rails by Peter Armstrong.