Below is the XML file -
<Continents>
<Continent n="Asia">
<Country n="Thailand">
<City>
<Name>Bangkok</Name>
<Desc>Capital on Thailand</Desc>
</City>
</Country>
<Country n="India">
<City>
<Name>New Delhi</Name>
<Desc>Capital on India</Desc>
</City>
<City>
<Name>Mumbai</Name>
<Desc>Financial capital on India</Desc>
</City>
<City>
<Name>Chennai</Name>
<Desc>A very good city</Desc>
</City>
</Country>
</Continent>
</Continents>
Using baseX, I am writing a query to display the Name of cities containing the word Capital but is returning error. The query is -
/Continents/Continent[contains(Country/City/Desc,'Capital')]/Country/City/Name
and the error is - Error: [XPTY0004] Single item expected, (element Desc { ... }, element Desc { ... }, ...) found.
Please help me out.. Is it required to use FLWOR for such queries?