on 10-06-2016 8:49 PM
Hello Experts,
Issue: Structure is :
Invoices -- > InvoiceDetail --> InvoiceType
There can be multiple Invoice details.
I need to get the last value of InvoiceType and compare it with an constant.
IF its true mapping ABC will be used, if its false, mapping xyz will be used.
The trick is to find the last or latest value of InvoiceType as this is an incremental xml.
I tried the folowing:
If I give a constant value to the position function for comparison it works, but here i need to find the last value which can have any position
(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[position() = 3] NE Adjustment) – it works
(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[max(position())] NE Adjustment) – it fails
(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType[last()] NE Adjustment) – it fails
/tXML/Message/Order/Invoices/InvoiceDetail\[position() = max(position())\]/InvoiceType - it fails
Please help!!
Thanks
Shikha
Hi Shikha,
try with the below condition
(/tXML/Message/Order/Invoices/InvoiceDetail/InvoiceType)[last()]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You Navdeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.