Dear Ramzi,
Can I select a number of xml nodes from the document without the rest? For example returning only the last 200 xml messages ? if yes how to make it happen with REST methods?
If you want to limit your results to the first 200 XML documents, you can e.g. attach an XQuery string as query parameter:
http://localhost:8984/rest/your-db?query=subsequence(.,1,200)"
If all elements are stored in a single database, just replace the "." (which refers to the documents of your database) with a path expression:
http://localhost:8984/rest/your-db?query=subsequence(/path/to/your/result/no...)"
A wildcard step (* or */*) may already be sufficient to access all root nodes of a document.
How can the application know the number and names of existing documents in the database , didn’t find an xquery for this.
The number of documents can be retrieved with the count function, and db:path is helpful for requesting the document paths:
http://localhost:8984/rest/your-db?query=count(.) http://localhost/rest/NYT-1987?query=subsequence(.,1,200)!db:path(.)"
The BaseX GUI is probably the best place to write your XPath queries. If the results are satisfying, you can dispatch them via REST.
Hope this helps, Christian