and operator in Multiple Predicates
Thursday, 23 March 2017 · 2 messages
TD
Tushar Deshmukh23 Mar 2017 13:07 #
Namaste ,
and operator in predicates seems tobe not working.
my xquery is as below and xml is attached herewith.
declare namespace UDF="TallyUDF";
let $fromdate:=20170228
let $todate:=20170228
let $pledger_code:=57
let $pledger_status:="P"
for $allitems in db:open('10096',"Vouchers")/ENVELOPE/Voucher[./Date/text()Quoted text · 1 line
>= $fromdate and ./Date/text() <= $todate and
./AllLedgerEntries.LIST/UDF:AsPerListAllocations.LIST/UDF:ColPartyCode.LIST/UDF:ColPartyCode/text()= $pledger_code and
./AllLedgerEntries.LIST/UDF:AsPerListAllocations.LIST/UDF:MaheshCIFlag.LIST/UDF:MaheshCIFlag/text()=
$pledger_status]
return
$allitems/MasterIdExpected 2 records/nodes instead 4.
Tushar Deshmukh,
CG
Christian Grün23 Mar 2017 13:20 #
Namaste Tushar,
if you write to the list, please provide working examples. None of the XML files has a "Voucher" element. Apart from that, it is always helpful if you could first try to simplify your query and e.g. check if the behavior you describe can also be reproduced with a single document.
Thanks in advance,
Christian
Quoted text · Tushar Deshmukh · 25 lines
On Thu, Mar 23, 2017 at 1:07 PM, Tushar Deshmukh <tdlwala at gmail.com> wrote: > Namaste , > > and operator in predicates seems tobe not working. > > my xquery is as below and xml is attached herewith. > > declare namespace UDF="TallyUDF"; > let $fromdate:=20170228 > let $todate:=20170228 > let $pledger_code:=57 > let $pledger_status:="P" > for $allitems in db:open('10096',"Vouchers")/ENVELOPE/Voucher[./Date/text() >>= $fromdate and ./Date/text() <= $todate and > ./AllLedgerEntries.LIST/UDF:AsPerListAllocations.LIST/UDF:ColPartyCode.LIST/UDF:ColPartyCode/text()= > $pledger_code and > > ./AllLedgerEntries.LIST/UDF:AsPerListAllocations.LIST/UDF:MaheshCIFlag.LIST/UDF:MaheshCIFlag/text()= > $pledger_status] > return > $allitems/MasterId > > Expected 2 records/nodes instead 4. > Tushar Deshmukh, >
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery