Below is the XML file -
<Chapters>
<Chapter>
<Name>Introduction</Name>
<Heads>
<Head>
<No>1</No>
<Title>History of Internet</Title>
<Desc>
..............
</Desc>
</Head>
<Head>
<No>2</No>
<Title>History of HTML</Title>
<Desc>
..............
</Desc>
</Head>
</Heads>
</Chapter>
<Chapter>
<Name>Learn HTML</Name>
<Heads>
<Head>
<No>1</No>
<Title>Browsers</Title>
<Desc>
..............
</Desc>
</Head>
<Head>
<No>2</No>
<Title>Browser War</Title>
<Desc>
..............
</Desc>
</Head>
<Head>
<No>3</No>
<Title>HTML, DHTML</Title>
<Desc>
..............
</Desc>
</Head>
</Heads>
</Chapter>
</Chapters>
I want to list the Chapters/Chapter/Name=Introduction and Chapters/Chapter/Heads/Head/No=1 Following is the query which I am executing in baseX -
/Chapters/Chapter[contains(Name,'Introduction') and contains(Heads/Head/No,'1')]/Heads/Head/Title
And this is the error -
Query: Chapters/Chapter[contains(Name,'Introduction') and contains(Heads/Head/No,'1')]/Heads/Head/Title
Error: [XPTY0004] Single item expected, (element No { ... }, element No { ... }) found.
As per the baseX website, description of the Error XPTY0004 is -
This error is raised if an expression has the wrong type, or cannot be cast into the specified type. It may be raised both statically (during query compilation) or dynamically (at runtime).
What wrong m i doing??