|
1
|
1 <?xml version='1.0'?>
|
|
45
|
2 <!DOCTYPE xsl:stylesheet SYSTEM "../../../../lib/xml/xsl.dtd" >
|
|
69
|
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:x="http://www.w3.org/1999/xhtml">
|
|
72
|
4 <xsl:param name="rawpart"/>
|
|
128
|
5 <xsl:variable name="rpq" select="concat(substring-before($rawpart,'.'),'_Q')"/>
|
|
72
|
6 <xsl:variable name="part" select="concat(substring-before($rawpart,'.'),'_',substring-after($rawpart,'.'),'.html')"/>
|
|
|
7 <xsl:variable name="index" select="document('../english/index.xml',/)/*"/>
|
|
|
8 <xsl:key name="iq" match="file" use="substring-before(@name,'_')"/>
|
|
69
|
9
|
|
72
|
10 <xsl:template match="x:a[starts-with(@href,'summa.')]">
|
|
|
11 <xsl:variable name="tw" select="substring-before(substring-after(@href,'summa.'),'.')"/>
|
|
|
12 <xsl:variable name="tp" select="substring-before($tw,'_')"/>
|
|
|
13 <xsl:variable name="ta" select="substring-after($tw,'_A')"/>
|
|
|
14 <xsl:variable name="tq" select="number(substring-after(if ($ta='') then $tw else substring-before($tw,'_A'),'_Q'))"/>
|
|
|
15 <xsl:variable name="ff" select="key('iq',$tp,$index)"/>
|
|
|
16 <xsl:variable name="f" select="$ff[number(@first) le $tq][number(@last) ge $tq]/@name"/>
|
|
|
17 <xsl:message>ref: <xsl:value-of select="$tw"/><xsl:text> </xsl:text><xsl:value-of select="$f"/></xsl:message>
|
|
122
|
18 <xsl:message>ref: |<xsl:value-of select="$tp"/>|<xsl:value-of select="$tw"/>|<xsl:value-of select="$ta"/>|<xsl:value-of select="$tq"/>|</xsl:message>
|
|
72
|
19 <xsl:copy>
|
|
|
20 <xsl:attribute name="href"><xsl:value-of select="concat(if ($part=$f) then '' else (if ($f) then $f else 'unknown.html'),'#',$tw)"/></xsl:attribute>
|
|
|
21 <xsl:apply-templates select="@*[not(local-name()='href')]|node()"/>
|
|
|
22 </xsl:copy>
|
|
|
23 </xsl:template>
|
|
69
|
24
|
|
|
25 <xsl:template match="x:h3">
|
|
|
26 <xsl:copy>
|
|
|
27 <xsl:apply-templates select="@*"/>
|
|
128
|
28 <xsl:text>Q. </xsl:text><xsl:value-of select="substring-after(../@id,$rpq)"/><xsl:text>. </xsl:text>
|
|
69
|
29 <xsl:apply-templates/>
|
|
|
30 </xsl:copy>
|
|
1
|
31 </xsl:template>
|
|
|
32
|
|
69
|
33 <xsl:template match="x:h4">
|
|
|
34 <xsl:copy>
|
|
|
35 <xsl:apply-templates select="@*"/>
|
|
128
|
36 <xsl:text>Q. </xsl:text><xsl:value-of select="substring-after(../../@id,$rpq)"/><xsl:text>. A. </xsl:text>
|
|
69
|
37 <xsl:value-of select="substring-after(../@id,'_A')"/>
|
|
|
38 <xsl:text>. </xsl:text>
|
|
|
39 <xsl:apply-templates/>
|
|
|
40 </xsl:copy>
|
|
1
|
41 </xsl:template>
|
|
|
42
|
|
69
|
43 <xsl:template match="x:div[@class='bilingual']">
|
|
|
44 <xsl:copy>
|
|
|
45 <xsl:apply-templates select="@*"/>
|
|
|
46 <div class="eng"><xsl:apply-templates select="*[1]"/></div>
|
|
|
47 <div class="lat"><xsl:apply-templates select="*[2]"/></div>
|
|
|
48 </xsl:copy>
|
|
1
|
49 </xsl:template>
|
|
|
50
|
|
69
|
51 <xsl:template match="node()|@*">
|
|
1
|
52 <xsl:copy>
|
|
|
53 <xsl:apply-templates select="node()|@*"/>
|
|
|
54 </xsl:copy>
|
|
|
55 </xsl:template>
|
|
|
56 </xsl:stylesheet>
|