Page 25 of 29PREVNEXT

Open XML II: Editing Documents in the XML

Delete a relationship definition from a .rels file

To delete a relationship definition from a .rels file, delete the entire applicable Relationship tag, as shown here.

The relationship definition for a document part typically appears in the .rels file for the part that primarily uses its content.

For example, the relationships for comments.xml and styles.xml in a Word document ZIP package are both located in document.xml.rels; the relationship for an Excel worksheet part is located in workbook.xml.rels.

Note, however, that some document parts are referenced in more than one .rels file. For example, relationships for all slide layout parts in a PowerPoint presentation (slideLayout#.xml) appear in the applicable slideMaster#.xml.rels file. However, if a layout is applied to slides in the presentation, a relationship definition also appears in each applicable slide#.xml.rels file.

Deleting all relationships that reference a document part is an essential step in deleting that part. If a relationship definition exists for a document part that has been deleted, you are likely to see an error message when attempting to open the document and the document may not be able to open.

However, also remember that some relationships are required for a document to function. For example, every PowerPoint slide must have a layout. So, if you delete the document part for a slide layout that is applied to one or more slides, change the layout associated with the slide rather than deleting the relationship definition for that layout.

Page 25 of 29PREVNEXT