Skip to content

Standard Mapping Style

Alexey Valikov edited this page Feb 27, 2015 · 20 revisions

Standard Mapping Style

Standard mapping style is a mapping style used by Jsonix by default.

Root element

Root element is mapped to the following structure:

{
        // Name is a qualified name of the element
	name : { namespaceURI : ..., localPart : ..., prefix : ... },
	// Content value
	value : { ... }
}

Example.

XML:

<value attribute="check">test</value>

JS:

TODO

Complex type

Complex type is represented by a JavaScript object. Each of the properties of the complex type is represented by a property of this object.

Example.

XML:

<extended><alpha>one</alpha><beta>2</beta><gamma>urn:three</gamma></extended>

JS:

TODO

Character content

Value property

Value property is mapped to property of the JavaScript object with the same name as declared in the mapping.

Example.

Fragment of the mapping:

{
	name: 'value',
	typeInfo: 'String',
	type: 'value'
}

XML:

<value attribute="check">test</value>

JS:

TODO

Attributes

Attribute property

Attribute property is mapped to property of the JavaScript object with the same name as declared in the mapping.

Example.

Fragment of the mapping:

{
	name: 'string',
	attributeName: 'string',
	type: 'attribute'
}

XML:

<attribute string="zero" integers="1 2">test</attribute>

JS:

TODO

Any attribute property

Any attribute property is mapped to property of the JavaScript object with the same name as declared in the mapping

Elements

Element property

Elements property

Element map property

Element reference property

Element references property

Any element property

Enum

Clone this wiki locally