Advanced topics in data integration 439
The XPath to uniquely identify the row node is shown in the following example:
datapacket/row[@id=’xxx’]
In this example, xxx represents a value for the id attribute. In a typical case, the id
attribute in the XML file would be bound to the
id field of the DataSet component.
Therefore, the
rowNodeKey value would be as follows:
datapacket/row[@id=’?id’]
The question mark symbol (?) identifies that this is a field parameter. The id value
specifies the name of the field in the data set. At runtime, the XUpdateResolver
component substitutes the value from the
id field of the data set to generate the correct
XPath for the specified record.
In the next example, the contacts node with a category attribute of Management
represents the record(s) within the XML file, and the
employeeId subnode contains the
value that makes the record unique:
<datapacket>
<company id="5" name="ABC tech">
<contacts category="Mgmt">
<contact>
<empId>555</employeeId>
<name>Steve Woo</name>
<email>steve.woo@abctech.com</email>
</contact>
<contact>
<empId>382</employeeId>
<name>John Phillips</name>
<email>john.phillips@abctech.com</email>
</contact>
...
...
</contacts>
<contacts category="Executives">
...
...
</contacts>
...
...
</company>
</datapacket>
The rowNodeKey value for this XML file would be as follows:
datapacket/company/contacts[@category=’Mgmt’]/contact[empId=’?empId’]