I retrieve XML data in Flex via HttpService. I have the resultFormat
property on the HttpService instance set to HTTPService.RESULT_FORMAT_OBJECT
. The result contains data similar to this:
<!-- ... -->
<children>
<item><!-- ... --></item>
<item><!-- ... --></item>
<!-- ... -->
<children>
<!-- ... -->
I get an array named item beneath the element children when there is more than one item
sibling. If there's only one, the conversion can't distinguish it from a scalar.
What do I need to change to have Flex convert all item
elements to an array with 0 or more elements?
What would I have to do to get an array member children
, dropping the item
wrappers altogether?
The XML is generated by Struts on the server side. I always have the option to change the structure of the document there, but right now I'm interested in what I can do with Flex.