Relationships are used to navigate the Package, much like a directory. Relationships connect a source to a target, where the source is either the Package itself or a Part of the Package. The target is any URI-addressable resource inside or outside of the Package. This allows for flexibility in a Package such that there are no hardcoded dependencies of the content.
Random access to the Package content is provided by the use of Relationships through the use of directed graph associations. Tools and applications can take advantage of the Relationships to access information in a standardized and predictable manner.
The Relationship Element has four attributes:
- the identifier (Id, xsd:ID, required);
- a relationship type (Type, xsd:anyURI, required) (URI defining the role of the relationship);
- the target (Target, xsd:anyURI, required) (URI reference pointing to a target resource);
- the target mode (TargetMode, ST_TargetMode, optional) (Internal or External resource);
The relationships are stored in XML files with the extension “.rels” within subfolders named “/_rels”.
The following is an XML markup that defines the relationship identified as “???”, which establishes the association between the Package or Part and the target. “”
<Relationship Id=“”
<Relationship Id=“???”
Type=“ ”
Type=“ ”/>
Each Part may have its own relationships. If the part has relationships, they will be stored in an XML file within the _rels folder that is associated with that Part. That file takes the Part name with a .rels appended to it.
The root-level /_rels folder stores the relationships for the package as a whole. The /_rels folder normally contains a file named .rels, an XML file where the starting package-level relationships are stored.