Skip to main content

from above image i need to capture from “DatiGeneraliDocumento”
Data (Invoice Date)|
Numero (Invoice Number)|
ImportoTotaleDocumento |
and
from DatiDDT
Delivery number
Delivery Date

Consider using an online XPATH generator like this one:  https://extendsclass.com/xpath-tester.html

Paste your XML into the site and double-click on the XML tag. The XPATH shows up at the top of the page.

 


1) Read text from file "invoice.xml" into $sXMLContent$
2) XML > Load XML:
     - Source type: String
     - Source: $sXMLContent$
     - XML Object: $xmlInvoiceDoc$
3) XML > Get Single Node Value (Invoice Date):
     - XML Object: $xmlInvoiceDoc$
     - XPath: /FatturaElettronicaBody/DatiGenerali/DatiGeneraliDocumento/Data
     - Save to: $sInvoiceDate$
4) XML > Get Single Node Value (Invoice Number):
     - XPath: /FatturaElettronicaBody/DatiGenerali/DatiGeneraliDocumento/Numero
     - Save to: $sInvoiceNumber$
5) XML > Get Single Node Value (Invoice Total):
     - XPath: /FatturaElettronicaBody/DatiGenerali/DatiGeneraliDocumento/ImportoTotaleDocumento
     - Save to: $sInvoiceTotal$

6) XML > Get Multiple Node Values (all <DatiDDT>):
     - XPath: /FatturaElettronicaBody/DatiGenerali/DatiDDT
     - Save to: $nodeListDatiDDT$

7) LOOP: For each $currentDDT$ in $nodeListDatiDDT$
       a) XML > Get Single Node Value (Delivery Number):
          - Parent Node: $currentDDT$
          - XPath: NumeroDDT
          - Save to: $sDeliveryNumber$
       b) XML > Get Single Node Value (Delivery Date):
          - Parent Node: $currentDDT$
          - XPath: DataDDT
          - Save to: $sDeliveryDate$
       c) Log or store $sDeliveryNumber$ and $sDeliveryDate$ 
   END LOOP
 

 


Thanks ​@jeven.delacruz  will try to implement this


Reply