Defining formatters

To declare formatters at configuration or installation time, modify the XML files using the Format Editor (recommended), Graphical Builder, or any ASCII editor. These formatters can be dynamically updated at runtime.
The following are example definitions of formatters as they might appear in a toolkit format definition file.

A simple data field formatter (StringFormat):

<fmtDef id="accountFormat"> 
  <fString dataName="accountType" formatAs="lowercase"/> 
</fmtDef> 

A RecordFormat with two data fields:

<fmtDef id="userIdFormat"> 
  <record dataName="userIdKcoll"> 
    <fString dataName="userId"/> 
    <fString dataName="password"/> 
  </record> 
</fmtDef> 

A RecordFormat uses the <refFmt> tag to reference another formatter. In this case, the <refFmt> is referencing a formatter named userIdFormat without redefining any of its attributes. To create a different instance of the formatter using the original definition but changing some of its attributes, you use the <param> tag to specify which attribute to override and the attribute's new value.

<fmtDef id="nestedFormat"> 
  <record dataName="anotherKcoll"> 
    <refFmt refId="userIdFormat"/> 
    <fDate dataName="currentDate" hrs="12 amString="AM"/> 
  </record> 
</fmtDef> 

An XMLFormat:

<fmtDef id="xml1c"> 
  <fXML dataName="branchManager" includeDataType="true"/> 
    <fString dataName="Name"/> <delim delimChar="#"/> 
    <fString dataName="LastName"/> <delim delimChar="#"/> 
  </fXML> 
</fmtDef> 

A DynamicRecordFormat:

<fmtDef id="drec2b"> 
  <dRecord dataName="branchManager"> 
    <fString dataName="Name"/><delim delimChar="#"/> 
    <fString dataName="LastName"/><delim delimChar="#"/> 
    <fString dataName="Address"/><delim delimChar="#"/>

  </dRecord> 
</fmtDef> 

A DynamicXMLFormat that also includes three references to data elements in the branch context:

<fmtDef id="dxml"> 
  <fdXML kCollInsertedOnFormat="yes" createKCollOnUnformat="no"/> 
    <pointer dataName="branchId" context="branch"/> 
    <pointer dataName="branchKColl" context="branch"/> 
    <pointer dataName="branchManager" context="branch"/> 
  </fdXML> 
</fmtDef>