Mercurial > hg > mpdl-group
comparison software/eXist/webapp/mpdl/_stuff/testDev/archimedes-figures.xql @ 7:5589d865af7a
Erstellung XQL/XSL Applikation
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 08 Feb 2011 15:16:46 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:2396a569e446 | 7:5589d865af7a |
---|---|
1 xquery version "1.0"; | |
2 | |
3 declare namespace xlink="http://www.w3.org/1999/xlink"; | |
4 declare namespace echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/"; | |
5 declare namespace exist="http://exist.sourceforge.net/NS/exist"; | |
6 declare namespace util = "http://exist-db.org/xquery/util"; | |
7 | |
8 | |
9 let $coll := collection('/db/mpdl/documents/standard/archimedes') | |
10 let $tmpResult := $coll//figure | |
11 let $result := | |
12 for $figure at $pos in $tmpResult | |
13 let $collName := util:collection-name($figure) | |
14 let $shortCollName := substring-after(substring-after(substring-after(substring-after(substring-after($collName, "/"), "/"), "/"), "/"), "/") | |
15 let $docName := util:document-name($figure) | |
16 let $mpdlDocUri := concat("/", $shortCollName, "/", $docName) | |
17 let $fullDocName := concat($collName, "/", $docName) | |
18 let $document := doc($fullDocName) | |
19 let $pageBreaks := $document//pb | |
20 let $pnOfFigure := count($pageBreaks[. << $figure]) | |
21 let $hit := | |
22 <li> | |
23 <a href="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/page-query-result.xql?document={$mpdlDocUri}&pn={$pnOfFigure}&mode=text">{$mpdlDocUri}, Page {$pnOfFigure}</a> | |
24 </li> | |
25 order by $fullDocName, $pnOfFigure | |
26 return $hit | |
27 | |
28 return | |
29 <html> | |
30 <body> | |
31 <h2>All figures in all Archimedes documents</h2> | |
32 <ol>{$result}</ol> | |
33 </body> | |
34 </html> |