Jsonix Elements Property
HTML
<script src="https://rawgithub.com/highsource/jsonix/master/dist/Jsonix-all.js"></script>
JavaScript
var MyModule = {
name: 'MyModule',
typeInfos: [{
type: 'classInfo',
localName: 'ElementsType',
propertyInfos: [{
type: 'elements',
name: 'c:condition',
wrapperElementName: {
localPart: 'condition',
namespaceURI: 'http://us.xomplex',
prefix: 'c'
},
collection: true,
elementTypeInfos: [{
elementName: {
localPart: 'condition',
namespaceURI: 'http://us.xomplexio',
prefix: 'a'
},
typeInfo: 'MyModule.SubAtomic'
}, {
elementName: 'operator',
typeInfo: 'String'
}]
}]
},
{
type: 'classInfo',
localName: 'SubAtomic',
propertyInfos:[{
type: 'element',
name: 'fieldName',
elementName: 'fieldName',
typeInfo: 'String'
},
{
type: 'element',
name: 'fieldTest',
elementName: 'fieldTest',
typeInfo: 'String'
},
{
type: 'element',
name: 'fieldValues',
elementName: 'fieldValues',
typeInfo: 'MyModule.SubSubAtoms'
}]
},
{
type: 'classInfo',
localName: 'SubSubAtoms',
propertyInfos:[
{
type: 'element',
name: 'fieldValue',
collection: true,
elementName: 'fieldValue',
typeInfo: 'String'
}
]
}
],
elementInfos: [{
elementName: 'root',
typeInfo: 'MyModule.ElementsType',
},
{
elementName: 'atoms',
typeInfo:'MyModule.SubAtomic'
}
]
};
console.log("creating unmarsaller");
var context = new Jsonix.Context([MyModule]);
var unmarshaller = context.createUnmarshaller();
var unmarshalled = unmarshaller.unmarshalString('<root><c:condition...