Set Element to be Nil

3 views
Skip to first unread message

gee

unread,
Sep 28, 2011, 3:22:02 AM9/28/11
to FxWorks
Hi,
I just upgraded to 2.3.0 and was wondering if there was a way to set
an element to be nil=true if it is null.

Eg:
<a:Ratio xsi:nil="true"></a:Ratio>

currently the following is produced:
<a:Ratio></a:Ratio>

Thanks

Alexutz

unread,
Sep 28, 2011, 3:31:36 AM9/28/11
to FxWorks
Hello,

FlexXB does not currently support this xsi attribute. The only xsi
attribute supported is xsi:type.

Regards,
Alex

misprintt

unread,
Sep 29, 2011, 10:16:43 PM9/29/11
to FxWorks
Hi Alex,

I've implemented a patch for this (including tests) as it was blocking
our developers. I can't attach the patch here so i'll raise an 'issue'
shortly

- adds 'isRequired' property to IMemberAnnotation (default is false
obviously)
- adds 'nillable' property to XmlElement annotation and set isRequired
to true if nillable is true

- change to SerializationCore.doSerialize to pass null objects through
to serializer if IMemberAnnotation(annotation).isRequired is true
- change to XmlElementSerializer to check for null object and if
nillable="true" then add the xsi:nil attribute and xsi namespace to
the node;
Reply all
Reply to author
Forward
0 new messages