Home MORPH Syntax Instances
  Sponsored by Magnetar Games Main Specification Forum Syntax

MORPH Syntax

Element <Instances>
Attributes
None.
Content
The Instances section holds data which represents a snapshot of a simulation. The element may contain any sequence of nesting of ClassSet and Class elements as desired by the DSL to create a metanode structure for the instance data. The Instances section would not occur in a product definition file, but rather in scenario files. However the <Instances> element must be declared in the DSL's schema for validation purposes.

Element <(ClassSet)>
Attributes
None.
Content
This is an optional category container for instances. The name of the element may be the class name appended with "Set" or it may be the class's PluralName. The ClassSet element is optional on all levels and may be omitted by the DSL.

Element <(Class)>
Attributes
Content
The Class element takes on the name of the actual class.

Attribute "Ref" - xs:string - required
This must reference the name of a object class or prototype.

Element <Instance>
Attributes
Content
The Instance element represents an instance of an object. Thus this should contain all of the attributes which are valid on instance documents. These are assigned through use of <xs:attributeGroup ref="ClassNameAttrs"/> and/or <xs:group ref="ClassNameGroupAttrs"/>.

Attribute "Prototype" - xs:NMTOKEN - required
This attribute references a prototype declared in the Prototypes section.

Attribute "ID" - xs:string
The ID attribute is optional because it may be inferred from the document by internally numbering all leaf nodes. It is up to the DSL to decide whether it is necessary to provide an explicit ID to each instance, and whether those ID numbers are reused with future instances, or if the number is always reserved even if the instance ceases to exist in the scenario. The format of the IDs (whether they use names or numbers) is not defined.

Element <UserAttribute>
Attributes
Content
None.
This element allows a product to assign a value to the user attributes which it has added to classes.

Attribute "Ref" - xs:NMTOKEN - required
This must reference the name of a user attribute declared in the ObjectClasses section.

Attribute "Value" - xs:string - required
This is the value of the attribute for this instance.