annotate summa/bilingual/merge.xpl @ 131:b97d856cd2bb

complete
author ht
date Sat, 13 Jul 2024 18:06:43 +0000
parents 75219c0115ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
1 <?xml version='1.0'?>
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
2 <!DOCTYPE p:pipeline SYSTEM "../../../../WWW/XML/XProc/docs/schemas/xproc.dtd" >
87
75219c0115ca version
ht
parents: 77
diff changeset
3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" version="1.0">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
4
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
5 <p:documentation xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
6 <div>Run this e.g. as follows:
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
7 xprocs --input source=../english/FP_ii.html merge.xpl lfs=../latin/sth1002.html\;../latin/sth1003.html\;../latin/sth1015.html rawpart=FP.ii</div>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
8 </p:documentation>
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
9
66
ht
parents: 54
diff changeset
10 <p:option name="lfs" required="true">
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
11 <p:documentation xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
12 <div>list of latin files, use ; as separator</div>
66
ht
parents: 54
diff changeset
13 </p:documentation>
ht
parents: 54
diff changeset
14 </p:option>
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
15
72
3dd981256764 fix summa links
ht
parents: 68
diff changeset
16 <p:variable name="rawpart" select="/x:div/@id"/>
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
17
72
3dd981256764 fix summa links
ht
parents: 68
diff changeset
18 <p:delete match="x:a[@href and not(text())]"/>
68
ht
parents: 66
diff changeset
19 <p:viewport match="x:div[@class='div3']" name="vp">
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
20 <p:xslt>
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
21 <p:input port="stylesheet">
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
22 <p:document href="fixup_e.xsl"/>
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
23 </p:input>
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
24 </p:xslt>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
25 <p:viewport match="x:div[@class='div4' and not(@id)]">
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
26 <p:documentation xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
27 <div>Treat tail of prooemium as index</div>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
28 </p:documentation>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
29 <p:xslt>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
30 <p:input port="stylesheet">
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
31 <p:inline xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
32 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:x="http://www.w3.org/1999/xhtml" exclude-result-prefixes="x xsl">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
33 <xsl:variable name="prefix" select="concat('#',substring-before(/x:div/x:p[1]/@id,'-'),'_A')"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
34 <xsl:template match="x:p[starts-with(.,' (')]">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
35 <xsl:copy>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
36 <xsl:apply-templates select="@*"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
37 <a href="{concat($prefix,substring-after(substring-before(.,')'),'('))}">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
38 <xsl:apply-templates select="node()"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
39 </a>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
40 </xsl:copy>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
41 </xsl:template>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
42
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
43 <xsl:template match="@*|node()">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
44 <xsl:copy>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
45 <xsl:apply-templates select="@*|node()"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
46 </xsl:copy>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
47 </xsl:template>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
48 </xsl:stylesheet>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
49 </p:inline>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
50 </p:input>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
51 </p:xslt>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
52 </p:viewport>
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
53 <p:xslt>
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
54 <p:input port="stylesheet">
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
55 <p:document href="merge.xsl"/>
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
56 </p:input>
66
ht
parents: 54
diff changeset
57 <p:with-param name="lfs" select="$lfs"/>
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
58 </p:xslt>
68
ht
parents: 66
diff changeset
59 <p:xslt>
ht
parents: 66
diff changeset
60 <p:input port="stylesheet">
ht
parents: 66
diff changeset
61 <p:document href="bi.xsl"/>
ht
parents: 66
diff changeset
62 </p:input>
72
3dd981256764 fix summa links
ht
parents: 68
diff changeset
63 <p:with-param name="rawpart" select="$rawpart"/>
68
ht
parents: 66
diff changeset
64 </p:xslt>
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
65 </p:viewport>
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
66 <p:insert match="x:body" position="first-child" name="wrap">
68
ht
parents: 66
diff changeset
67 <p:input port="source">
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
68 <p:inline xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
69 <html>
68
ht
parents: 66
diff changeset
70 <head>
ht
parents: 66
diff changeset
71 <title>Bilingual Aquinas</title>
ht
parents: 66
diff changeset
72 <style>
ht
parents: 66
diff changeset
73 h2, h3, h4 {margin-bottom: 0px; clear: both}
ht
parents: 66
diff changeset
74 .bilingual {clear: both; margin-top: .5em}
ht
parents: 66
diff changeset
75 div.eng {width: 45%; float: left}
ht
parents: 66
diff changeset
76 div.lat {width: 45%; float: right}
77
cd7d748fbb09 page break per question
ht
parents: 76
diff changeset
77 @page { size: A4 portrait; margin: 1cm;
cd7d748fbb09 page break per question
ht
parents: 76
diff changeset
78 orphans: 2; widows: 2;
cd7d748fbb09 page break per question
ht
parents: 76
diff changeset
79 }
cd7d748fbb09 page break per question
ht
parents: 76
diff changeset
80 @media print {div.div3 {page-break-before: always}}
68
ht
parents: 66
diff changeset
81 </style>
ht
parents: 66
diff changeset
82 </head>
ht
parents: 66
diff changeset
83 <body style="font-family: Bitstream Vera Serif">
ht
parents: 66
diff changeset
84 </body>
ht
parents: 66
diff changeset
85 </html></p:inline>
ht
parents: 66
diff changeset
86 </p:input>
ht
parents: 66
diff changeset
87 <p:input port="insertion">
ht
parents: 66
diff changeset
88 <p:pipe port="result" step="vp"/>
ht
parents: 66
diff changeset
89 </p:input>
ht
parents: 66
diff changeset
90 </p:insert>
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
91 <p:wrap-sequence wrapper="x:div">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
92 <p:input port="source" select="/*/*/x:h3">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
93 <p:pipe port="result" step="vp"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
94 </p:input>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
95 </p:wrap-sequence>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
96 <p:xslt name="toc">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
97 <p:input port="stylesheet">
76
2a8a66db129a fix ns decl glitches
ht
parents: 75
diff changeset
98 <p:inline xmlns="http://www.w3.org/1999/xhtml">
75
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
99 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:x="http://www.w3.org/1999/xhtml" exclude-result-prefixes="x xsl">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
100 <xsl:template match="/x:div">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
101 <div class="toc">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
102 <xsl:for-each select="x:h3">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
103 <a href="#{substring-before(@id,'-')}">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
104 <xsl:apply-templates/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
105 </a><br/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
106 </xsl:for-each>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
107 </div>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
108 </xsl:template>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
109 </xsl:stylesheet>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
110 </p:inline>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
111 </p:input>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
112 </p:xslt>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
113 <p:insert match="x:h2" position="after">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
114 <p:input port="source">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
115 <p:pipe step="wrap" port="result"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
116 </p:input>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
117 <p:input port="insertion">
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
118 <p:pipe step="toc" port="result"/>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
119 </p:input>
fad07ffd0386 add indices of questions and articles
ht
parents: 72
diff changeset
120 </p:insert>
54
77921d86a058 towards new format, pipeline
ht
parents:
diff changeset
121 </p:pipeline>