我有xml列的表,需要在表中搜索数据
xml行的结构
<Employees>
<Emp>
<Name>Adam</Name>
<Department>Accounts</Department>
<Active>1</Active>
</Emp>
<Emp>
<Name>John</Name>
<Department>Marketing</Department>
<Active>0</Active>
</Emp>
<Emp>
<Name>Steve</Name>
<Department>Marketing</Department>
<Active>1</Active>
</Emp>
<Emp>
<Name>Michel</Name>
<Department>Marketing</Department>
<Active>0</Active>
</Emp>
<Emp>
<Name>Joe</Name>
<Department>Accounts</Department>
<Active>1</Active>
</Emp>
</Employees>
我想检查xml dept = accounts中是否存在并且active是否为1
答案 0 :(得分:0)
.exist('.//Emp[Department/text()[contains(., "Accounts")] and Active/text()[contains(., "1")]]')