Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

arraycollection to xmllistcollection

183 views
Skip to first unread message

malachite00

unread,
Jul 26, 2008, 10:35:18 PM7/26/08
to
Is there an easy way to convert an ArrayCollection to an XMLListCollection? I
have found plenty of references to convert the reverse, but none that go into
an XMLListCollection or XMLList.

I am receiving a query from a database via a RemoteObject and putting it
directly into an ArrayCollection. Some of this data needs to be displayed in a
Tree and I've found XMListCollection works better as a data provider. I wrote a
method to go through the array and create nodes then add them to the XML, but
it seems there would be a way to do this automatically instead. Thanks!

g-s-b

unread,
Jul 27, 2008, 11:07:10 AM7/27/08
to
Well. I would think the best solution would be to change the query results
transfer format to XML.

Unable to do that, when you get the data you need to convert it to an XML
object I would think, for the XMLList's source is an XML object.

Finally, I would re-look at the ArrayCollection as the data provider once
more.

IMHO

malachite00

unread,
Jul 27, 2008, 8:11:32 PM7/27/08
to
Thanks Greg. I tried casting the query returned from the ColdFusion component
to XML, but couldn't get the data into the XMLListCollection this way. When I
traced it, all I saw was [object Object] although there were the correct number
of entries so I know the right data was going in there. Is there a middle step
I need to take to convert the objects into XML?

g-s-b

unread,
Jul 28, 2008, 12:31:14 AM7/28/08
to
I do not use ColdFusion but rather PHP and mySQL usually.
So I can not really tell you an answer to that.
For me, I have a PHP class that will return the query results in an XML
format. That is what I pass to the application.

There must be some such options with ColdFusion but I am not the one to ask.
:(

ntsiii

unread,
Jul 28, 2008, 3:19:48 PM7/28/08
to
You cannot cast unless the cariable you are casting contains an object of the
type you are casting to.

ArrayCollection will never contain an XMLListcollection, so forget casting.

If the CFC IS returning xml, then set the resultFormat="e4x", then in the
handler, do:
var xmlResult:XML = XML(event.result);
trace(xmlResult.toXMLString())

Tracy

pdo...@gmail.com

unread,
Sep 7, 2012, 4:08:17 PM9/7/12
to
Hi

Do you happen to have that method handy that you wrote to do this, need to do it myself.
0 new messages