Custom XML Data

Within an Office Open XML document, it is sometimes desirable or necessary to store custom XML data (that is, data in a format not defined by this Office Open XML specification) within the contents of the package. To accommodate this need, Office Open XML allows the storage of any arbitrary XML within a package as the target of the http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml relationship (valid source parts are listed within Part 1 of the Standard).

The following examples illustrate potential uses of this mechanism:

  • A document which collects and displays information from a backend data source might want to store the original form of that backend data, so it can be manipulated and uploaded to the original data source at a later date.

  • A document author may wish to store additional metadata in an XML format not defined by this Office Open XML specification's existing metadata schemas.

  • A document management system may wish to store data tracking the workflow status, retention policies, and so on for this document along with the document.

Once present within a package, this custom XML data shall be maintained as a distinct part separate from the contents of the document, spreadsheet, or presentation. If there are multiple distinct streams of custom XML data, each is maintained as a separate part within the package, so that each can be manipulated independently of all others.

Each Custom XML Data part may also have an implicit relationship to a Custom XML Data Properties part which stores:

  • The target namespace of all XML schemas which shall be used to validate the content of the custom XML data part.

  • A GUID which shall remain constant over the lifetime of this part (and can therefore be used to uniquely identify it).