Mapping Element

The Mapping element is used in DOCICON.XML to map particular document types to their respective icons.

Syntax

<Mapping
  AcceptHeader = "Text"
  EditText = "Text"
  Extension = "Text"
  HandlerUrl = "Text"
  Key = "Text"
  OpenControl = "Text"
  ProgId = "Text"
  Value = "Text">
</Mapping>

Attributes

Name Description
AcceptHeader Optional Text. Specifies the application to use to open a file in a document library. If HTML viewing is enabled, Windows SharePoint Services compares the value of this attribute with the Accept-Header HTTP header of the request and either opens the document in its native format through the specified application, or offers to convert the document to HTML. For more information, see Programming with the Microsoft.HtmlTrans.Interface Namespace.
EditText Optional Text. Specifies the name of the application used to edit the type of document.
Extension Optional Text. Specifies the file name extension for the document type.
HandlerUrl Optional Text. Specifies the URL of a back-end converter program used to handle a request when the client computer does not have the Microsoft Office application installed.
Key Required Text. Specifies either a ProgID or a file name extension.
OpenControl Optional Text. Specifies the name of the Microsoft ActiveX control used to open the type of document.
ProgId Optional Text. Specifies the name of the ActiveX control used to open the type of document.
Value Required Text. Specifies the URL to the image.

Element Relationships

Parent Elements
ByExtension, ByProgID, HtmlTrInfo

Example

The following code example maps ProgIDs and file name extensions as follows:

  • For different values of the ProgID <META> tag, it maps ProgIDs to the icons representing the applications. For example, "Excel.Sheet" maps to ichtmxls.gif.
  • It maps file name extensions to appropriate icons. For example, "doc" maps to icdoc.gif.
  • If neither of the above causes a match, it provides a default value, icgen.gif, for the mapping.
<DocIcons>
  <ByProgID>
    <Mapping Key="Excel.Sheet" Value="ichtmxls.gif"/>
    <Mapping Key="PowerPoint.Slide" Value="ichtmppt.gif"/>
    <Mapping Key="Word.Document" Value="ichtmdoc.gif"/>
  </ByProgID>
  <ByExtension>
    <Mapping Key="doc" Value="icdoc.gif"/>
    <Mapping Key="gif" Value="icgif.gif"/>
    <Mapping Key="htm" Value="ichtm.gif"/>
    <Mapping Key="html" Value="ichtm.gif"/>
    <Mapping Key="ppt" Value="icppt.gif"/>
  </ByExtension>
  <Default>
    <Mapping Value="icgen.gif"/>
  </Default>
</DocIcons>