Hello Florent,
the query
/A/B[C = 'value']/D/E/text()
should apply the text index and should be sufficiently fast. Do you encouter any problems with this approach? As a general note you most likely always want to avoid having descendant-or-self steps (i.e. //), as it has to search the whole XML (sub)tree. So being as specific as possible in giving the path is always a good idea.
Merry BaseX-mas, Dirk
On 12/23/2014 06:16 PM, Florent Gallaire wrote:
The value of the <C> element is different in each file.
On Tue, Dec 23, 2014 at 6:14 PM, Florent Gallaire fgallaire@gmail.com wrote:
Hello, I need some help to query a database of thousands of xml files. They are structured only with elements with no attributes :
file1.xml
<A> <B> <C>value</C> </B> <D> <E>text</E> </D> </A>
file2.xml
<A> <B> <C>value</C> </B> <D> <E>text</E> </D> </A>
and so on file3.xml, file4.xml....
Having the value of the <C> element, I would like to have the text of the <E> element.
What is the good query to do this ?
Best regards
Florent
-- FLOSS Engineer & Lawyer