forked from faustedition/faust-gen-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-indexes.xpl
109 lines (95 loc) · 3.17 KB
/
generate-indexes.xpl
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:f="http://www.faustedition.net/ns"
xmlns:c="http://www.w3.org/ns/xproc-step"
type="f:generate-indexes"
name="main"
version="1.0">
<p:input port="source"/>
<p:input port="parameters" kind="parameter"/>
<p:output port="result" sequence="true">
<p:pipe port="result" step="end"/>
</p:output>
<!-- Parameter laden -->
<p:parameters name="config">
<p:input port="parameters">
<p:document href="config.xml"/>
<p:pipe port="parameters" step="main"></p:pipe>
</p:input>
</p:parameters>
<p:group name="body">
<p:variable name="source" select="//c:param[@name='source']/@value"><p:pipe port="result" step="config"/></p:variable>
<p:variable name="html" select="//c:param[@name='html']/@value"><p:pipe port="result" step="config"/></p:variable>
<p:identity name="transcripts">
<p:input port="source">
<p:pipe port="source" step="main"/>
</p:input>
</p:identity>
<!-- TODO more refactoring, less copypaste -->
<p:xslt name="index">
<p:input port="source">
<p:pipe port="result" step="transcripts"/>
</p:input>
<p:input port="stylesheet">
<p:document href="xslt/index.xsl"/>
</p:input>
<p:input port="parameters">
<p:pipe port="result" step="config"/>
</p:input>
<p:with-param name="type" select="'overview'"/>
</p:xslt>
<p:store method="xhtml" include-content-type="true" indent="true">
<p:with-option name="href" select="concat($html, 'index.html')"/>
</p:store>
<p:xslt name="index-prints">
<p:input port="source">
<p:pipe port="result" step="transcripts"/>
</p:input>
<p:input port="stylesheet">
<p:document href="xslt/index.xsl"/>
</p:input>
<p:input port="parameters">
<p:pipe port="result" step="config"/>
</p:input>
<p:with-param name="type" select="'print'"/>
</p:xslt>
<p:store method="xhtml" include-content-type="true" indent="true">
<p:with-option name="href" select="concat($html, 'prints.html')"/>
</p:store>
<p:xslt name="index-text">
<p:input port="source">
<p:pipe port="result" step="transcripts"/>
</p:input>
<p:input port="stylesheet">
<p:document href="xslt/index.xsl"/>
</p:input>
<p:input port="parameters">
<p:pipe port="result" step="config"/>
</p:input>
<p:with-param name="type" select="'text'"/>
</p:xslt>
<p:store method="xhtml" include-content-type="true" indent="true">
<p:with-option name="href" select="concat($html, 'text.html')"/>
</p:store>
<p:xslt name="index-ad">
<p:input port="source">
<p:pipe port="result" step="transcripts"/>
</p:input>
<p:input port="stylesheet">
<p:document href="xslt/index.xsl"/>
</p:input>
<p:input port="parameters">
<p:pipe port="result" step="config"/>
</p:input>
<p:with-param name="type" select="'archivalDocument'"/>
</p:xslt>
<p:store method="xhtml" include-content-type="true" indent="true">
<p:with-option name="href" select="concat($html, 'archivalDocuments.html')"/>
</p:store>
</p:group>
<p:identity name="end">
<p:input port="source">
<p:empty/>
</p:input>
</p:identity>
</p:declare-step>