0

The sample xml -

<book>
    <Title type="fiction">XYZ</Title>
    <Title type="horror">XYZ</Title>
    <Title type="comedy">ABC</Title>
</book>

I want to pull all the docs which has type =fiction(XYZ title) and type=comedy(ABC title). Below query does not give expected result -

cts:and-query((
cts:element-attribute-range-query(xs:QName('Title'),xs:QName('type'),'=','fiction'),
cts:element-attribute-range-query(xs:QName('Title'),xs:QName('type'),'=','comedy'),
cts:element-range-query(xs:QName('Title'),'=','ABC'),
cts:element-range-query(xs:QName('Title'),'=','XYZ')
)
anuj_gupta
  • 131
  • 4
  • What result does it give? How are the results not accurate? Does it not return anything, or docs that don't match your criteria? Can you provide an example and explain what is not correct? It will help to diagnose. Just saying "does not give expected result" isn't very helpful. – Mads Hansen Apr 06 '23 at 23:27
  • It gives docs which does not match the criteria. – anuj_gupta Apr 07 '23 at 08:31
  • It looks like the attribute query and the element range query are not necessarily connected. Maybe with positions you can do some kind of near query? – asusu Apr 12 '23 at 17:00

0 Answers0