XQuery in TNTBase
Addressing path-based collection of documents
XQuery syntax in TNTBase does not differ almost at all from the original XQuery except one TNTBase specific thing. Namely, when you want to designate the whole collection of TNTBase documents you should write tnt:collection(). If you want to query for a collection of particular documents you should use tnt:collection(<path>) in your XQuery. Path may contain *, ? and . For example, tnt:collection(//*.omdoc) stands for all documents in TNTBase which extension is omdoc, or tnt:collection(lectures//math*//?omdoc.xml) stands for all xml files which are met in sub-folders of lectures folder which start with math. Moreover these xml end with omdoc.xml and may or may not start with an arbitrary symbol which is allowed in a path. Also you can use tnt:doc(<path_to_doc>>) in XQuery which denoted the single document in TNTBase.
Querying previous revisions
If you want to query previous revisions, you can utilize functions described in the previous sections, but provide a revision number (of type xs:integer) as the second parameter. Note, that these function will return only those documents that have been "cached" in TNTBase. Refer to RESTful interface page for more details
Querying auxiliary documents associated with physical documents in TNTBase
One should use functions tnt:doc and tnt:collection with providing type name as the second parameter. For more info refer to the Integration page
Working with Virtual Documents
Before it's worth to understand the concept of a virtual documents at VD. You can retrieve the content via the tnt:vdoc('/path/to/vd.xml') function and submit an edited VD via tnt:sibmit-vd('/path/to/vd.xml', <modified_vd/>, 'xSVN log message')
