-
Notifications
You must be signed in to change notification settings - Fork 82
xsi:type Support
Alexey Valikov edited this page Apr 10, 2015
·
5 revisions
Jsonix supports the xsi:type attribute.
When unmarshalling, Jsonix checks, if an XML element has xsi:type element declared. If it does, then the value of this attribute will be parsed as a qualified name. Thenn Jsonix will try to find a type by this name in the current context an use this type for unmarshalling.
When marshalling, Jsonix checks, if the value has the same type as declared in the property or element declaration. If these types differ, Jsonix will add an xsi:type attribute specifying the actual type of the value.
xsi:type support is turned on by default. You can turn xsi:type support off using the supportXsiType : false option:
var context = new Jsonix.Context([GH70], { supportXsiType : false });