Typed Values

Typed values are serialized actionscript objects. Each context header and each message contains exactly one typed value.

Typed values can be arbitrary complex, hierarchical data structures.

Each typed value consists of a type, a value, and optionally a name.

The type is specified by the XML node name. The optional name is specified by the name attribute of the XML node.

For simple types, the value is specified in the content of the XML node. For container types, the value is specified by subnodes of the XML node.

Some types may have additional attributes.

Typed values have a name attribute only when they are direct subnodes of an Object, TypedObject, or ECMAArray. Top-level typed objects and subnodes of a StrictArray do not have name attributes.

The following table offers an overview of available types and optional attributes.

XML Nodename Value location Additional attributes(except name, see above)
Number Content of node ---
Boolean Content of node ---
String Content of node ---
Object Subnodes refId (optional)
Null no value ---
Undefined no value ---
Reference Content of node ---
ECMAArray Subnodes nrElems, refId (optional)
StrictArray Subnodes nrElems, refId (optional)
Date Content of node ---
LongString Content of node ---
Unsupported no value ---
XMLObject Content of node refId (optional)
TypedObject Subnodes type, refId (optional)

The optional refId attribute of the types Object, ECMAArray, StrictArray, XMLObject, and TypedObject can be used to assign an arbitrary ID to such a value. Such an ID can then be used to reference the value later with a Reference node.

This technique is commonly used to avoid multiple identical representations of the same object. With this approach, an object is represented only once, and later it is only referenced by a Reference node. This allows you to efficiently serialize complex data structures, which may even contain cyclic references.