<?xml version="1.0"?>
<!--

This stylesheet defines a character map converting (most of) the MathML
symbols we generate into named entities compatible with the MathML DTD.
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output use-character-maps="mathml-entities"/>

  <xsl:character-map name="mathml-entities">
    <!-- (Not sure this is a good idea!)
    <xsl:output-character character="&#x006a;" string="&amp;jmath;"/>
    -->
    <xsl:output-character character="&#x00ac;" string="&amp;not;"/>
    <xsl:output-character character="&#x00b1;" string="&amp;pm;"/>
    <xsl:output-character character="&#x00c5;" string="&amp;Aring;"/>
    <xsl:output-character character="&#x00d7;" string="&amp;times;"/>
    <xsl:output-character character="&#x00e5;" string="&amp;aring;"/>
    <xsl:output-character character="&#x00f7;" string="&amp;div;"/>
    <xsl:output-character character="&#x0131;" string="&amp;inodot;"/>
    <xsl:output-character character="&#x03b1;" string="&amp;alpha;"/>
    <xsl:output-character character="&#x03b2;" string="&amp;beta;"/>
    <xsl:output-character character="&#x03b3;" string="&amp;gamma;"/>
    <xsl:output-character character="&#x03b4;" string="&amp;delta;"/>
    <xsl:output-character character="&#x03f5;" string="&amp;straightepsilon;"/>
    <xsl:output-character character="&#x03b5;" string="&amp;varepsilon;"/>
    <xsl:output-character character="&#x03b6;" string="&amp;zeta;"/>
    <xsl:output-character character="&#x03b7;" string="&amp;eta;"/>
    <xsl:output-character character="&#x03b8;" string="&amp;theta;"/>
    <xsl:output-character character="&#x03d1;" string="&amp;vartheta;"/>
    <xsl:output-character character="&#x03b9;" string="&amp;iota;"/>
    <xsl:output-character character="&#x03ba;" string="&amp;kappa;"/>
    <xsl:output-character character="&#x03bb;" string="&amp;lambda;"/>
    <xsl:output-character character="&#x03bc;" string="&amp;mu;"/>
    <xsl:output-character character="&#x03bd;" string="&amp;nu;"/>
    <xsl:output-character character="&#x03be;" string="&amp;xi;"/>
    <xsl:output-character character="&#x03c0;" string="&amp;pi;"/>
    <xsl:output-character character="&#x03d6;" string="&amp;varpi;"/>
    <xsl:output-character character="&#x03c1;" string="&amp;rho;"/>
    <xsl:output-character character="&#x03f1;" string="&amp;varrho;"/>
    <xsl:output-character character="&#x03c3;" string="&amp;sigma;"/>
    <xsl:output-character character="&#x03c2;" string="&amp;varsigma;"/>
    <xsl:output-character character="&#x03c4;" string="&amp;tau;"/>
    <xsl:output-character character="&#x03c5;" string="&amp;upsilon;"/>
    <xsl:output-character character="&#x03c6;" string="&amp;varphi;"/>
    <xsl:output-character character="&#x03d5;" string="&amp;straightphi;"/>
    <xsl:output-character character="&#x03c7;" string="&amp;chi;"/>
    <xsl:output-character character="&#x03c8;" string="&amp;psi;"/>
    <xsl:output-character character="&#x03c9;" string="&amp;omega;"/>
    <xsl:output-character character="&#x0393;" string="&amp;Gamma;"/>
    <xsl:output-character character="&#x0394;" string="&amp;Delta;"/>
    <xsl:output-character character="&#x0398;" string="&amp;Theta;"/>
    <xsl:output-character character="&#x039b;" string="&amp;Lambda;"/>
    <xsl:output-character character="&#x039e;" string="&amp;Xi;"/>
    <xsl:output-character character="&#x03a0;" string="&amp;Pi;"/>
    <xsl:output-character character="&#x03a3;" string="&amp;Sigma;"/>
    <xsl:output-character character="&#x03a5;" string="&amp;Upsilon;"/>
    <xsl:output-character character="&#x03a6;" string="&amp;Phi;"/>
    <xsl:output-character character="&#x03a8;" string="&amp;Psi;"/>
    <xsl:output-character character="&#x03a9;" string="&amp;Omega;"/>
    <xsl:output-character character="&#x2032;" string="&amp;prime;"/>
    <xsl:output-character character="&#x2020;" string="&amp;dagger;"/>
    <xsl:output-character character="&#x2021;" string="&amp;ddagger;"/>
    <xsl:output-character character="&#x2022;" string="&amp;bullet;"/>
    <xsl:output-character character="&#x2061;" string="&amp;ApplyFunction;"/>
    <xsl:output-character character="&#x2062;" string="&amp;InvisibleTimes;"/>
    <xsl:output-character character="&#x210f;" string="&amp;hslash;"/>
    <xsl:output-character character="&#x2113;" string="&amp;ell;"/>
    <xsl:output-character character="&#x2118;" string="&amp;wp;"/>
    <xsl:output-character character="&#x211c;" string="&amp;realpart;"/>
    <xsl:output-character character="&#x2111;" string="&amp;imagpart;"/>
    <xsl:output-character character="&#x2127;" string="&amp;mho;"/>
    <xsl:output-character character="&#x2135;" string="&amp;aleph;"/>
    <xsl:output-character character="&#x2190;" string="&amp;ShortLeftArrow;"/>
    <xsl:output-character character="&#x2191;" string="&amp;uparrow;"/>
    <xsl:output-character character="&#x2192;" string="&amp;ShortRightArrow;"/>
    <xsl:output-character character="&#x2193;" string="&amp;ShortDownArrow;"/>
    <xsl:output-character character="&#x2194;" string="&amp;leftrightarrow;"/>
    <xsl:output-character character="&#x2195;" string="&amp;updownarrow;"/>
    <xsl:output-character character="&#x2196;" string="&amp;UpperLeftArrow;"/>
    <xsl:output-character character="&#x2197;" string="&amp;UpperRightArrow;"/>
    <xsl:output-character character="&#x2198;" string="&amp;searrow;"/>
    <xsl:output-character character="&#x2199;" string="&amp;swarrow;"/>
    <xsl:output-character character="&#x21a6;" string="&amp;RightTeeArrow;"/>
    <xsl:output-character character="&#x21a9;" string="&amp;hookleftarrow;"/>
    <xsl:output-character character="&#x21aa;" string="&amp;hookrightarrow;"/>
    <xsl:output-character character="&#x21bc;" string="&amp;LeftVector;"/>
    <xsl:output-character character="&#x21bd;" string="&amp;leftharpoondown;"/>
    <xsl:output-character character="&#x21c0;" string="&amp;RightVector;"/>
    <xsl:output-character character="&#x21c1;" string="&amp;rightharpoondown;"/>
    <xsl:output-character character="&#x21cc;" string="&amp;rightleftharpoons;"/>
    <xsl:output-character character="&#x21d0;" string="&amp;Leftarrow;"/>
    <xsl:output-character character="&#x21d1;" string="&amp;Uparrow;"/>
    <xsl:output-character character="&#x21d2;" string="&amp;Rightarrow;"/>
    <xsl:output-character character="&#x21d3;" string="&amp;Downarrow;"/>
    <xsl:output-character character="&#x21d4;" string="&amp;Leftrightarrow;"/>
    <xsl:output-character character="&#x21d5;" string="&amp;Updownarrow;"/>
    <xsl:output-character character="&#x2200;" string="&amp;ForAll;"/>
    <xsl:output-character character="&#x2202;" string="&amp;PartialD;"/>
    <xsl:output-character character="&#x2203;" string="&amp;Exists;"/>
    <xsl:output-character character="&#x2205;" string="&amp;varnothing;"/>
    <xsl:output-character character="&#x2207;" string="&amp;Del;"/>
    <xsl:output-character character="&#x2208;" string="&amp;in;"/>
    <xsl:output-character character="&#x2209;" string="&amp;NotElement;"/>
    <xsl:output-character character="&#x220b;" string="&amp;SuchThat;"/>
    <xsl:output-character character="&#x220c;" string="&amp;NotReverseElement;"/>
    <xsl:output-character character="&#x220f;" string="&amp;Product;"/>
    <xsl:output-character character="&#x2210;" string="&amp;Coproduct;"/>
    <xsl:output-character character="&#x2211;" string="&amp;Sum;"/>
    <xsl:output-character character="&#x2213;" string="&amp;mp;"/>
    <xsl:output-character character="&#x2216;" string="&amp;smallsetminus;"/>
    <xsl:output-character character="&#x2217;" string="&amp;lowast;"/>
    <xsl:output-character character="&#x2218;" string="&amp;SmallCircle;"/>
    <xsl:output-character character="&#x221d;" string="&amp;varpropto;"/>
    <xsl:output-character character="&#x221e;" string="&amp;infin;"/>
    <xsl:output-character character="&#x2223;" string="&amp;VerticalBar;"/>
    <xsl:output-character character="&#x2224;" string="&amp;nshortmid;"/>
    <xsl:output-character character="&#x2225;" string="&amp;shortparallel;"/>
    <xsl:output-character character="&#x2225;" string="&amp;shortparallel;"/>
    <xsl:output-character character="&#x2226;" string="&amp;nshortparallel;"/>
    <xsl:output-character character="&#x2227;" string="&amp;wedge;"/>
    <xsl:output-character character="&#x2228;" string="&amp;vee;"/>
    <xsl:output-character character="&#x2229;" string="&amp;cap;"/>
    <xsl:output-character character="&#x222a;" string="&amp;cup;"/>
    <xsl:output-character character="&#x221a;" string="&amp;Sqrt;"/>
    <xsl:output-character character="&#x2220;" string="&amp;angle;"/>
    <xsl:output-character character="&#x222b;" string="&amp;Integral;"/>
    <xsl:output-character character="&#x222e;" string="&amp;oint;"/>
    <xsl:output-character character="&#x22a4;" string="&amp;DownTee;"/>
    <xsl:output-character character="&#x22a5;" string="&amp;UpTee;"/>
    <xsl:output-character character="&#x223c;" string="&amp;Tilde;"/>
    <xsl:output-character character="&#x2240;" string="&amp;wr;"/>
    <xsl:output-character character="&#x2241;" string="&amp;NotTilde;"/>
    <xsl:output-character character="&#x2243;" string="&amp;TildeEqual;"/>
    <xsl:output-character character="&#x2244;" string="&amp;nsimeq;"/>
    <xsl:output-character character="&#x2245;" string="&amp;TildeFullEqual;"/>
    <xsl:output-character character="&#x2246;" string="&amp;simne;"/>
    <xsl:output-character character="&#x2248;" string="&amp;TildeTilde;"/>
    <xsl:output-character character="&#x2249;" string="&amp;NotTildeTilde;"/>
    <xsl:output-character character="&#x224d;" string="&amp;CupCap;"/>
    <xsl:output-character character="&#x2250;" string="&amp;DotEqual;"/>
    <xsl:output-character character="&#x2260;" string="&amp;NotEqual;"/>
    <xsl:output-character character="&#x2261;" string="&amp;Congruent;"/>
    <xsl:output-character character="&#x2262;" string="&amp;NotCongruent;"/>
    <xsl:output-character character="&#x2264;" string="&amp;leq;"/>
    <xsl:output-character character="&#x2265;" string="&amp;GreaterEqual;"/>
    <xsl:output-character character="&#x226a;" string="&amp;NotLessLess;"/>
    <xsl:output-character character="&#x226b;" string="&amp;NotGreaterGreater;"/>
    <xsl:output-character character="&#x226e;" string="&amp;NotLess;"/>
    <xsl:output-character character="&#x226f;" string="&amp;NotGreater;"/>
    <xsl:output-character character="&#x2270;" string="&amp;NotLessEqual;"/>
    <xsl:output-character character="&#x2271;" string="&amp;NotGreaterEqual;"/>
    <xsl:output-character character="&#x227a;" string="&amp;Precedes;"/>
    <xsl:output-character character="&#x227b;" string="&amp;Succeeds;"/>
    <xsl:output-character character="&#x227c;" string="&amp;PrecedesSlantEqual;"/>
    <xsl:output-character character="&#x227d;" string="&amp;SucceedsSlantEqual;"/>
    <xsl:output-character character="&#x2280;" string="&amp;nprec;"/>
    <xsl:output-character character="&#x2281;" string="&amp;nsucc;"/>
    <xsl:output-character character="&#x2282;" string="&amp;subset;"/>
    <xsl:output-character character="&#x2283;" string="&amp;supset;"/>
    <xsl:output-character character="&#x2284;" string="&amp;nsub;"/>
    <xsl:output-character character="&#x2285;" string="&amp;nsup;"/>
    <xsl:output-character character="&#x2286;" string="&amp;SubsetEqual;"/>
    <xsl:output-character character="&#x2287;" string="&amp;supseteq;"/>
    <xsl:output-character character="&#x2288;" string="&amp;nsubseteq;"/>
    <xsl:output-character character="&#x2289;" string="&amp;nsupseteq;"/>
    <xsl:output-character character="&#x228e;" string="&amp;UnionPlus;"/>
    <xsl:output-character character="&#x228f;" string="&amp;SquareSubset;"/>
    <xsl:output-character character="&#x2290;" string="&amp;SquareSuperset;"/>
    <xsl:output-character character="&#x2291;" string="&amp;SquareSubsetEqual;"/>
    <xsl:output-character character="&#x2292;" string="&amp;SquareSupersetEqual;"/>
    <xsl:output-character character="&#x2293;" string="&amp;SquareIntersection;"/>
    <xsl:output-character character="&#x2294;" string="&amp;SquareUnion;"/>
    <xsl:output-character character="&#x2295;" string="&amp;CirclePlus;"/>
    <xsl:output-character character="&#x2296;" string="&amp;CircleMinus;"/>
    <xsl:output-character character="&#x2297;" string="&amp;CircleTimes;"/>
    <xsl:output-character character="&#x2298;" string="&amp;osol;"/>
    <xsl:output-character character="&#x2299;" string="&amp;CircleDot;"/>
    <xsl:output-character character="&#x22a2;" string="&amp;RightTee;"/>
    <xsl:output-character character="&#x22a3;" string="&amp;LeftTee;"/>
    <xsl:output-character character="&#x22a5;" string="&amp;UpTee;"/>
    <xsl:output-character character="&#x22a8;" string="&amp;DoubleRightTee;"/>
    <xsl:output-character character="&#x22ac;" string="&amp;nvdash;"/>
    <xsl:output-character character="&#x22ad;" string="&amp;nvDash;"/>
    <xsl:output-character character="&#x22b2;" string="&amp;vartriangleleft;"/>
    <xsl:output-character character="&#x22b3;" string="&amp;vartriangleright;"/>
    <xsl:output-character character="&#x22c0;" string="&amp;Wedge;"/>
    <xsl:output-character character="&#x22c1;" string="&amp;Vee;"/>
    <xsl:output-character character="&#x22c4;" string="&amp;diamond;"/>
    <xsl:output-character character="&#x22c5;" string="&amp;sdot;"/>
    <xsl:output-character character="&#x22c6;" string="&amp;Star;"/>
    <xsl:output-character character="&#x22c8;" string="&amp;bowtie;"/>
    <xsl:output-character character="&#x22e2;" string="&amp;NotSquareSubsetEqual;"/>
    <xsl:output-character character="&#x22e3;" string="&amp;NotSquareSupersetEqual;"/>
    <xsl:output-character character="&#x22c2;" string="&amp;Intersection;"/>
    <xsl:output-character character="&#x22c3;" string="&amp;Union;"/>
    <xsl:output-character character="&#x22ee;" string="&amp;vellip;"/>
    <xsl:output-character character="&#x22ef;" string="&amp;ctdot;"/>
    <xsl:output-character character="&#x22f1;" string="&amp;dtdot;"/>
    <xsl:output-character character="&#x2322;" string="&amp;sfrown;"/>
    <xsl:output-character character="&#x2323;" string="&amp;ssmile;"/>
    <xsl:output-character character="&#x2329;" string="&amp;LeftAngleBracket;"/>
    <xsl:output-character character="&#x232a;" string="&amp;RightAngleBracket;"/>
    <xsl:output-character character="&#x25b3;" string="&amp;bigtriangleup;"/>
    <xsl:output-character character="&#x25b5;" string="&amp;triangle;"/>
    <xsl:output-character character="&#x25bd;" string="&amp;bigtriangledown;"/>
    <xsl:output-character character="&#x25cb;" string="&amp;cir;"/>
    <xsl:output-character character="&#x2660;" string="&amp;spadesuit;"/>
    <xsl:output-character character="&#x2663;" string="&amp;clubsuit;"/>
    <xsl:output-character character="&#x266d;" string="&amp;flat;"/>
    <xsl:output-character character="&#x266e;" string="&amp;natural;"/>
    <xsl:output-character character="&#x266f;" string="&amp;sharp;"/>
    <xsl:output-character character="&#x2a00;" string="&amp;bigodot;"/>
    <xsl:output-character character="&#x2a01;" string="&amp;bigoplus;"/>
    <xsl:output-character character="&#x2a02;" string="&amp;bigotimes;"/>
    <xsl:output-character character="&#x2a04;" string="&amp;biguplus;"/>
    <xsl:output-character character="&#x2a06;" string="&amp;bigsqcup;"/>
    <xsl:output-character character="&#x2a3f;" string="&amp;amalg;"/>
  </xsl:character-map>

</xsl:stylesheet>
