annotate summa/bilingual/fixup_e.xsl @ 46:6cfdc13efd8a

from www.ccel.org/ss/
author ht
date Sun, 20 Dec 2009 22:10:12 +0000
parents 2bff41f49349
children 77921d86a058
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
1 <?xml version='1.0'?>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
2 <!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" >
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
4
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
5 <xsl:output doctype-system="../../dtd/ThML10.dtd"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
6
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
7 <xsl:template match="node()|@*">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
8 <xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
9 <xsl:apply-templates select="node()|@*"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
10 </xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
11 </xsl:template>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
12
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
13 <!-- Next three should not be necessary, but the -expand:off switch doesn't seem to be working in Saxon 9 -->
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
14 <xsl:template match="p/@shownumber[.='no']"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
15
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
16 <xsl:template match="a/@shape[.='rect']"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
17
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
18 <xsl:template match="a/@xml:link[.='simple']"/> <!-- ! bogus, but hard to fix -->
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
19
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
20 <xsl:template match="div4[not(div/*[@xml:lang='la'])
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
21 and div/p[@xml:lang='en'
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
22 and not(b)]]">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
23 <!-- Try to detect cases where a single sub-part (typically the respondeo) is spread over multiple paras, and merge them. Don't mess with anything that
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
24 has latin already -->
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
25 <xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
26 <xsl:apply-templates select="@*|h4"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
27 <xsl:for-each-group select="div/p" group-starting-with="p[*[1][self::b]]">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
28 <!--<xsl:message><xsl:value-of select="../../@id"/>: <xsl:value-of select="position()"/>,<xsl:value-of select="count(current-group())"/></xsl:message>-->
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
29 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
30 <div class="bilingual">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
31 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
32 <xsl:choose>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
33 <xsl:when test="current-group()[2]">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
34 <div xml:lang="en">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
35 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
36 <xsl:apply-templates select="current-group()"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
37 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
38 </div>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
39 </xsl:when>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
40 <xsl:otherwise>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
41 <xsl:apply-templates select="current-group()"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
42 </xsl:otherwise>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
43 </xsl:choose>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
44 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
45 </div>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
46 </xsl:for-each-group>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
47 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
48 </xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
49 </xsl:template>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
50
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
51 <xsl:template match="div3[div[2]]">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
52 <!-- Try to detect the splayed out questions at the beginning of each Question -->
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
53 <xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
54 <xsl:apply-templates select="@*"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
55 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
56 <xsl:apply-templates select="h3"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
57 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
58 <div class="bilingual">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
59 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
60 <div xml:lang="en">
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
61 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
62 <xsl:apply-templates select="div/p"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
63 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
64 </div>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
65 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
66 </div>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
67 <xsl:text>&#10;</xsl:text>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
68 <xsl:apply-templates select="div4"/>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
69 </xsl:copy>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
70 </xsl:template>
2bff41f49349 automated grouping, Question 13 merged
ht
parents:
diff changeset
71 </xsl:stylesheet>