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]:
Compare the part name with the values specified for the
@PartName
attribute of the<Override>
elements. The comparison shall be case-insensitive ASCII.If there is an
<Override>
element with a matching@PartName
attribute, return the value of its@ContentType
attribute. No further action is required.If there is no
<Override>
element with a matching@PartName
attribute, thenGet 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.
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.
If there is a
<Default>
element with a matching@Extension
attribute, return the value of its@ContentType
attribute. No further action is required.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.