Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / xhtml2 / header.xsl @ 187

History | View | Annotate | Download (4.5 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
3
                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
4
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
5
                xmlns:html="http://www.w3.org/1999/xhtml"
6

    
7
                xmlns:rng="http://relaxng.org/ns/structure/1.0"
8
                xmlns:tei="http://www.tei-c.org/ns/1.0"
9
                xmlns:teix="http://www.tei-c.org/ns/Examples"
10
                
11
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12
                version="2.0"
13
                exclude-result-prefixes="a fo rng tei teix">
14
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
15
      <desc>
16
         <p> TEI stylesheet dealing with elements from the header module,
17
      making HTML output. </p>
18
         <p>This software is dual-licensed:
19

    
20
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
21
Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
22

    
23
2. http://www.opensource.org/licenses/BSD-2-Clause
24
		
25
All rights reserved.
26

    
27
Redistribution and use in source and binary forms, with or without
28
modification, are permitted provided that the following conditions are
29
met:
30

    
31
* Redistributions of source code must retain the above copyright
32
notice, this list of conditions and the following disclaimer.
33

    
34
* Redistributions in binary form must reproduce the above copyright
35
notice, this list of conditions and the following disclaimer in the
36
documentation and/or other materials provided with the distribution.
37

    
38
This software is provided by the copyright holders and contributors
39
"as is" and any express or implied warranties, including, but not
40
limited to, the implied warranties of merchantability and fitness for
41
a particular purpose are disclaimed. In no event shall the copyright
42
holder or contributors be liable for any direct, indirect, incidental,
43
special, exemplary, or consequential damages (including, but not
44
limited to, procurement of substitute goods or services; loss of use,
45
data, or profits; or business interruption) however caused and on any
46
theory of liability, whether in contract, strict liability, or tort
47
(including negligence or otherwise) arising in any way out of the use
48
of this software, even if advised of the possibility of such damage.
49
</p>
50
         <p>Author: See AUTHORS</p>
51
         <p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
52
         <p>Copyright: 2011, TEI Consortium</p>
53
      </desc>
54
   </doc>
55

    
56
  <xsl:key name="ALL-EXTRENDITION" match="@rendition[not(starts-with(.,'#'))]" use="1"/>
57
  <xsl:key name="EXTRENDITION"     match="@rendition[not(starts-with(.,'#'))]" use="."/>
58
  <xsl:key name="ALL-LOCALRENDITION" match="tei:rendition" use='1'/>
59

    
60
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
61
      <desc>Process element teiHeader</desc>
62
   </doc>
63
  <xsl:template match="tei:teiHeader"/>
64

    
65
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
66
      <desc>make a style section from rendition elements in the header</desc>
67
   </doc>
68
  
69
  <xsl:template name="generateLocalCSS">
70
      <xsl:if test="key('ALL-LOCALRENDITION',1)">
71
         <style type="text/css">
72
	   <xsl:for-each select="key('ALL-LOCALRENDITION',1)">
73
	     <xsl:text>&#10;.</xsl:text>
74
	     <xsl:value-of select="@xml:id"/>
75
	     <xsl:text> {&#10;	</xsl:text>
76
	     <xsl:value-of select="."/>
77
	     <xsl:text>;&#10;}</xsl:text>
78
	   </xsl:for-each>
79
	   <xsl:text>&#10;</xsl:text>
80
         </style>
81
      </xsl:if>
82
      <xsl:if test="key('ALL-EXTRENDITION',1)">
83
         <style type="text/css">
84
	   <xsl:for-each select="key('ALL-EXTRENDITION',1)">
85
	     <xsl:variable name="pointer">
86
	       <xsl:value-of select="."/>
87
	     </xsl:variable>
88
	     <xsl:for-each select="key('RENDITION',$pointer)[1]">
89
	       <xsl:for-each select="document($pointer)">
90
		 <xsl:text>&#10;.</xsl:text>
91
		 <xsl:value-of select="@xml:id"/>
92
		 <xsl:text> {&#10;</xsl:text>
93
		 <xsl:value-of select="."/>
94
		 <xsl:text>;&#10;}</xsl:text>
95
	       </xsl:for-each>
96
	     </xsl:for-each>
97
	   </xsl:for-each>
98
         </style>
99
      </xsl:if>
100
  </xsl:template>
101

    
102
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
103
    <desc>[html] processing licence</desc>
104
  </doc>
105
  <xsl:template match="tei:availability"  mode="copyrighttext">
106
    <xsl:apply-templates mode="copyrighttext"/>
107
  </xsl:template>
108

    
109
  <xsl:template match="tei:licence"  mode="copyrighttext">
110
    <xsl:if test="@target">
111
      <xsl:text>[</xsl:text>
112
      <xsl:value-of select="@target"/>
113
      <xsl:text>] </xsl:text>
114
    </xsl:if>
115
    <xsl:apply-templates/>
116
  </xsl:template>
117
  
118

    
119

    
120
</xsl:stylesheet>