source: exist/trunk/xquery/atomList.xq @ 4427

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/trunk/xquery/atomList.xq@4427
Revision 4427, 591 bytes checked in by cbyrom, 11 years ago (diff)

Upgrade the various 'list' xqueries - to nest all results in a single
root element - so that only one document need be retrieved to get all
results + adjust ndgDirectory to cope with processing the new results +
fix the various namespaces mentioned in the codebase to map to the
current atom/moles ones.

Line 
1(: This is an Atom listing query for TargetCollection - returns EntryIDs and the files in which they exist :)
2declare default element namespace 'http://www.w3.org/2005/Atom';
3declare variable $targetCollection as xs:string := 'TargetCollection';
4<docs>
5{
6for $DE in collection($targetCollection)/entry/id let $f:=util:document-name($DE) return
7<dgMetadataRecord>
8    <repositoryID>{tokenize(string($DE), '__ATOM__')[2]}</repositoryID>
9    <fileName>{util:collection-name($DE)}/{$f}</fileName>
10    <created>{xmldb:created(util:collection-name($DE),$f)}</created>
11</dgMetadataRecord>
12}
13</docs>
Note: See TracBrowser for help on using the repository browser.