Mercurial > hg > Aquinas
comparison summa/bilingual/merge.xpl @ 75:fad07ffd0386
add indices of questions and articles
| author | ht |
|---|---|
| date | Tue, 05 Jan 2010 16:18:40 +0000 |
| parents | 3dd981256764 |
| children | 2a8a66db129a |
comparison
equal
deleted
inserted
replaced
| 74:c7ec38b835c6 | 75:fad07ffd0386 |
|---|---|
| 1 <?xml version='1.0'?> | 1 <?xml version='1.0'?> |
| 2 <!DOCTYPE p:pipeline SYSTEM "../../../../WWW/XML/XProc/docs/schemas/xproc.dtd" > | 2 <!DOCTYPE p:pipeline SYSTEM "../../../../WWW/XML/XProc/docs/schemas/xproc.dtd" > |
| 3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml"> | 3 <p:pipeline xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | |
| 5 <p:documentation> | |
| 6 <div>Run this e.g. as follows: | |
| 7 xprocs --input source=../english/FP_ii.html merge.xpl lfs=../latin/sth1002.html\;../latin/sth1003.html\;../latin/sth1015.html rawpart=FP.ii</div> | |
| 8 </p:documentation> | |
| 4 <p:option name="lfs" required="true"> | 9 <p:option name="lfs" required="true"> |
| 5 <p:documentation> | 10 <p:documentation> |
| 6 <div xmlns="http://www.w3.org/1999/xhtml">list of latin files, use ; as separator</div> | 11 <div>list of latin files, use ; as separator</div> |
| 7 </p:documentation> | 12 </p:documentation> |
| 8 </p:option> | 13 </p:option> |
| 9 <p:variable name="rawpart" select="/x:div/@id"/> | 14 <p:variable name="rawpart" select="/x:div/@id"/> |
| 10 <p:delete match="x:a[@href and not(text())]"/> | 15 <p:delete match="x:a[@href and not(text())]"/> |
| 11 <p:viewport match="x:div[@class='div3']" name="vp"> | 16 <p:viewport match="x:div[@class='div3']" name="vp"> |
| 12 <p:xslt> | 17 <p:xslt> |
| 13 <p:input port="stylesheet"> | 18 <p:input port="stylesheet"> |
| 14 <p:document href="fixup_e.xsl"/> | 19 <p:document href="fixup_e.xsl"/> |
| 15 </p:input> | 20 </p:input> |
| 16 </p:xslt> | 21 </p:xslt> |
| 22 <p:viewport match="x:div[@class='div4' and not(@id)]"> | |
| 23 <p:documentation> | |
| 24 <div>Treat tail of prooemium as index</div> | |
| 25 </p:documentation> | |
| 26 <p:xslt> | |
| 27 <p:input port="stylesheet"> | |
| 28 <p:inline> | |
| 29 <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"> | |
| 30 <xsl:variable name="prefix" select="concat('#',substring-before(/x:div/x:p[1]/@id,'-'),'_A')"/> | |
| 31 <xsl:template match="x:p[starts-with(.,' (')]"> | |
| 32 <xsl:copy> | |
| 33 <xsl:apply-templates select="@*"/> | |
| 34 <a href="{concat($prefix,substring-after(substring-before(.,')'),'('))}"> | |
| 35 <xsl:apply-templates select="node()"/> | |
| 36 </a> | |
| 37 </xsl:copy> | |
| 38 </xsl:template> | |
| 39 | |
| 40 <xsl:template match="@*|node()"> | |
| 41 <xsl:copy> | |
| 42 <xsl:apply-templates select="@*|node()"/> | |
| 43 </xsl:copy> | |
| 44 </xsl:template> | |
| 45 </xsl:stylesheet> | |
| 46 </p:inline> | |
| 47 </p:input> | |
| 48 </p:xslt> | |
| 49 </p:viewport> | |
| 17 <p:xslt> | 50 <p:xslt> |
| 18 <p:input port="stylesheet"> | 51 <p:input port="stylesheet"> |
| 19 <p:document href="merge.xsl"/> | 52 <p:document href="merge.xsl"/> |
| 20 </p:input> | 53 </p:input> |
| 21 <p:with-param name="lfs" select="$lfs"/> | 54 <p:with-param name="lfs" select="$lfs"/> |
| 25 <p:document href="bi.xsl"/> | 58 <p:document href="bi.xsl"/> |
| 26 </p:input> | 59 </p:input> |
| 27 <p:with-param name="rawpart" select="$rawpart"/> | 60 <p:with-param name="rawpart" select="$rawpart"/> |
| 28 </p:xslt> | 61 </p:xslt> |
| 29 </p:viewport> | 62 </p:viewport> |
| 30 <p:insert match="x:body" position="first-child"> | 63 <p:insert match="x:body" position="first-child" name="wrap"> |
| 31 <p:input port="source"> | 64 <p:input port="source"> |
| 32 <p:inline> | 65 <p:inline> |
| 33 <html xmlns="http://www.w3.org/1999/xhtml"> | 66 <html> |
| 34 <head> | 67 <head> |
| 35 <title>Bilingual Aquinas</title> | 68 <title>Bilingual Aquinas</title> |
| 36 <style> | 69 <style> |
| 37 h2, h3, h4 {margin-bottom: 0px; clear: both} | 70 h2, h3, h4 {margin-bottom: 0px; clear: both} |
| 38 .bilingual {clear: both; margin-top: .5em} | 71 .bilingual {clear: both; margin-top: .5em} |
| 47 </p:input> | 80 </p:input> |
| 48 <p:input port="insertion"> | 81 <p:input port="insertion"> |
| 49 <p:pipe port="result" step="vp"/> | 82 <p:pipe port="result" step="vp"/> |
| 50 </p:input> | 83 </p:input> |
| 51 </p:insert> | 84 </p:insert> |
| 85 <p:wrap-sequence wrapper="x:div"> | |
| 86 <p:input port="source" select="/*/*/x:h3"> | |
| 87 <p:pipe port="result" step="vp"/> | |
| 88 </p:input> | |
| 89 </p:wrap-sequence> | |
| 90 <p:xslt name="toc"> | |
| 91 <p:input port="stylesheet"> | |
| 92 <p:inline> | |
| 93 <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"> | |
| 94 <xsl:template match="/x:div"> | |
| 95 <div class="toc"> | |
| 96 <xsl:for-each select="x:h3"> | |
| 97 <a href="#{substring-before(@id,'-')}"> | |
| 98 <xsl:apply-templates/> | |
| 99 </a><br/> | |
| 100 </xsl:for-each> | |
| 101 </div> | |
| 102 </xsl:template> | |
| 103 </xsl:stylesheet> | |
| 104 </p:inline> | |
| 105 </p:input> | |
| 106 </p:xslt> | |
| 107 <p:insert match="x:h2" position="after"> | |
| 108 <p:input port="source"> | |
| 109 <p:pipe step="wrap" port="result"/> | |
| 110 </p:input> | |
| 111 <p:input port="insertion"> | |
| 112 <p:pipe step="toc" port="result"/> | |
| 113 </p:input> | |
| 114 </p:insert> | |
| 52 </p:pipeline> | 115 </p:pipeline> |
