Groups
Groups
Sign in
Groups
Groups
FxWorks
Conversations
About
Send feedback
Help
Serializing an Array Collection containing primitive data types
12 views
Skip to first unread message
Ranhiru
unread,
Jun 20, 2011, 4:30:42 AM
6/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FxWorks
In one of my classes I have an ArrayCollection which contains
integers.
[XmlArray]
public var actionIds:ArrayCollection = new ArrayCollection();
Now this serializes to something like this. Looks like its separated
by an enter
<actionIds>
1 2
</actionIds>
Then I made the annotation to
XmlArray(alias="actionIds/id")]
public var actionIds:ArrayCollection = new ArrayCollection();
But my expected result was not achieved. The result was as shown
below.
<actionIds>
<id> 1 2 </id>
</actionIds>
However, what I am trying to achieve is to wrap each element in a <id>
tag. So it would result in
<actionIds>
<id>1</id>
<id>2</id>
</actionIds>
Any ideas? Looks like this could be solved using virtual paths.
Thanx a lot in advance!
Alexutz
unread,
Jun 20, 2011, 5:03:25 AM
6/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FxWorks
Did you try setting memberName="id" in the xmlArray metadata and
leaving alias to just "actions"? That should lead to the expected
result.
Alex
Ranhiru
unread,
Jun 20, 2011, 5:54:25 AM
6/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FxWorks
Thanx a lot! That worked perfectly!
Alexutz
unread,
Jun 20, 2011, 7:08:50 AM
6/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FxWorks
No problem. I'm glad it worked.
Good luck
> > > Thanx a lot in advance!- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages