forked from eXist-db/exist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom-example.xq
30 lines (29 loc) · 1.15 KB
/
atom-example.xq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:atom="http://www.w3.org/2005/Atom">
<title>All Feeds Example</title>
<id>id:all</id>
{
"
",
let $current := substring-before(base-uri(/atom:feed),'/.feed.atom'),
$current-path := substring-after($current,'/db')
for $i in (collection($current)/atom:feed)
let $path := substring-after(substring-before(base-uri($i),'/.feed.atom'),'/db')
return ( <entry>
{
"
",
$i/atom:id,
"
",
$i/atom:title,
"
",
<summary> {
$i/atom:subtitle/@type,
$i/atom:subtitle/node()
}</summary>,
"
",
<link rel="alternate" type="application/atom+xml" href="/atom/edit{$path}"/> ,
"
"
}
</entry>,
"
"
)
}
</feed>