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