XML Serialization Attributes

Here’s the list of attributes that affect XML serialization. They should be properly supported by all target languages.

Attribute

Type

Inheritance

Target

Description

Default

xml.enabled

bool

scope

module,
type
generate XML serialization
code for target language

false

xml.ordered

bool

scope

record
whether serialized record fields
are required to be in strict
order or not

false

xml.ignore

bool

record field
exclude record field from XML
serialization

false

xml.attribute

bool

record field

serialize field as XML attribute

false

xml.text

bool

record field
union clause
serialize value as XML element
text

false

xml.content

bool

record field
union clause
serialize value as XML element
content (without enclosing tag)

false

xml.notation

Notation

scope

record field
enum field
Notation used for name
translation of record and enum
field names into XML strings

none

xml.enum_notation

Notation

scope

enum field

Notation used for name
translation of enum values

xml.notation

xml.element_notation

Notation

scope

any

Notation used for name
translation of element names

xml.notation

xml.attribute_notation

Notation

scope

any

Notation used for name
translation of attribute names

xml.notation