Am example of the <relationship> element is:

<!ELEMENT relationship ( object )* >
<!ATTLIST relationship 
 name      CDATA #REQUIRED
 method  ( insert | remove | put ) "put" >

Attribute-list declarations for the relationship element identifies the attribute declarations available for the <relationship> element.

Table 1. Attribute-list declarations for the relationship element

XML attribute

Description

Possible value

Value required/implied

name

Name of the object instance.

CDATA

Required

method

Specifies the desired topology change. You can create a new relationship, delete an existing relationship, or update an existing relationship.

insert

remove

put

IMPLIED

Default is "put"

For example, to add the HostedBy relationship between the application Banking and the host BankingHost, use the following syntax:

<object class="Application" name="Banking">
 <relationship name="HostedBy" method="put" />
  <object class="Host" name="BankingHost" method="update" />
 </relationship>
</object>

If multiple objects are specified when the method is "insert" (or "remove") then all are inserted (or removed). The methods "put" and "insert" are equivalent if the relationship is a singleton. The "remove" method may be used to clear a singleton relationship:

<relationship name="HostedBy" method="remove" />

A relationship can have zero or more objects associated with it within one declaration, meaning you may want to add a relationship even if you do not have a specific object to assign to it. To declare zero objects, put or insert the NULL object declaration:

<relationship name="HostedBy"> 
 <object/>
</relationship>