Repository navigation
Simplified Mapping Style
highsource edited this page Feb 27, 2015
·
6 revisions
Simplified mapping style ...
Example.
XML:
<value attribute="check">test</value>
JS:
{ value : { value : "test", attribute : "check" } }
Fragment of the mapping:
{ name: 'base', collection: true, elementName: 'base', typeInfo: 'Zero.BaseType', type: 'elementRef' }
XML:
<elementRef><base><alpha>one</alpha><beta>2</beta></base></elementRef>
JS:
{ base : [ { base : { alpha : "one", beta : [ 2 ] } } ] }
Fragment of the mapping:
{ name: 'alphaOrBeta', collection: true, elementTypeInfos: [{ elementName: 'beta', typeInfo: 'Zero.ValueType' }, { elementName: 'alpha', typeInfo: 'Zero.ValueType' }], type: 'elementRefs' }
XML:
<elementRefs><alpha>one</alpha><beta>2</beta></elementRefs>
JS:
{ alphaOrBeta : [ { alpha : { value : "one" } }, { beta : { value : "2" } } ] }
Fragment of the mapping:
{ name: 'any', domAllowed: true, typedObjectAllowed: true, type: 'anyElement' }
XML:
<anyElementLax><string>test</string></anyElementLax>
JS:
{ any : { string : "test" } }