XML

The OCEL 2.0 XML format is designed from the ground-up to be efficient, idiomatic, and human-readable. On its top-level, it contains node collections of event-types, events, object-types, and objects.

Minimal Example

In the following minimal example, see all four top-level node collections with only a single child element:

<log>
  <event-types>
    <event-type name="create-order">
      <attributes>
        <attribute name="total-items" type="integer"/>
      </attributes>
    </event-type>
  </event-types>
  <object-types>
    <object-type name="order">
      <attributes>
        <attribute name="item" type="integer"/>
      </attributes>
    </object-type>
  </object-types>
  <events>
    <event id="e1" type="create-order" time="2023-10-16T15:30:00Z">
      <attributes>
        <attribute name="total-items">1</attribute>
      </attributes>
      <objects>
        <relationship object-id="o1" relationship="order"/>
      </objects>
    </event>
  </events>
  <objects>
    <object id="o1" type="order">
      <attributes>
        <attribute name="item" time="1970-01-01T00:00:00Z">1</attribute>
      </attributes>
    </object>
  </objects>
</log>

Note that the attribute item of object o1 is set to UNIX timestamp 0 (in ISO 8601).

Since we only have a single order, there are no object-to-object relationships. However, there is an event-to-object relationship from event e1 to object o1.

Attribute Types

Attribute types can have any value of:

  • string
  • time (ISO 8601 date and time string)
  • integer
  • float
  • boolean (only valid values are 1 (TRUE) or 0 (FALSE))

XML Schema

We provide an XML schema to download here. It can be used to validate your OCEL 2.0 XML file.

File Extension

We do not prescribe any particular file extension apart from .xml, but there are many who prefer .xmlocel.

Further Resources

All provided logs in the Event Logs section are available in the XML format.