Schema Definition
Last updated
Was this helpful?
Last updated
Was this helpful?
The CommsDSL schema files use to define all the messages, their fields, and framing.
Every schema definition file must contain a valid XML with an encoding information header as well as single root node called <schema>:
The schema node may define its properties (described in detail in chapter).
It can also contain definition of various common fields that can be referenced by multiple messages. Such fields are defined as children of <fields> node.
Multiple messages can (but don't have to) be bundled together as children of <messages> node.
Multiple frames can (but don't have to) be bundled together as children of <frames> node.
Multiple interfaces can (but don't have to) be bundled together as children of <interfaces> node.
All the nodes described above are allowed to appear in any order.
There can be multiple <fields> elements in the same schema definition file. The fields are described in detail in chapter.
The definition of a single message is done using <message> node (described in detail in chapter).
Transport framing is defined using <frame> node (described in detail in chapter).
There are protocols that put some information, common to all the messages, such as protocol version and/or extra flags, into the framing information instead of message payload. This information needs to be accessible when message payload is being read or message object is being handled by the application. The handles these cases by having a common interface class for all the messages, which contains this extra information. In order to support such cases, the CommsDSL introduces optional node <interface> (described in detail in chapter) for description of such common interfaces.