Create rules to map values for fields in XML invoices

Relatively simple to very complex rules can be used to map values in XML invoices to the correct fields in the corresponding XML invoice definition or profile to help Kofax ReadSoft Invoices automatically process invoices that belong to them. These options can be used to create rules:

  • Disable extractionremove a field from the invoice.
  • Use standard rules only – indicate the direct path to a specific element in the XML
  • Use advanced rules – rules are made up of conditional expressions that can be easily created for desired fields in an XML invoice definition using the XML Mapper
  • Use XSL – XSL syntax is used to describe how the value is derived. This can be written from scratch. Alternatively, the corresponding XSL can be imported for an existing advanced rule. In either case, a good knowledge of XSL syntax is required.

Whenever you use XSL to get a desired value, be sure to test the output when the data contains special characters (such as &).

To display special characters normally (an ampersand character, &, would be displayed as &, for example), add <xsl:output method="text" /> to the XSL snippet in this way.  



If this code is not added, the ampersand would be displayed as &amp;.

Tips!

  • To find information on the location and keywords, etc., that are currently specified for a field in the profile, select the field to the right on the corresponding tab, select the Field mapping rules tab on the left of the window, and expand Field profile properties.
  • For additional ideas on how rules can be used and implemented (or to see what a previous rule created looks like), look at existing rules that are defined for various fields for the XML invoice standard used in the invoices you receive. To do this, open the Fields tab in the XML Mapper and look for fields for which a rule is defined. You can tell by the appearance of the button to the right of the field:

    – a rule is defined.

    – no rule is defined.

To create rules to map values for fields in XML invoices

  1. Open the Optimize module.
  2. Double-click the invoice profile that contains the invoice definition that you want to optimize.
  3. In the list that is displayed, double-click an XML invoice definition that needs optimization (the cell in the Optimize column may read 99, for example). The XML Mapper is displayed.
  4. Continue with one of these sections:

Using standard rules only (default)

Standard rules can be used if there is one clear candidate for a value (among multiple candidates if listed).

  1. On the Field mapping rules tab, select Use standard rules only.

    Select a candidate from a list of multiple candidates directly in the Fields tab to the right on the screen. Or, on the XML tab, right-click the appropriate value and select Map element value to the selected invoice field: <field name>.

  2. Click Extract to ensure that there are not still multiple candidates. If there are, use advanced rules or XSL to further specify which of the candidates is the correct one.

Using advanced rules

Advanced rules are useful when there are multiple candidate values with the same path in the XML or when multiple conditions are required to describe when/how the value for a field should be extracted.

Here are several examples of how advanced rules can be used: