Jsonix Collection Property
by Alexey Valikov
HTML
<script src="https://rawgithub.com/highsource/jsonix/master/dist/Jsonix-all.js"></script>
JavaScript
var MyModule = {
name: 'MyModule',
typeInfos: [{
type: 'classInfo',
localName: 'MyType',
propertyInfos: [{
type: 'element',
name: 'data',
elementName: 'content',
collection: true
}]
}],
elementInfos: [{
elementName: 'root',
typeInfo: 'MyModule.MyType'
}]
};
var context = new Jsonix.Context([MyModule]);
var unmarshaller = context.createUnmarshaller();
var unmarshalled = unmarshaller.unmarshalString('<root><content>one</content><content>two</content><content>three</content></root>');
console.log(unmarshalled);