Attributes to customize XML serialization / Customizing XML serialization |
Define the namespace of a variable in an XML document.
DEFINE myVar RECORD ATTRIBUTES(XMLName="Root", XMLNamespace="http://tempuri.org") attr1 INTEGER ATTRIBUTES(XMLAttribute,XMLName="Attr1"), val1 FLOAT ATTRIBUTES(XMLName="Val1", XMLNamespace="http://www.mycompany.com"), val2 INTEGER ATTRIBUTES(XMLName="Val2"), attr2 STRING ATTRIBUTES(XMLAttribute, XMLName="Attr2", XMLNamespace="http://anyuri.org") END RECORD
<fjs1:Root xmlns:fjs1="http://tempuri.org" Attr1="158" xmlns:fjs3="http://anyuri.org" fjs3:Attr2="Hello"> <fjs2:Val1 xmlns:fjs2="http://www.mycompany.com">0.5</fjs2:Val1> <fjs1:Val2>-18547</fjs1:Val2> </fjs1:Root>