I am using the following xml document structure:
<feed>
<entry>
<title>Title 1</title>
</entry>
<entry>
<title>Entry by Sony</title>
</entry>
</feed>
I am iterating over all documents in the database whose document name starts with "feed" eg: feed_doc1, feed_doc2 etc. I am searching for documents which contain a given key word and trying to return the name of the document. I am using BaseX XML Database and I am using the following xquery:
for $doc_name in db:list()
where fn:starts-with($doc_name, 'feed')
return
for $node in doc($doc_name)/feed/entry[.//text() contains text 'Sony']]
return $doc_name
In short, my query should return the document names of all those documents which contain the key word 'Sony'.
I see the following error:
java.io.IOException: org.basex.query.item.FTxt cannot be cast to org.basex.query.item.QNm
I tried to google about this error but could not find sufficient help information. Can someone help?
Thanks, Sony
return string($doc_name)? - Travis Webb