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 187 sjacqu01
<?xml version="1.0" encoding="utf-8"?>
2 187 sjacqu01
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
3 187 sjacqu01
                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
4 187 sjacqu01
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
5 187 sjacqu01
                xmlns:html="http://www.w3.org/1999/xhtml"
6 187 sjacqu01
7 187 sjacqu01
                xmlns:rng="http://relaxng.org/ns/structure/1.0"
8 187 sjacqu01
                xmlns:tei="http://www.tei-c.org/ns/1.0"
9 187 sjacqu01
                xmlns:teix="http://www.tei-c.org/ns/Examples"
10 187 sjacqu01
11 187 sjacqu01
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 187 sjacqu01
                version="2.0"
13 187 sjacqu01
                exclude-result-prefixes="a fo rng tei teix">
14 187 sjacqu01
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
15 187 sjacqu01
      <desc>
16 187 sjacqu01
         <p> TEI stylesheet dealing with elements from the header module,
17 187 sjacqu01
      making HTML output. </p>
18 187 sjacqu01
         <p>This software is dual-licensed:
19 187 sjacqu01
20 187 sjacqu01
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
21 187 sjacqu01
Unported License http://creativecommons.org/licenses/by-sa/3.0/
22 187 sjacqu01
23 187 sjacqu01
2. http://www.opensource.org/licenses/BSD-2-Clause
24 187 sjacqu01
25 187 sjacqu01
All rights reserved.
26 187 sjacqu01
27 187 sjacqu01
Redistribution and use in source and binary forms, with or without
28 187 sjacqu01
modification, are permitted provided that the following conditions are
29 187 sjacqu01
met:
30 187 sjacqu01
31 187 sjacqu01
* Redistributions of source code must retain the above copyright
32 187 sjacqu01
notice, this list of conditions and the following disclaimer.
33 187 sjacqu01
34 187 sjacqu01
* Redistributions in binary form must reproduce the above copyright
35 187 sjacqu01
notice, this list of conditions and the following disclaimer in the
36 187 sjacqu01
documentation and/or other materials provided with the distribution.
37 187 sjacqu01
38 187 sjacqu01
This software is provided by the copyright holders and contributors
39 187 sjacqu01
"as is" and any express or implied warranties, including, but not
40 187 sjacqu01
limited to, the implied warranties of merchantability and fitness for
41 187 sjacqu01
a particular purpose are disclaimed. In no event shall the copyright
42 187 sjacqu01
holder or contributors be liable for any direct, indirect, incidental,
43 187 sjacqu01
special, exemplary, or consequential damages (including, but not
44 187 sjacqu01
limited to, procurement of substitute goods or services; loss of use,
45 187 sjacqu01
data, or profits; or business interruption) however caused and on any
46 187 sjacqu01
theory of liability, whether in contract, strict liability, or tort
47 187 sjacqu01
(including negligence or otherwise) arising in any way out of the use
48 187 sjacqu01
of this software, even if advised of the possibility of such damage.
49 187 sjacqu01
</p>
50 187 sjacqu01
         <p>Author: See AUTHORS</p>
51 187 sjacqu01
         <p>Id: $Id: header.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
52 187 sjacqu01
         <p>Copyright: 2011, TEI Consortium</p>
53 187 sjacqu01
      </desc>
54 187 sjacqu01
   </doc>
55 187 sjacqu01
56 187 sjacqu01
  <xsl:key name="ALL-EXTRENDITION" match="@rendition[not(starts-with(.,'#'))]" use="1"/>
57 187 sjacqu01
  <xsl:key name="EXTRENDITION"     match="@rendition[not(starts-with(.,'#'))]" use="."/>
58 187 sjacqu01
  <xsl:key name="ALL-LOCALRENDITION" match="tei:rendition" use='1'/>
59 187 sjacqu01
60 187 sjacqu01
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
61 187 sjacqu01
      <desc>Process element teiHeader</desc>
62 187 sjacqu01
   </doc>
63 187 sjacqu01
  <xsl:template match="tei:teiHeader"/>
64 187 sjacqu01
65 187 sjacqu01
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
66 187 sjacqu01
      <desc>make a style section from rendition elements in the header</desc>
67 187 sjacqu01
   </doc>
68 187 sjacqu01
69 187 sjacqu01
  <xsl:template name="generateLocalCSS">
70 187 sjacqu01
      <xsl:if test="key('ALL-LOCALRENDITION',1)">
71 187 sjacqu01
         <style type="text/css">
72 187 sjacqu01
	   <xsl:for-each select="key('ALL-LOCALRENDITION',1)">
73 187 sjacqu01
	     <xsl:text>&#10;.</xsl:text>
74 187 sjacqu01
	     <xsl:value-of select="@xml:id"/>
75 187 sjacqu01
	     <xsl:text> {&#10;	</xsl:text>
76 187 sjacqu01
	     <xsl:value-of select="."/>
77 187 sjacqu01
	     <xsl:text>;&#10;}</xsl:text>
78 187 sjacqu01
	   </xsl:for-each>
79 187 sjacqu01
	   <xsl:text>&#10;</xsl:text>
80 187 sjacqu01
         </style>
81 187 sjacqu01
      </xsl:if>
82 187 sjacqu01
      <xsl:if test="key('ALL-EXTRENDITION',1)">
83 187 sjacqu01
         <style type="text/css">
84 187 sjacqu01
	   <xsl:for-each select="key('ALL-EXTRENDITION',1)">
85 187 sjacqu01
	     <xsl:variable name="pointer">
86 187 sjacqu01
	       <xsl:value-of select="."/>
87 187 sjacqu01
	     </xsl:variable>
88 187 sjacqu01
	     <xsl:for-each select="key('RENDITION',$pointer)[1]">
89 187 sjacqu01
	       <xsl:for-each select="document($pointer)">
90 187 sjacqu01
		 <xsl:text>&#10;.</xsl:text>
91 187 sjacqu01
		 <xsl:value-of select="@xml:id"/>
92 187 sjacqu01
		 <xsl:text> {&#10;</xsl:text>
93 187 sjacqu01
		 <xsl:value-of select="."/>
94 187 sjacqu01
		 <xsl:text>;&#10;}</xsl:text>
95 187 sjacqu01
	       </xsl:for-each>
96 187 sjacqu01
	     </xsl:for-each>
97 187 sjacqu01
	   </xsl:for-each>
98 187 sjacqu01
         </style>
99 187 sjacqu01
      </xsl:if>
100 187 sjacqu01
  </xsl:template>
101 187 sjacqu01
102 187 sjacqu01
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
103 187 sjacqu01
    <desc>[html] processing licence</desc>
104 187 sjacqu01
  </doc>
105 187 sjacqu01
  <xsl:template match="tei:availability"  mode="copyrighttext">
106 187 sjacqu01
    <xsl:apply-templates mode="copyrighttext"/>
107 187 sjacqu01
  </xsl:template>
108 187 sjacqu01
109 187 sjacqu01
  <xsl:template match="tei:licence"  mode="copyrighttext">
110 187 sjacqu01
    <xsl:if test="@target">
111 187 sjacqu01
      <xsl:text>[</xsl:text>
112 187 sjacqu01
      <xsl:value-of select="@target"/>
113 187 sjacqu01
      <xsl:text>] </xsl:text>
114 187 sjacqu01
    </xsl:if>
115 187 sjacqu01
    <xsl:apply-templates/>
116 187 sjacqu01
  </xsl:template>
117 187 sjacqu01
118 187 sjacqu01
119 187 sjacqu01
120 187 sjacqu01
</xsl:stylesheet>