Statistics
| Revision:

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

History | View | Annotate | Download (4.5 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet  xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:teix="http://www.tei-c.org/ns/Examples" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="s html a fo rng tei teix" version="2.0">
3

    
4
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
5
    <desc>
6
      <p> TEI stylesheet dealing with elements from the tagdocs module,
7
      making HTML output. </p>
8
      <p>This software is dual-licensed:
9

    
10
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
11
Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
12

    
13
2. http://www.opensource.org/licenses/BSD-2-Clause
14
		
15
All rights reserved.
16

    
17
Redistribution and use in source and binary forms, with or without
18
modification, are permitted provided that the following conditions are
19
met:
20

    
21
* Redistributions of source code must retain the above copyright
22
notice, this list of conditions and the following disclaimer.
23

    
24
* Redistributions in binary form must reproduce the above copyright
25
notice, this list of conditions and the following disclaimer in the
26
documentation and/or other materials provided with the distribution.
27

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

    
46
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
47
    <desc>Process elements teix:egXML</desc>
48
  </doc>
49
  <xsl:template match="teix:egXML">
50
    <xsl:param name="simple">false</xsl:param>
51
    <xsl:param name="highlight"/>
52
    <div>
53
      <xsl:attribute name="id">
54
        <xsl:apply-templates mode="ident" select="."/>
55
      </xsl:attribute>
56
      <xsl:attribute name="class">
57
	<xsl:text>pre</xsl:text>
58
	<xsl:if test="not(*)">
59
	  <xsl:text> cdata</xsl:text>
60
	</xsl:if>
61
	<xsl:choose>
62
	  <xsl:when test="@valid='feasible'">
63
	    <xsl:text> egXML_feasible</xsl:text>
64
	  </xsl:when>
65
	  <xsl:when test="@valid='false'">
66
	    <xsl:text> egXML_invalid</xsl:text>
67
	  </xsl:when>
68
	  <xsl:otherwise>
69
	    <xsl:text> egXML_valid</xsl:text>
70
	  </xsl:otherwise>
71
	</xsl:choose>
72
      </xsl:attribute>
73
      <xsl:choose>
74
        <xsl:when test="$simple='true'">
75
          <xsl:apply-templates mode="verbatim">
76
            <xsl:with-param name="highlight">
77
              <xsl:value-of select="$highlight"/>
78
            </xsl:with-param>
79
          </xsl:apply-templates>
80
        </xsl:when>
81
        <xsl:otherwise>
82
          <xsl:call-template name="egXMLStartHook"/>
83
          <xsl:apply-templates mode="verbatim">
84
            <xsl:with-param name="highlight">
85
              <xsl:value-of select="$highlight"/>
86
            </xsl:with-param>
87
          </xsl:apply-templates>
88
          <xsl:call-template name="egXMLEndHook"/>
89
        </xsl:otherwise>
90
      </xsl:choose>
91
    </div>
92
  </xsl:template>
93

    
94
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
95
    <desc>Process element ident</desc>
96
  </doc>
97
  <xsl:template match="tei:ident">
98
    <xsl:choose>
99
      <xsl:when test="@type">
100
        <span class="ident-{@type}">
101
          <xsl:apply-templates/>
102
        </span>
103
      </xsl:when>
104
      <xsl:otherwise>
105
        <span class="ident">
106
          <xsl:apply-templates/>
107
        </span>
108
      </xsl:otherwise>
109
    </xsl:choose>
110
  </xsl:template>
111

    
112
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
113
    <desc>Process element gi</desc>
114
  </doc>
115
  <xsl:template match="tei:gi">
116
    <span class="gi">
117
      <xsl:text>&lt;</xsl:text>
118
      <xsl:apply-templates/>
119
      <xsl:text>&gt;</xsl:text>
120
    </span>
121
  </xsl:template>
122
</xsl:stylesheet>