XPath Property

Provides a way to point to a specific segment in the document.


public String getXPath();
public void setXPath(String XPath);

Default Value



The path is a series of one or more segment accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current XPath location.

The following are possible values for an element accessor:

IXRefers to the Interchange (root) node
FGRefers to a Functional Group node
TXRefers to a Transaction Set node
'name'The first segment or loop of the current container with the given schema name
name[i]The i-th segment of the current container with the given schema-name
[i]The i-th segment of the current container
[last()]The last segment of the current container
[last()-i]The segment located at the last location minus i in the current container
..The parent of the current container

When XPath is set to a valid path, XSegment points to the name of the segment, with XTag, XSegmentType, and XChildren providing other properties of the segment. The elements of the current segment are provided in the XElements collection.

BuildDOM must be set to bdEntireDocument or bdTransaction prior to parsing the document for the XPath functionality to be available.

Example (Setting XPath)

Document root (Interchange)EDIReaderControl.XPath = "/"
N1 segment in the first transactionEDIReaderControl.XPath = "/IX/FG/TX/N1Loop1/N1"
3-th instance of the N2 segmentEDIReaderControl.XPath = "/IX/FG/TX/N1Loop1/N2[3]"

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Java Edition - Version 20.0 [Build 8162]