Getting the Content Type of a Part

To get the content type of a part, the package implementer shall perform the following steps [M2.9]:

  1. Compare the part name with the values specified for the @PartName attribute of the <Override> elements. The comparison shall be case-insensitive ASCII.

  2. If there is an <Override> element with a matching @PartName attribute, return the value of its @ContentType attribute. No further action is required.

  3. If there is no <Override> element with a matching @PartName attribute, then

    1. Get the extension from the part name by taking the substring to the right of the rightmost occurrence of the dot character (.) from the rightmost segment.

    2. Check the <Default> elements of the Content Types stream, comparing the extension with the value of the @Extension attribute. The comparison shall be case-insensitive ASCII.

  4. If there is a <Default> element with a matching @Extension attribute, return the value of its @ContentType attribute. No further action is required.

  5. If neither <Override> nor <Default> elements with matching attributes are found for the specified part name, the implementation shall not map this part name to a part.