Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this mapping scenario, a record for each of the item numbers needs to be created. To do so, an itemnumber in the source XML document must be mapped to the target's itemnumber column. When we do this, we are creating one (target) record for each (source) instockitem entry.

NoteNOTE: Items that are listed more than once will create additional records. In this simple example, this will equate to 4 records (ABC-123ABC-456ABC-123DEF-456).

...

To get the Cost attribute, map the attributevalue element of the attribute tag to the Cost field of the target. Since there can be more than one attribute code/value entry under the attribute tag, you must specify which attribute will map to the target's Cost field. Thus, you must define which exact attribute to use for the Cost field. In this example, it is the cost attribute code.

CautionCAUTION: The data elements from the source that are candidates must be data elements that are at the same level as the mapped data element, which means that it can only be attributecode. Using any other level above or below this would not make sense.

...

Follow these steps to map Cost correctly:

  • Select the [V] under the attributevalue element in the source pane.
  • Click on Cost in the target pane.
  • Click the Map icon.
  • Click on the Formula icon to display the Formula Builder.

...

  • The Formula Builder should appear. Open the Instance folder in the left pane, and select Select the FindValue() function function.
  • Click the Insert button to add this function to your expression.

...

    • The last parameter returns the source data element’s value. Making sure the expression’s last <arg> is highlighted, replace it by double-clicking the attributevalue’s  the attributevalue’s [V] data element.
  • Compare your expression with the figure below, then click OK to close the window when you are finished.

...

  • Source Document Structure: The source document is an XML document with many levels, some of which loop. Note that this DTD is different from the one in Sample Situation 1: In this DTD, the warehouse information is separated from the instock items.

  • Source Document Data: This file contains sample data that mirrors the DTD file's structure.
  • Target Document Structure: The target document is a text file. This target structure differs from the Sample 1 target because it uses a separate column to identify each warehouse.
     

Scenario

Similar to Sample 1, we want to create a record for each of the item numbers, but we want to have each of the warehouses be listed by columns in the target. To do so, we need to create one record for each instockitem entry in the source XML file. In this example, this will equate to 3 records (ABC-123, ABC-456, DEF-456).

...

  • WH123’s data needs to be qualified. Select the target’s WH123 data element and click the Formula button to launch the Formula Builder.

 

  • The Formula Builder should appear. Open the Instance folder the Instance folder in the left pane, and select the FindValue() function.
  • Click the Insert button to add this function to your expression.
  • The new expression appears in the pane at the top of the dialog.

...

 

  • You now need to correctly configure the function’s parameters:
    • Carefully highlight the first <arg> in your expression at the top of the window. This parameter should be the name of the attribute, so type“WH123”, replacing the <arg> in the expression.

    • This parameter provides the code used in the source data element. Making sure the expression’s second <arg> is highlighted, replace it by double-clicking the attributecode’s [V] data element.

    • The last parameter returns the source data element’s value. Making sure the expression’s last <arg> is highlighted, replace it by double-clicking the attributevalue’s [V] data element.

...