Header Part

Content Type:

application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml

Root Namespace:

http://schemas.openxmlformats.org/wordprocessingml/2006/main

Source Relationship:

http://schemas.openxmlformats.org/officeDocument/2006/relationships/header

An instance of this part type contains the information about a header displayed for one or more sections.

A package shall contain zero or one Header part for each kind of header (first page, odd page, or even page) in each section of the document. Each Header part shall be the target of an explicit relationship from the Main Document (§11.3.10) part or the Glossary Document (§11.3.8) part.

example:
<Relationships xmlns="…">
  <Relationship Id="rId89" Type="http://…/header" Target="header2.xml"/>
  <Relationship Id="rId90" Type="http://…/header" Target="header3.xml"/>
</Relationships>

The root element for a Header part shall be <hdr>.

example:
<w:hdr xmlns:w="…" …>
  
</w:hdr>

The XML markup for a header in a section of a Main Document part involves the <headerReference> element in that section's <sectPr> element.

example:
<w:body><w:sectPr w:rsidR="00363F31" w:rsidSect="008D4B40">
    <w:headerReference w:val="rId89" w:type="default"/>
    <w:headerReference w:val="rId90" w:type="even"/>
    <w:headerReference w:val="rId91" w:type="first"/>
    <w:type w:val="oddPage"/>
    <w:pgSz w:w="11909" w:h="16834" w:code="9"/>
    <w:pgMar w:top="1440" w:right="1152" w:bottom="1440"
      w:left="1152" w:header="720" w:footer="720" w:gutter="0"/>
    <w:lnNumType w:countBy="1"/>
    <w:pgNumType w:fmt="lowerRoman"/>
    <w:cols w:space="720"/>
  </w:sectPr>
</w:body>

Each header has a corresponding <hdr> element in a Header part, which contains the text of the header.

example:
<w:hdr xmlns:w="…">
  <w:p>
    <w:pPr>
      <w:pStyle w:val="Header"/>
    </w:pPr>
    <w:r>
      <w:t>My Test Document</w:t>
    </w:r>
  </w:p>
</w:hdr>

Here is the odd header corresponding to the examples above:

<w:hdr xmlns:w="…">
  <w:p>
    <w:pPr>
      <w:pStyle w:val="Header"/>
    </w:pPr>
    <w:r>
      <w:tab/>
      <w:t>Table of Contents</w:t>
    </w:r>
  </w:p>
</w:hdr>

A Header part shall be located within the package containing the source relationship (expressed syntactically, the @TargetMode attribute of the <Relationship> element shall be Internal).

A Header part is permitted to have explicit relationships to the following parts defined by this Standard:

A Header part shall not have any implicit or explicit relationships to other parts defined by this Standard.