You can also map paths using Relative XPaths. To use Relative XPaths in your XML Index DIP process, you must first select the Process Relative XPaths in Field Definitions box in the Import Processor Configuration window.
While absolute file paths always start with the root directory and point to the same location every time, relative file paths start with a given working directory. Relative paths therefore allow you to dynamically alter the working directory while maintaining the same file structure within it.
The XML processor internally translates the Relative Path into an Absolute Path to determine a tag's location.
Because every Relative Path must be internally translated, it will take longer to process an XML Index DIP job that includes Relative Paths.
See the following snippet of an XML Import Index File for an example:
Whenever you configure an XML Index DIP process using Relative Paths, you must configure the Begin Document tag as an Absolute Path. You can then use Relative Paths for the remaining tags in the document. For example, to configure a process using the sample file above, the Begin Document tag would be configured using this Absolute Path:
You can then access the other tags in the document by using Relative Paths. Relative Paths use the hierarchy configured in the Begin Document Absolute Path to access a specific node. The following example is a valid Relative Path because the PurchaseOrderNumber tag is contained within the PurchaseOrder node, which is part of the configured Absolute Path.
In order to access tags that are under a node that is not in the configured Absolute Path, enter two periods in place of the node you wish to move back from. The ../ character string tells the XML processor to go back one level in the XML hierarchy. This allows you to access nodes and tags that are not contained within the Absolute Path configured in your Begin Document string. For example, take the following XML Import Index File and configuration mapping:
The tags highlighted in yellow are contained within the Begin Document Absolute Path and can be accessed with a simple Relative Path. The tags highlighted in green, however, are not part of the Begin Document Absolute Path. These tags require the use of the ../ string to access the correct path. For example, take the Relative Path for the Author tag: ../../NewMemo/MemoInfo/MemoDate.
The XML processor translates this by starting from the Begin Document Absolute Path of /APInvRun/NewCheck/CheckInfo. The ../ string tells the processor to go down one level, so it modifies the path to /APInvRun/NewCheck. Then another ../ is encountered, so the path is modified to /APInvRun. The XML processor then adds the NewMemo, MemoInfo, and Author tags to the path, resulting in a translated Absolute Path of /APInvRun/NewMemo / MemoInfo/Author.
The following strings can be used to configure relative paths:
String |
Description |
---|---|
./ |
Use the current node. |
@name="123" |
Store the value of an attribute. In this example, a value of 123 is stored for the attribute name. |
../ |
Move down one node. |
../../ |
Move down two nodes. |