Skip to content

Commit a7ddc06

Browse files
committed
Use oXygen to normalize whitespace
… most other articles in documentation use 2-space indent
1 parent e449ef5 commit a7ddc06

File tree

5 files changed

+151
-110
lines changed

5 files changed

+151
-110
lines changed

src/main/xar-resources/data/urlrewrite/listings/listing-1.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ declare variable $exist:prefix external;
99
declare variable $exist:root external;
1010

1111
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
12-
<forward url="{$exist:controller}/modules/transform.xq">
13-
<add-parameter name="doc" value="{$exist:resource}.xml"/>
14-
</forward>
12+
<forward url="{$exist:controller}/modules/transform.xq">
13+
<add-parameter name="doc" value="{$exist:resource}.xml"/>
14+
</forward>
1515
</dispatch>
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
if (starts-with($path, '/sandbox/execute'))
2-
then
3-
let $query := request:get-parameter("qu", ())
4-
let $startTime := util:system-time()
5-
return
6-
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
7-
<!-- Query is executed by XQueryServlet -->
8-
<forward servlet="XQueryServlet">
9-
<!-- Query is passed via the attribute 'xquery.source' -->
10-
<set-attribute name="xquery.source" value="{$query}"/>
11-
<!-- Results should be written into attribute 'results' -->
12-
<set-attribute name="xquery.attribute" value="results"/>
13-
<!-- Errors should be passed through instead of terminating the request -->
14-
<set-attribute name="xquery.report-errors" value="yes"/>
15-
</forward>
16-
<view>
17-
<!-- Post process the result: store it into the HTTP session and return the number of hits only. -->
18-
<forward url="session.xq">
19-
<clear-attribute name="xquery.source"/>
20-
<clear-attribute name="xquery.attribute"/>
21-
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
22-
</forward>
23-
</view>
24-
</dispatch>
25-
else if (starts-with($path, '/sandbox/results/'))
1+
if (starts-with($path, "/sandbox/execute"))
262
then
3+
let $query := request:get-parameter("qu", ())
4+
let $startTime := util:system-time()
5+
return
6+
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
7+
<!-- Query is executed by XQueryServlet -->
8+
<forward servlet="XQueryServlet">
9+
<!-- Query is passed via the attribute "xquery.source" -->
10+
<set-attribute name="xquery.source" value="{$query}"/>
11+
<!-- Results should be written into attribute "results" -->
12+
<set-attribute name="xquery.attribute" value="results"/>
13+
<!-- Errors should be passed through instead of terminating the request -->
14+
<set-attribute name="xquery.report-errors" value="yes"/>
15+
</forward>
16+
<view>
17+
<!-- Post process the result: store it into the HTTP session and return the number of hits only. -->
18+
<forward url="session.xq">
19+
<clear-attribute name="xquery.source"/>
20+
<clear-attribute name="xquery.attribute"/>
21+
<set-attribute name="elapsed" value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
22+
</forward>
23+
</view>
24+
</dispatch>
25+
else
26+
if (starts-with($path, "/sandbox/results/"))
27+
then
2728
(: Retrieve an item from the query results stored in the HTTP session. The
2829
format of the URL will be /sandbox/results/X, where X is the number of the
2930
item in the result set :)
3031
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
31-
<forward url="../session.xq">
32-
<add-parameter name="num" value="{$name}"/>
33-
</forward>
34-
</dispatch>
32+
<forward url="../session.xq">
33+
<add-parameter name="num" value="{$name}"/>
34+
</forward>
35+
</dispatch>

src/main/xar-resources/data/urlrewrite/listings/listing-2.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ declare variable $exist:prefix external;
99
declare variable $exist:root external;
1010

1111
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
12-
<forward url="data/{$exist:resource}.xml"/>
13-
<view>
14-
<forward url="{$exist:controller}/modules/transform.xq"/>
15-
</view>
12+
<forward url="data/{$exist:resource}.xml"/>
13+
<view>
14+
<forward url="{$exist:controller}/modules/transform.xq"/>
15+
</view>
1616
</dispatch>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if ($exist:path eq '/') then
2-
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
3-
<redirect url="index.xml"/>
4-
</dispatch>
1+
if ($exist:path eq "/") then
2+
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
3+
<redirect url="index.xml"/>
4+
</dispatch>

0 commit comments

Comments
 (0)