relationship-page

The relationship-page element should only be used when you want to capture household relationships within your script (i.e. relationships between the people in your household). In order for this element to work properly, it relies on the following entity structure in your Datastore schema:

Figure 1. Datastore Schema Required for Relationship Page
<xsd:element name="Person">
  <xsd:complexType>
    <xsd:sequence minOccurs="0">
      <xsd:element ref="Relationship" 
                   minOccurs="0"
                   maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="personID" type="D:SVR_KEY" />
    ...
  </xsd:complexType>
  <xsd:key name="PersonKey">
    <xsd:selector xpath="./Person" />
    <xsd:field xpath="@personID" />
  </xsd:key>
  <xsd:keyref name="RelationshipRef" refer="PersonKey">
    <xsd:selector xpath="./Person/Relationship" />
    <xsd:field xpath="@personID" />
  </xsd:keyref>
</xsd:element>

<xsd:element name="Relationship">
  <xsd:complexType>
    <xsd:attribute name="relationshipType" type="IEG_STRING" />
    <xsd:attribute name="personID" type="D:SVR_KEY" />
  </xsd:complexType>
</xsd:element>

Please note that the Relationship entity may have other attributes defined in order to capture more information in regarding the relationship itself. For example you may wish to avail of the option of using an indicator to record whether a relationship is a non-parent caretaker relationship or you may wish to add other custom relationship attributes. For example:

Figure 2. Datastore schema for relationship Attributes
<xsd:element name="Relationship">
  <xsd:complexType>
    <xsd:attribute name="relationshipType" type="IEG_STRING" />
    <xsd:attribute name="personID" type="D:SVR_KEY" />
    <xsd:attribute name="isNonParentPrimaryCaretaker" 
                    type="IEG_BOOLEAN" />
    <xsd:attribute name="startDate" type="IEG_DATE" />
  </xsd:complexType>
</xsd:element>

You will obviously also need to have captured the people in your household prior to visiting the relationship pages, otherwise there will be no relationships to enter. Assuming there are people in the household, a page will be displayed for all members of the household bar the last one. More information on how to create relationships pages and how they look can be found in Controlling the Flow of Your IEG Script.