|
17
|
1 <?xml version='1.0'?>
|
|
|
2 <!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" >
|
|
|
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
|
|
4
|
|
|
5 <xsl:output doctype-system="../../dtd/ThML10.dtd"/>
|
|
|
6
|
|
|
7 <xsl:template match="node()|@*">
|
|
|
8 <xsl:copy>
|
|
|
9 <xsl:apply-templates select="node()|@*"/>
|
|
|
10 </xsl:copy>
|
|
|
11 </xsl:template>
|
|
|
12
|
|
|
13 <!-- Next three should not be necessary, but the -expand:off switch doesn't seem to be working in Saxon 9 -->
|
|
|
14 <xsl:template match="p/@shownumber[.='no']"/>
|
|
|
15
|
|
|
16 <xsl:template match="a/@shape[.='rect']"/>
|
|
|
17
|
|
|
18 <xsl:template match="a/@xml:link[.='simple']"/> <!-- ! bogus, but hard to fix -->
|
|
|
19
|
|
|
20 <xsl:template match="div4[not(div/*[@xml:lang='la'])
|
|
|
21 and div/p[@xml:lang='en'
|
|
|
22 and not(b)]]">
|
|
|
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
|
|
|
24 has latin already -->
|
|
|
25 <xsl:copy>
|
|
|
26 <xsl:apply-templates select="@*|h4"/>
|
|
|
27 <xsl:for-each-group select="div/p" group-starting-with="p[*[1][self::b]]">
|
|
|
28 <!--<xsl:message><xsl:value-of select="../../@id"/>: <xsl:value-of select="position()"/>,<xsl:value-of select="count(current-group())"/></xsl:message>-->
|
|
|
29 <xsl:text> </xsl:text>
|
|
|
30 <div class="bilingual">
|
|
|
31 <xsl:text> </xsl:text>
|
|
|
32 <xsl:choose>
|
|
|
33 <xsl:when test="current-group()[2]">
|
|
|
34 <div xml:lang="en">
|
|
|
35 <xsl:text> </xsl:text>
|
|
|
36 <xsl:apply-templates select="current-group()"/>
|
|
|
37 <xsl:text> </xsl:text>
|
|
|
38 </div>
|
|
|
39 </xsl:when>
|
|
|
40 <xsl:otherwise>
|
|
|
41 <xsl:apply-templates select="current-group()"/>
|
|
|
42 </xsl:otherwise>
|
|
|
43 </xsl:choose>
|
|
|
44 <xsl:text> </xsl:text>
|
|
|
45 </div>
|
|
|
46 </xsl:for-each-group>
|
|
|
47 <xsl:text> </xsl:text>
|
|
|
48 </xsl:copy>
|
|
|
49 </xsl:template>
|
|
|
50
|
|
|
51 <xsl:template match="div3[div[2]]">
|
|
|
52 <!-- Try to detect the splayed out questions at the beginning of each Question -->
|
|
|
53 <xsl:copy>
|
|
|
54 <xsl:apply-templates select="@*"/>
|
|
|
55 <xsl:text> </xsl:text>
|
|
|
56 <xsl:apply-templates select="h3"/>
|
|
|
57 <xsl:text> </xsl:text>
|
|
|
58 <div class="bilingual">
|
|
|
59 <xsl:text> </xsl:text>
|
|
|
60 <div xml:lang="en">
|
|
|
61 <xsl:text> </xsl:text>
|
|
|
62 <xsl:apply-templates select="div/p"/>
|
|
|
63 <xsl:text> </xsl:text>
|
|
|
64 </div>
|
|
|
65 <xsl:text> </xsl:text>
|
|
|
66 </div>
|
|
|
67 <xsl:text> </xsl:text>
|
|
|
68 <xsl:apply-templates select="div4"/>
|
|
|
69 </xsl:copy>
|
|
|
70 </xsl:template>
|
|
|
71 </xsl:stylesheet>
|