lets introduce an approach which is using datatables for configuring the extraction with the help of XPath:
Readin XML, parse to XObject (Ensure via dependency manager UiPath.WebApi.Acitivities is referenced):
Build the Extraction Config for the static part and the dynamic (lines) part:
add dynamicly the different columns to the extrac Datatable for later holding the extracted values:
Iterate of the extract config for the statics , extract the value and store it to a datarow (created with dtExtract.NewRow).
Retrieve all line elements:
- iterate now over all line elements
- create a DataRow (drExtractRow) for holding the extraction result
- transfer with one go the extraction result of the statics to the drExtractRows
drExtractRow.ItemArray = drStaticPart.ItemArray
(So we can reuse the static part again without multiple redundant extractions) - iterate over the extraction config for the dynamics and extract the values
- finally add drExtractRows to the Datatable dtExtract

as it was an adoption from here:
with the help of webtools (F12) in Browser the remaining XPath statements can be grabbed:
ensure also following:
Find starter help here:
StaticDynamicRetrieval_ByXpathConfig.xaml (17.9 KB)