Hi, I'm trying to do ActionScript/XML binding, ie generate "typed" XML from
complex actionscript objects. The mapping is realised with a XSD passed to
the XMLEncoder.
I followed this example: http://blog.misprintt.net/?p=192
It works fine, except in this case: I have an ArrayCollection, that is
filled with Objects of different types. Here is the XSD for this
ArrayCollection:
<xs:element name="lhs">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element ref="lhsCodeSnippet"/>
<xs:element ref="logicalExpression"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
The list is modelised as a "sequence" of "choice". But the XMLEncoder fails
on the list and passes the whole ArrayCollection.toString() to each of the
available choices. It outputs something like:
<lhs>
<lhsCodeSnippet>
[object LHSCodeSnippetVO],[object LogicalExpressionVO],[object
LHSCodeSnippetVO]
</lhsCodeSnippet>
<logicalExpression>
[object LHSCodeSnippetVO],[object LogicalExpressionVO],[object
LHSCodeSnippetVO],
</logicalExpression>
</lhs>
Weird, isn't it ?
I found this bug: http://bugs.adobe.com/jira/browse/SDK-19418 , and I
suspect something similar is going on... Any hints on the subject ?