Advanced XML rule example: Translate an XML value to one that Kofax ReadSoft Invoices understands

This example is taken from the standard advanced rules that are provided with the Svefaktura XML invoice standards.

Different XML invoice standards can contain different values to indicate whether the invoice is a debit or credit invoice (for example, E2B, OIOUBL, and Svefaktura all include the value "380" in connection with the InvoiceType field to indicate that the invoice in question is a debit invoice). If any other value is found in the expected location, the invoice is a credit invoice. Kofax ReadSoft Invoices, on the other hand, looks for 0 in connection with debit invoices and 1 for credit invoices.

To create an advanced rule that translates an XML value to one that Kofax ReadSoft Invoices understands:

  1. Select the InvoiceType field under the Fields category on the Fields tab of the XML Mapper (on the right side of the window).
    • Click the button to the right of the value:

      if no rule has been defined, or

      if there is already an existing rule for the field.

  2. Click the Select button to the right of the XML node selection section of the Advanced rules toward the top of the Field mapping rules tab that is displayed on the left of the window.
  3. In the XML node selected to work with box to the right of the button, expand x:Invoice.
  4. Navigate to and select the sub-node that contains the value that describes the invoice type. In this case, it is x:Invoice\x:InvoiceTypeCode.
  5. In the Settings for new condition section of the dialog, select Based on value.
  6. Select Equals in the drop-down list under Value comparison.
  7. Select the correct attribute in the drop-down list under Value to compare with (380 in this case).
  8. Click Add. The corresponding condition is added to the Conditions to work with box:


  9. Click the condition that you just added.
  10. In the Settings to define how the invoice field value is set settings, select If condition is true and Use value below.
  11. Type 0 in the edit box.
  12. Click Add. The code equivalent is added to Rules applied to map this field.
         Field.FieldValue = "0":
  13. Select if condition is false and Use value below.
  14. Type 1 in the edit box.
  15. Click Add. The code equivalent is added to Rules applied to map this field.

    Field.FieldValue = "1":

  16. Select Use advanced rules.

Click Extract and review the image to check the results. If you need to modify the rule, you need to click it in the Rules applied to map this field box, click Del to delete it, make the changes needed to fix the rule, and click Add again to add the modified rule. If you need to modify a condition, the process is the same (and if a rule is based on it, the rule is also deleted if you delete the condition).

Consider if the change(s) should apply to all invoices or only those for the current XML invoice definition. Click Save XML definition to save the change for the current XML invoice definition only (that is, the current supplier). Click Save XML profile if you want the rule to apply to all XML invoices that match the XML invoice profile regardless of the XML invoice definition.

Other examples of advanced XML rules:

Correct a misspelled field name in connection with master data

Format an extracted XML value with XSL

Modify an extracted XML field value with XSL

Remove hyphens (-) from an extracted value

Select node X based on node Y (or on attribute a)

Select a specific node when more than one node matches after using a standard rule

Select node X if it exists and node Y if it does not

Specify a constant value for a field

Summarize data from line items as a note in summary invoices