Attributes to customize XML serialization / Mapping between simple 4GL and XML data types detail |
Force the XML type namespace of a variable by adding xsi:type at serialization or by checking xsi:type at de-serialization.
DEFINE myVar RECORD ATTRIBUTE(XMLName="Root", XMLNamespace="http://tempuri.org") val1 FLOAT ATTRIBUTE(XMLName="Val1"), val2 INTEGER ATTRIBUTE(XMLName="Val2", XMLType="MyRecord", XMLTypenamespace="http://mynamespace.org") END RECORD
<fjs1:Root xmlns:fjs1="http://tempuri.org"> <fjs1:Val1>0.5</fjs1:Val1> <fjs1:Val2 xmlns:fjs2="http://mynamespace.org" xsi:type="fjs2:MyRecord">-18547</fjs1:Val2> </fjs1:Root>