~ubuntu-branches/ubuntu/vivid/installation-guide/vivid-proposed

« back to all changes in this revision

Viewing changes to build/stylesheets/db2latex/mathml/mathml.mod.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Frans Pop
  • Date: 2005-10-25 17:37:25 UTC
  • Revision ID: james.westby@ubuntu.com-20051025173725-aq0bm11be7bfd7rw
Tags: 20051025
* Mention in copyright that full GPL is included in the manual.
  Closes: #334925
* Register installed documents with doc-base.
* Minor updates in English text and translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version='1.0'?>
 
2
<!DOCTYPE xsl:stylesheet
 
3
[
 
4
 <!ENTITY % mmlalias PUBLIC "MathML alias" "ent/mmlalias.ent">  %mmlalias;
 
5
 <!ENTITY % mmlextra PUBLIC "MathML extra" "ent/mmlextra.ent">  %mmlextra;
 
6
]>
 
7
<!--############################################################################# 
 
8
 |      $Id: mathml.mod.xsl,v 1.4 2004/01/18 10:39:23 j-devenish Exp $          
 
9
 |- #############################################################################
 
10
 |      $Author: j-devenish $
 
11
 |                                                                                                              
 
12
 |   PURPOSE: MathML presentation and content markup.
 
13
 |      Note: these elements are not part of the DocBook DTD. I have extended
 
14
 |    the docbook DTD in order to support this tags, so that's why I have these 
 
15
 |      templates here.
 
16
 |   
 
17
 |      MathML namespace used -> mml
 
18
 + ############################################################################## -->
 
19
 
 
20
<xsl:stylesheet version='1.0'
 
21
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
22
        xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML">
 
23
 
 
24
        <xsl:strip-space elements="mml:math mml:mrow"/>
 
25
 
 
26
        <xsl:template match="mml:math">
 
27
                <xsl:text>\begin{displaymath}</xsl:text>
 
28
                <xsl:apply-templates/>
 
29
                <xsl:text>\end{displaymath}%&#10;</xsl:text>
 
30
        </xsl:template>
 
31
 
 
32
        <xsl:template match="mml:math[@mode='inline']">
 
33
                <xsl:text>\begin{math}</xsl:text>
 
34
                <xsl:apply-templates/>
 
35
                <xsl:text>\end{math}</xsl:text>
 
36
        </xsl:template>
 
37
 
 
38
        <xsl:template match="mml:math[@mode='display']">
 
39
                <xsl:text>\begin{displaymath}</xsl:text>
 
40
                <xsl:apply-templates/>
 
41
                <xsl:text>\end{displaymath}%&#10;</xsl:text>
 
42
        </xsl:template>
 
43
 
 
44
        <xsl:template match="p">
 
45
                <xsl:text>\section{</xsl:text> <xsl:value-of select="normalize-space(.)"/> <xsl:text>}&#10;</xsl:text>
 
46
        </xsl:template>
 
47
 
 
48
</xsl:stylesheet>