Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

an example of Xquery with "AND" operator , please

Tags:

xquery

I think Xquery has not the "AND" operator and i cant do this:

if node1 = xxx and node2 = yyy and node3 = zzz then replace node3 with www

like image 721
mesmero Avatar asked Oct 26 '25 07:10

mesmero


1 Answers

XQuery has And Operator which is "and". it has OR operator also "or".

let $d := <Employee>
<Name>Test</Name>
<ID>1909239</ID>
<Address>test Add </Address>
<Email>[email protected]</Email>
<Department>Dept 1</Department>
<Department>Dept 2</Department>
<Department>Dept 3</Department>
<Department>Dept 4</Department>
<Department>Dept 5</Department>

return if( ($d//*:Department[1]/text() = 'Dept 1') and ($d//*:Department[1]/text() = 'Dept 2') ) then fn:true() else fn:false()
like image 113
kadalamittai Avatar answered Oct 29 '25 05:10

kadalamittai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!