The <oob> element is used to specify Out-of-Band data. It must appear below the <structure> element as its first child, or second child if preceded by a <comment> element.
| Attributes |
| ||||||
| Children | <comment>?, <field>*, <float>*, <if>*, <fragment>*, <pad>*, <peek>*, <record>*, <repeat>*, <prop>*, <setprop>*, <switch>*? = 0 or 1 occurence, * = 0 or more occurences |
Out-of-Band data is use to specify information that is not part of the established message definition, but must be present for the message to be decoded properly.
For example, the following document uses a Channel field to determine
what kind of message to decode:
<?xml version="1.0" encoding="iso-8859-1" ?>
<xddl>
<structure>
<oob>
<field name="Channel" length="8"/>
</oob>
<field name="MessageType" length="8"/>
<switch expr="Channel">
<case value="0">
<switch expr="MessageType">
<case value="1">
<field name="PowerUp" length="8"/>
</case>
<case value="2">
<field name="PowerDown" length="8"/>
</case>
</switch>
</case>
<case value="1">
<switch expr="MessageType">
<case value="1">
<field name="UserZone" length="8"/>
</case>
<case value="2">
<field name="NeighborList" length="8"/>
</case>
</switch>
</case>
</switch>
</structure>
</xddl>
oob.xddl
As you can see, we placed the Channel field in the <oob> section, and
subsequently referenced it. Notice, the <oob> element does not have its own
scope, so any sibling element can reference its children directly.
The IDM uses the <oob> section in special ways. Using the View tab from the Preferences dialog, we can specify whether or not to show the Out-of-Band data at all.
The IDM also looks for specificly named properties in the <oob> section. These include:
- Name: The name of the message
- Direction: The direction of the arrow
- 0 is blank
- 1 is a right arrow
- 2 is a left arrow
Here is an example of using the Name property in a document:
<?xml version="1.0" encoding="iso-8859-1" ?>
<xddl>
<type id="MessageType">
<enum>
<item key="0" value="Unknown"/>
<item key="1" value="General Page"/>
<item key="2" value="Access Parameters"/>
<item key="3" value="Service Connect"/>
</enum>
</type>
<structure>
<oob>
<prop name="Name" value="0"/>
</oob>
<field name="Message" length="8" type="#MessageType"/>
<setprop name="Name" value="Message" type="#MessageType"/>
<field name="B" length="8"/>
<field name="C" length="8"/>
<field name="D" length="8"/>
</structure>
</xddl>
magic.xddl
Providing these special properties and the <oob> section gives us a clean way of customizing the appearance of the IDM without overburdening the XDDL author, since the <oob> section is entirely optional.