summaryrefslogtreecommitdiff
path: root/docs/docbook/xslt/db2latex/mathml/mathml.content.mod.xsl
blob: ded65f4a9c8cf4351c9c0514b7bbaab6936d25d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet
[
 <!ENTITY % mmlalias PUBLIC "MathML alias" "ent/mmlalias.ent">  %mmlalias;
 <!ENTITY % mmlextra PUBLIC "MathML extra" "ent/mmlextra.ent">  %mmlextra;
]>
<!--############################################################################# 
 |	$Id: mathml.content.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $		
 |- #############################################################################
 |	$Author: ab $												
 |														
 |   PURPOSE: MathML content markup.
 |	Note: these elements are not part of the DocBook DTD. I have extended
 |    the docbook DTD in order to support this tags, so that's why I have these 
 |	templates here.
 |   
 |	MathML namespace used -> mml
 + ############################################################################## -->

<xsl:stylesheet version='1.0'
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML">

<xsl:template match="mml:semantics">
</xsl:template>


<xsl:template match="mml:set|mml:list">
</xsl:template>


<xsl:template match="mml:matrix">
</xsl:template>

<xsl:template match="mml:reln">
</xsl:template>

<xsl:template match="mml:lambda">
</xsl:template>






<!-- Interval -->
<!-- att. closure : open, closed, open-closed, or closed-open, with a default value of closed. -->
<xsl:template match="mml:interval">
<xsl:choose>
	<xsl:when test="@closure = 'open'">		
		<xsl:call-template name="interval.render">
		<xsl:with-param name="node" select="."/>
		<xsl:with-param name="fst">\left( </xsl:with-param>
		<xsl:with-param name="scd">\right) </xsl:with-param>
		</xsl:call-template>
	</xsl:when>
	<xsl:when test="@closure = 'open-closed'">	
		<xsl:call-template name="interval.render">
		<xsl:with-param name="node" select="."/>
		<xsl:with-param name="fst">\left( </xsl:with-param>
		<xsl:with-param name="scd">\right] </xsl:with-param>
		</xsl:call-template>
	</xsl:when>
	<xsl:when test="@closure = 'closed-open'">	
		<xsl:call-template name="interval.render">
		<xsl:with-param name="node" select="."/>
		<xsl:with-param name="fst">\left[ </xsl:with-param>
		<xsl:with-param name="scd">\right) </xsl:with-param>
		</xsl:call-template>
	</xsl:when>
	<xsl:otherwise> 
		<xsl:call-template name="interval.render">
		<xsl:with-param name="node" select="."/>
		<xsl:with-param name="fst">\left[ </xsl:with-param>
		<xsl:with-param name="scd">\right] </xsl:with-param>
		</xsl:call-template>
	</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="interval.render">
<xsl:param name="node"/>
<xsl:param name="fst"/>
<xsl:param name="scd"/>
<xsl:choose>
	<!-- Two real numbers define the interval -->
	<xsl:when test="count(child::*) = 2">
		<xsl:value-of select="$fst"/>
		<xsl:apply-templates select="$node/child::*[1]"/>
		<xsl:text> , </xsl:text>
		<xsl:apply-templates select="$node/child::*[2]"/>
		<xsl:value-of select="$scd"/>
	</xsl:when>
	<!-- A condition defines the interval -->
	<xsl:otherwise> </xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>