Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following types are supported:

  • Integer

  • Float

  • Boolean

  • Array (2024-01-19: Obsolete in future releases. Use attribute array instead)

  • Date

Important: Remember to declare the namespace used for the type attributeand array attributes. The namespace must be “http://bizbrains.com/json“ The namespace prefix used in the example is “json” but can be anything.

Arrays

  • 2024-01-19: Obsolete in future relases:

    • XML tags with the same name will by default be parsed as elements of an array. To be sure also a single XML tag wil be parsed as an array with one element, use the type=”array” attribute on the XML tag.

  • For releases after 2024-01-19

    • XML tags with the same name will by default be parsed as elements of an array. To be sure also a single XML tag wil be parsed as an array with one element, use the array=”true” attribute on the XML tag.

Example

XML:

Code Block
languagexml
<BrandCatalog xmlns="http://company.com" xmlns:json="http://bizbrains.com/json">
	<Brands>
		<BrandId json:type="integer">1</BrandId>
		<Name>Mercedes-Benz</Name>
		<MultiBrand json:type="boolean">false</MultiBrand>
		<Value json:type="float">123.4</Value>
		<AltNames json:typearray="arraytrue">
			<Id json:type="integer">1</Id>
			<name>MB</name>
		</AltNames>
	</Brands>
	<Brands>
		<BrandId json:type="integer">2</BrandId>
		<Name>Volkswagen</Name>
		<MultiBrand json:type="boolean">true</MultiBrand>
		<Value json:type="float">234.5</Value>
		<AltNames>
			<Id json:type="integer">1</Id>
			<name>VW</name>
		</AltNames>
		<AltNames>
			<Id json:type="integer">2</Id>
			<name>VAG</name>
		</AltNames>
	</Brands>
</BrandCatalog>

...