Add identifiers to XML invoice profiles

When a new XML profiles is created, identifiers need to be added to help the program distinguish the new profile from the XML invoice profile it is based on (or other profiles that are based on the same one). Identifiers can also be added by editing existing XML invoice profiles.

  1. Create a new XML invoice profile or edit an existing one.
  2. In the Save as new XML profile or Edit XML profile settings dialogs, select the Identifiers tab to specify identifiers that will distinguish the new profile from the one it's based on (identifiers that have already been specified for the base profile are already listed here):
    1. Make note of the text that you will need to enter in sub-step c below for the identifier that you want to add. Look in the XML code on the XML tab if needed.
    2. Click Add and select the type of identifier in the dropdown list that you want to add to the profile to distinguish it from the base profile.
    3. Type the appropriate text for the identifier in the Identifier text box.
    4. Click OK. The identifier type and name are added to the list in the dialog.
  3. Click Run for the Test identifiers on current XML invoice option to test the identifiers against the XML invoice source (not possible if accessed from the XML Maintenance dialog). The identification score for the identifier is found in the invoice source is indicated in the Match Result column of the dialog.
  4. You can test the profile against those invoices that are currently in the system by clicking Run for Test identifiers on all XML invoices in the system. As a result, all profiles are listed in the dialog including the Match result (identification score for each profile found in the system).
  5. Click OK when you are satisfied that invoices can be identified using the identifiers you have specified for the profile.

Three types of identifiers can be added, and it is important for the person doing it to understand how to differentiate them in the XML code:

  • Root identifiers - this is the first (and the last) element in the XML document, and it (or a part of it) or its attributes can be used as an identifier for the profile if it distinguishes this profile from the one the profile is based on. Multiple identifier suggestions can be specified for the root element. All are used to calculate the identification score for the invoice.

    Example:

    The XML code below represents our XML document:

    <XMLDocument type="invoice">
    <Buyer>
    </Buyer>
    <Supplier>
    </Supplier
    </XMLDocument>

    The XML document consequently contains the root element XMLDocument (including the type attribute) and the Buyer and Supplier elements.

    • To specify the root element as an identifier in this case, you would enter XMLDocument in the Identifier box of the Add a new identifier dialog. You could also specify any portion of it as an identifier, as well, such as XML, XMLDoc, Document, etc.
    • To specify the value of the root attribute as an identifier for a profile in this case, you would write XMLDocument@type (that is, XMLDocument is the root element and type is the attribute that you want to match to) in the Identifier box instead.
  • Namespace identifiers - an identifier of this type is found in the code in connection with the xmlns attribute. Either all or a portion of the text included within the quotation marks ("") can be used as a namespace identifier.

    Example:

    This code includes the namespace for an XML invoice. Any part of the text marked in red could be used as a namespace idenitifier(s) for the XML invoice profile.

    <Invoice schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 UBL-Invoice-2.0.xsd"
    xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
    cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
    ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2" sdt="urn:oasis:names:specification:ubl:schema:xsd:SpecializedDatatypes-2"
    udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2">

    It would also be possible to specify identifiers for this namespace using keywords that are included within the text above, such as, "oasis" or "unece".

  • Structure identifiers - these identifiers can be specified for any element in the XML code. You enter the path to the element that you want to use as an identifier, and the program simply looks for it in the code of incoming invoices to match the invoice to the profile (whether the path is found once or multiple times does not matter). It is advantageous to specify as many structure identifiers as possible. Each match increases the identification of the invoice with the profile, and all identifiers of this kind that are found are used to calculate the identification score for the invoice.

    Example:

    For this example, the XML code for our invoice looks like this:

    <XMLDocument type="invoice">
    <Buyer>
    </Buyer>
    <Supplier>
    </Supplier
    </XMLDocument>

    Structure identifiers could be specified for any of the elements in the code--XMLDocument, Buyer, or Supplier--by entering the XPath to the element in question in the Identifier box of the Add a new identifier dialog. That is, to specify the Buyer element as a structure identifier, for example, you would enter the text XMLDocument/Buyer in the Identifier box.

Use this procedure to add identifiers to XML invoice profiles:

  1. Create a new XML invoice profile or edit an existing one.
  2. In the Save as new XML profile or Edit XML profile settings dialogs, select the Identifierstab to specify identifiers that will distinguish the new profile from the one it is based on (identifiers that have already been specified for the base profile are already listed here):
    1. Make note of the text that you will need to enter in sub-step c below for the identifier that you want to add. Look in the XML code on the XML tab if needed.
    2. Click Add and select the type of identifier you want to add to the profile in the dropdown list to distinguish it from the base profile.
    3. Type the appropriate text for the identifier in the Identifier text box.
    4. Click OK. The identifier type and name are added to the list in the dialog.
  3. Click Run for the Test identifiers on current XML invoice option to test the identifiers against the XML invoice source (not possible if accessed from the XML Maintenance dialog). The identification score for the identifier is found in the invoice source is indicated in the Match Result column of the dialog.
  4. You can test the profile against those invoices that are currently in the system by clicking Run for Test identifiers on all XML invoices in the system. As a result, all profiles are listed in the dialog including the Match result (identification score for each profile found in the system).
  5. Click OK when you are satisfied that invoices can be identified using the identifiers you have specified for the profile.