Multiple Property Values

When you need to assign alternate values for a single property based on the context.

Typically the dd elements in the property map file contain the value assigned for the defined property. However, there are times that you may need to assign different values to different book components that are being processed by the same property map file.

In order to do this you must be applying properties to structured documents. There also must be a common attribute on the root element of all components in the book.

Let’s say that your files have a mapelemtype attribute on the root element, and the value of this attribute is either “chapter” or “appendix”. You want the value of a ComponentType variable to be “Chapter” when it’s applied to the mapelemtype='chapter' files and “Appendix” when applied to the mapelemtype='appendix' files.

First, locate the PropertyMapper.ini file and set the value of the MatchAttrName parameter to “mapelemtype”. Next, set up the entry for the ComponentType variable in your property map with two dd elements. Each dd element should have the otherprops attribute set to “matchattrname=value”.

... 
<dl> 
  <dlentry> 
    <dt>VarFmt:Fmt:ComponentType</dt> 
    <dd otherprops="mapelemtype=chapter">Chapter</dd> 
    <dd otherprops="mapelemtype=appendix">Appendix</dd> 
  </dlentry> 
  ... 
</dl> 
...

When the MatchAttrName value is set in the INI file, the property assignment process first checks for a dd with the appropriate otherprops value. If found that one is used, otherwise, the value of the first dd is used (regardless of the otherprops value).