<?xml version="1.0"?>
<!--
$Id: characters.xsl,v 1.3 2003/12/08 15:02:15 davidc Exp $

mml6.xsl David Carlisle
Generate bycodes.html, byalpha.html and the alphabetic glyph tables
for MathML chapter 6.
XSL sheet takes same parameters as mathmlspec.xsl
takes unicode.xml as input file.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:saxon="http://icl.com/saxon"  
                extension-element-prefixes="saxon"
                version="1.0">

<xsl:param name="glyphs">../glyphs</xsl:param>

<xsl:strip-space elements="group"/>

<xsl:output method="text"/>

<xsl:key name="set" match="entity" use="@set"/>

<xsl:template match="charlist">

<xsl:apply-templates select="entitygroups/group"/>

<xsl:call-template name="tables-overview"/>

<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'000'"/>
</xsl:call-template>

<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'001'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'002'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'003'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'004'"/>
</xsl:call-template>


<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'020'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'021'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'022'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'023'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'024'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'025'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'026'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'027'"/>
</xsl:call-template>

<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'029'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'02A'"/>
</xsl:call-template>

<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'030'"/>
</xsl:call-template>

<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'0FB'"/>
</xsl:call-template>


<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'0FE'"/>
</xsl:call-template>


<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'1D4'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'1D5'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'1D6'"/>
</xsl:call-template>
<xsl:call-template name="code-chart">
  <xsl:with-param name="range" select="'1D7'"/>
</xsl:call-template>


<xsl:call-template name="bycodes"/>
<xsl:call-template name="byalpha"/>


</xsl:template>



<xsl:template match="group[@name='predefined']"/>

<xsl:template match="group">
<saxon:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../{@name}doc/overview.html">
<html>
<head>
<title><xsl:value-of select="@name"/></title>
</head>
<body>
<h1><xsl:value-of select="@name"/></h1>
<p>
<a href="../overview.html">Contents</a>
</p>
<table>
<tr>
<td>&#160;</td>
<td>&#160;</td>
<td>&#160;</td>
<td>&#160;<a href="../{@name}/{@name}map.xsl">XSLT 2 draft character map</a>&#160;</td>
</tr>
<xsl:for-each select="set">
<xsl:variable name="f">
<xsl:apply-templates select="." mode="name"/>
</xsl:variable>
<xsl:if test="string($f)">
<tr>
<th><xsl:value-of select="$f"/></th>
<td>&#160;<a href="{$f}.html">HTML Description</a>&#160;</td>
<td>&#160;<a href="../{../@name}/{$f}.ent">Entity Declarations</a>&#160;</td>
<td>&#160;<a href="../{../@name}/{$f}map.xsl">XSLT 2 draft character map</a>&#160;</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</saxon:output>
<xsl:apply-templates select="set[not(../@name='mathml') or starts-with(@name,'m')]"/>
</xsl:template>

<xsl:template match="set" mode="name">
<xsl:choose>
<xsl:when test="../@name='mathml' and not(starts-with(@name,'m'))"/>
<xsl:when test="starts-with(@name,'957')"><xsl:value-of select="substring(@name,11)"/></xsl:when>
<xsl:when test="starts-with(@name,'88')"><xsl:value-of select="substring-after(@name,'-')"/></xsl:when>
<xsl:when test="starts-with(@name,'html')"><xsl:value-of select="substring-after(@name,'-')"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="set">
<xsl:variable name="d" select="concat(../@name,'doc')"/>
<xsl:variable name="set" select="@name"/>
<xsl:variable name="f">
<xsl:apply-templates select="." mode="name"/>
</xsl:variable>
<xsl:variable name="t"
  select="translate($f,'abcdefghijklmnopqrstuvwxyz',
                           'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>

<saxon:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../{$d}/{$f}.html">
<html>
<head>
<title><xsl:value-of select="$t"/></title>
<style>
.ignore {background-color: #AAAAAA;}
</style>
</head>
<body>
<h1><xsl:value-of select="$t"/></h1>
<p>
<a href="overview.html">Contents</a>
<xsl:variable name="p">
 <xsl:apply-templates select="preceding-sibling::set[1]" mode="name"/>
</xsl:variable>
<xsl:variable name="n">
 <xsl:apply-templates select="following-sibling::set[1]" mode="name"/>
</xsl:variable>

<xsl:if test="string($p)">
<br/>Previous: <a href="{$p}.html">
<xsl:value-of select="$p"/></a>
</xsl:if>
<xsl:if test="string($n)">
<br/>Next: <a href="{$n}.html">
<xsl:value-of select="$n"/></a>
</xsl:if>
</p>
<p><a href="../{../@name}/{$f}.ent">Entity Declarations</a></p>
<table border="1">
<tr>
<th>Name</th>
<th>Unicode</th>
<th>Glyph</th>
<th>Unicode Name</th>
<th>Description</th>
<th>Aliases</th>
</tr>
<xsl:for-each select="key('set',$set)">
<xsl:sort select="@id"/>
<tr>
    <xsl:if test="../description/@unicode='provisional'">
      <xsl:attribute name="class">provisional</xsl:attribute>
      <xsl:message><xsl:value-of select="concat('Provisional: ',$set,': ',@id)"/></xsl:message>
    </xsl:if>
    <xsl:if test="@optional and @default='IGNORE'">
      <xsl:attribute name="class">ignore</xsl:attribute>
    </xsl:if>
<td>
<xsl:value-of select="@id"/>
</td>
<td>
<xsl:value-of select="substring(../@id,2)"/>
</td>
<td>
<img height="32" 
         width="32"
         src="{$glyphs}/{substring(../@id,2,3)}/{translate(../@id,'x','')}.png"
         alt="{../@id}"
         >
<xsl:if test="../@image='none'"><xsl:attribute
  name="src"><xsl:value-of select="$glyphs"/>/none.png</xsl:attribute></xsl:if>
</img>
</td>
<td>
<xsl:value-of select="../description"/>
</td>
<td>
<xsl:value-of select="desc"/>
<xsl:if test="not(desc)">&#160;</xsl:if>
</td>
<td>
<xsl:if test="not(../entity[@set='mmlalias'] or ../entity[@set=$set][2])">&#160;</xsl:if>
<xsl:for-each select="../entity[@set='mmlalias' or (@set=$set
     and @id!=current()/@id)]/@id">
<xsl:value-of select="."/>
<xsl:if test="position() &lt; last()">, </xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</saxon:output>
</xsl:template>

<!-- -->



<!-- -->

<xsl:template name="code-chart">
 <xsl:param name="range"/>
<saxon:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../tables/{$range}.html">
<html>
<head>
<title>Unicode Characters:
<xsl:value-of select="concat($range,'00 to ',$range,'FF')"/>
</title>
<style type="text/css">
.unassigned { background-color: red }
.undescribed { background-color: yellow }
.unnamed-mathml { background-color: fuschia }
</style>
</head>
<body>
<h1>Unicode Characters:
<xsl:value-of select="concat($range,'00 to ',$range,'FF')"/>
</h1>
<xsl:variable name="x" select=
  "document('')/xsl:stylesheet/xsl:template[@match='charlist']/
   xsl:call-template/xsl:with-param[contains(@select,$range)]"/>
<xsl:variable name="n" select=
  "translate($x/following::*[@name='range'][1]/@select,&quot;&apos;&quot;,'')"/>
<xsl:variable name="p" select=
  "translate($x/preceding::*[@name='range'][1]/@select,&quot;&apos;&quot;,'')"/>

<p>
<a href="overview.html">Contents</a><br/>
<xsl:if test="$n">
<a href="{$n}.html">Next: <xsl:value-of 
select="$n"/></a><br/>
</xsl:if>
<xsl:if test="$p">
<a href="{$p}.html">Previous: <xsl:value-of 
select="$p"/></a><br/>
</xsl:if>


</p>


<table border="1">
<tr>
<th>&#160;</th>
<th><xsl:value-of select="$range"/>0</th>
<th><xsl:value-of select="$range"/>1</th>
<th><xsl:value-of select="$range"/>2</th>
<th><xsl:value-of select="$range"/>3</th>
<th><xsl:value-of select="$range"/>4</th>
<th><xsl:value-of select="$range"/>5</th>
<th><xsl:value-of select="$range"/>6</th>
<th><xsl:value-of select="$range"/>7</th>
<th><xsl:value-of select="$range"/>8</th>
<th><xsl:value-of select="$range"/>9</th>
<th><xsl:value-of select="$range"/>A</th>
<th><xsl:value-of select="$range"/>B</th>
<th><xsl:value-of select="$range"/>C</th>
<th><xsl:value-of select="$range"/>D</th>
<th><xsl:value-of select="$range"/>E</th>
<th><xsl:value-of select="$range"/>F</th>
</tr>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'0'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'1'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'2'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'3'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'4'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'5'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'6'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'7'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'8'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'9'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'A'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'B'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'C'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'D'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'E'"/>
</xsl:call-template>
<xsl:call-template name="table-row">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="row" select="'F'"/>
</xsl:call-template>
<tr>
<th>&#160;</th>
<th><xsl:value-of select="$range"/>0</th>
<th><xsl:value-of select="$range"/>1</th>
<th><xsl:value-of select="$range"/>2</th>
<th><xsl:value-of select="$range"/>3</th>
<th><xsl:value-of select="$range"/>4</th>
<th><xsl:value-of select="$range"/>5</th>
<th><xsl:value-of select="$range"/>6</th>
<th><xsl:value-of select="$range"/>7</th>
<th><xsl:value-of select="$range"/>8</th>
<th><xsl:value-of select="$range"/>9</th>
<th><xsl:value-of select="$range"/>A</th>
<th><xsl:value-of select="$range"/>B</th>
<th><xsl:value-of select="$range"/>C</th>
<th><xsl:value-of select="$range"/>D</th>
<th><xsl:value-of select="$range"/>E</th>
<th><xsl:value-of select="$range"/>F</th>
</tr>
</table>

<p>
Key:
</p>

<table border="1">
<tr><th>Cell Style</th><th>Status</th></tr>
<tr><td>&#160;&#160;&#160;</td><td>Unicode Character (Unicode 4.0) with MathML name</td></tr>
<tr><td class="unassigned">&#160;</td><td>Unicode or XML Non-Character</td></tr>
<tr><td class="unnamed-mathml">&#160;</td><td>Character described in
these tables, but currently not given a MathML name</td></tr>
<tr><td><img src="{$glyphs}/none.png" alt="none"/></td><td>Character for which an image is not currently available</td></tr>
</table>
</body>
</html>
</saxon:output>
</xsl:template>

<xsl:template name="table-row">
<xsl:param name="range"/>
<xsl:param name="row"/>
<tr>
<th><xsl:value-of select="$row"/></th>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('0',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('1',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('2',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('3',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('4',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('5',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('6',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('7',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('8',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('9',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('A',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('B',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('C',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('D',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('E',$row)"/>
</xsl:call-template>
<xsl:call-template name="table-cell">
 <xsl:with-param name="range" select="$range"/>
 <xsl:with-param name="h" select="concat('F',$row)"/>
</xsl:call-template>
<th><xsl:value-of select="$row"/></th>
</tr>
</xsl:template>


<xsl:template name="table-cell">
<xsl:param name="range"/>
<xsl:param name="h"/>
<td width="40" align="center">
<xsl:variable name="x" select="id(concat('U',$range,$h))"/>
<xsl:choose>
<xsl:when test="$x and not($x/bmp) and not($x/description/@unicode='unassigned')">
  <xsl:attribute name="title">
    <xsl:value-of select="$x/description"/>
  </xsl:attribute>
  <xsl:choose>
  <xsl:when test="$x/entity[
      @set='9573-13-isoamsa'
   or @set='9573-13-isoamsb'
   or @set='9573-13-isoamsc'
   or @set='9573-13-isoamsn'
   or @set='9573-13-isoamso'
   or @set='9573-13-isoamsr'
   or @set='9573-13-isogrk3'
   or @set='9573-13-isomfrk'
   or @set='9573-13-isomopf'
   or @set='9573-13-isomscr'
   or @set='9573-13-isotech'
   or @set='8879-isobox'
   or @set='8879-isocyr1'
   or @set='8879-isocyr2'
   or @set='8879-isodia'
   or @set='8879-isolat1'
   or @set='8879-isolat2'
   or @set='8879-isonum'
   or @set='8879-isopub'
   or @set='Xmmlalias'
   or @set='mmlextra']">
    <xsl:if test="$x/description/@unicode='provisional'">
      <xsl:attribute name="class">provisional</xsl:attribute>
    </xsl:if>
  </xsl:when>
  <xsl:otherwise><!-- not named -->
    <xsl:choose>
      <xsl:when test="$x/description/@unicode='provisional'">
        <xsl:attribute name="class">unnamed-provisional</xsl:attribute>
      </xsl:when>
      <xsl:when test="$x/description/@unicode='unasigned'">
        <xsl:attribute name="class">unassigned</xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="class">unnamed-mathml</xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:otherwise>
  </xsl:choose>
  <xsl:choose>
  <xsl:when test="($x/surrogate and not($x/bmp)) or $x/entity[
      @set='9573-13-isoamsa'
   or @set='9573-13-isoamsb'
   or @set='9573-13-isoamsc'
   or @set='9573-13-isoamsn'
   or @set='9573-13-isoamso'
   or @set='9573-13-isoamsr'
   or @set='9573-13-isogrk3'
   or @set='9573-13-isomfrk'
   or @set='9573-13-isomopf'
   or @set='9573-13-isomscr'
   or @set='9573-13-isotech'
   or @set='8879-isobox'
   or @set='8879-isocyr1'
   or @set='8879-isocyr2'
   or @set='8879-isodia'
   or @set='8879-isolat1'
   or @set='8879-isolat2'
   or @set='8879-isonum'
   or @set='8879-isopub'
   or @set='Xmmlalias'
   or @set='mmlextra']">
  <a href="bycodes.html#{$x/@id}">
  <img height="32" width="32" src="{$glyphs}/{$range}/U{$range}{$h}.png"
    alt="{$x/description}">
<xsl:if test="$x/@image='none'"><xsl:attribute
  name="src"><xsl:value-of select="$glyphs"/>/none.png</xsl:attribute></xsl:if>
</img>
  </a>
  </xsl:when>
  <xsl:otherwise>
  <img height="32" width="32" src="{$glyphs}/{$range}/U{$range}{$h}.png"
    alt="{$x/description}">
<xsl:if test="$x/@image='none'"><xsl:attribute
  name="src"><xsl:value-of select="$glyphs"/>/none.png</xsl:attribute></xsl:if>
</img>
  </xsl:otherwise>
  </xsl:choose>
</xsl:when>
<xsl:when test="$x/bmp or $x/description/@unicode='unassigned'">
  <xsl:attribute name="class">unassigned</xsl:attribute>
   <xsl:text>&#160;</xsl:text>
</xsl:when>
<xsl:when test="$range='000' and (starts-with($h,'0') or starts-with($h,'1'))">
  <xsl:attribute name="class">unassigned</xsl:attribute>
   <xsl:text>&#160;</xsl:text>
</xsl:when>
<xsl:otherwise>
  <xsl:attribute name="class">undescribed</xsl:attribute>
   <xsl:text>&#160;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:template>


<!-- -->
<xsl:template name="bycodes">
<saxon:output method="html" 
     indent="no"
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../tables/bycodes.html">
<html>
<head>
<title>
  Characters Ordered by Unicode
</title>
<xsl:text>&#10;</xsl:text>
  <style type="text/css">.error { color: red }</style>
<xsl:text>&#10;</xsl:text>
</head>
<xsl:text>&#10;</xsl:text>
<body>
<h1>Characters Ordered by Unicode</h1>
<xsl:text>&#10;</xsl:text>
<p>
<a href="overview.html">Contents</a><br/>
<a href="byalpha.html">Named MathML Characters, ordered by Name</a><br/>
</p>

<pre>
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="character[entity[
    @set='9573-13-isoamsa'
 or @set='9573-13-isoamsb'
 or @set='9573-13-isoamsc'
 or @set='9573-13-isoamsn'
 or @set='9573-13-isoamso'
 or @set='9573-13-isoamsr'
 or @set='9573-13-isogrk3'
 or @set='9573-13-isomfrk'
 or @set='9573-13-isomopf'
 or @set='9573-13-isomscr'
 or @set='9573-13-isotech'
 or @set='8879-isobox'
 or @set='8879-isocyr1'
 or @set='8879-isocyr2'
 or @set='8879-isodia'
 or @set='8879-isolat1'
 or @set='8879-isolat2'
 or @set='8879-isonum'
 or @set='8879-isopub'
 or @set='mmlextra']
or surrogate]">
<xsl:sort select="@id"/>
<a name="{@id}"/>
<xsl:choose>
<xsl:when test="@image='none'"><xsl:value-of select="@id"/></xsl:when>
<xsl:otherwise>
<a href="{$glyphs}/{substring(@id,2,3)}/{translate(@id,'x','')}.png">
<xsl:value-of select="@id"/>
</a>
</xsl:otherwise>
</xsl:choose>
<xsl:text>, </xsl:text>
<xsl:value-of select="description"/>
<xsl:value-of select="substring(
'                                      ',
string-length(description))"/>
<xsl:text>, </xsl:text>
<xsl:for-each select="entity[
    @set='9573-13-isoamsa'
 or @set='9573-13-isoamsb'
 or @set='9573-13-isoamsc'
 or @set='9573-13-isoamsn'
 or @set='9573-13-isoamso'
 or @set='9573-13-isoamsr'
 or @set='9573-13-isogrk3'
 or @set='9573-13-isomfrk'
 or @set='9573-13-isomopf'
 or @set='9573-13-isomscr'
 or @set='9573-13-isotech'
 or @set='8879-isobox'
 or @set='8879-isocyr1'
 or @set='8879-isocyr2'
 or @set='8879-isodia'
 or @set='8879-isolat1'
 or @set='8879-isolat2'
 or @set='8879-isonum'
 or @set='8879-isopub'
 or @set='mmlextra'
 or @set='mmlalias']/@id">
<xsl:value-of select="."/>
<xsl:if test="position() &lt; last()">, </xsl:if>
</xsl:for-each>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
</pre>
</body>
</html>
</saxon:output>
</xsl:template>

<xsl:template name="byalpha">
<saxon:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../tables/byalpha.html">
<html>
<head>
<title>
  Characters Ordered by Entity Name
</title>
  <style type="text/css">.error { color: red }</style>
</head>
<body>
<h1>
  Characters Ordered by Entity Name
</h1>
<p>
<a href="overview.html">Contents</a><br/>
<a href="bycodes.html">Characters orderd by codes</a><br/>
</p>

<pre>
<xsl:for-each select="character/entity[
    @set='9573-2003-isoamsa'
 or @set='9573-2003-isoamsb'
 or @set='9573-2003-isoamsc'
 or @set='9573-2003-isoamsn'
 or @set='9573-2003-isoamso'
 or @set='9573-2003-isoamsr'
 or @set='9573-2003-isogrk3'
 or @set='9573-2003-isomfrk'
 or @set='9573-2003-isomopf'
 or @set='9573-2003-isomscr'
 or @set='9573-2003-isotech'
 or @set='9573-2003-isobox'
 or @set='9573-2003-isocyr1'
 or @set='9573-2003-isocyr2'
 or @set='9573-2003-isodia'
 or @set='9573-2003-isolat1'
 or @set='9573-2003-isolat2'
 or @set='9573-2003-isonum'
 or @set='9573-2003-isopub'
 or @set='mmlextra'
 or @set='mmlalias']">
<xsl:sort select="@id"/>
<xsl:value-of select="@id"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="substring(
'                        ',
string-length(@id))"/>
<xsl:value-of select="../@id"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="normalize-space(.)"/>
<xsl:text>, [</xsl:text>
<xsl:value-of select="normalize-space(../description)"/>
<xsl:text>]
</xsl:text>
</xsl:for-each>
</pre>
</body>
</html>
</saxon:output>
</xsl:template>

<xsl:template name="tables-overview">
<saxon:output method="html" 
     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
     doctype-system="http://www.w3.org/TR/html4/loose.dtd"
     href="../tables/overview.html">
<html>
<head>
<title>Character Tables</title>
</head>
<body>
<h1>Character Tables</h1>
<p>
<a href="../overview.html">Contents</a>
</p>
<h2>Character listings</h2>
<p>The first table lists a large collection of characters (including
at least all the characters with MathML entity definitions) ordered by
unicode number. The second table lists all the MathML entity names, in
alphabetic order.</p>

<p>
<a href="bycodes.html">bycodes</a><br/>
<a href="byalpha.html">byalpha</a><br/>
</p>


<h2>Unicode Character blocks</h2>
<p>The tables in this section each display a block of 256 Uniocde
character positions. For reference the Unicode names for blocks
of characters are also given together with links to pdf files
available from the unicode site showing these characters.</p>

<table id="chars_table-unicode-block" cellpadding="3">
<thead>
<tr>
<th>Block Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="000.html">00000-000FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U0000.pdf">Controls and Basic Latin</a>, and <a href="http://www.unicode.org/charts/PDF/U0080.pdf">Latin-1 Supplement</a></td>
</tr>
<tr>
<td><a href="001.html">00100-001FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U0100.pdf">Latin Extended-A</a>, <a href="http://www.unicode.org/charts/PDF/U0180.pdf">Latin Extended-B</a></td>
</tr>
<tr>
<td><a href="002.html">00200-002FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U0250.pdf">IPA Extensions</a>, <a href="http://www.unicode.org/charts/PDF/U02B0.pdf">Spacing Modifier Letters</a></td>
</tr>
<tr>
<td><a href="003.html">00300-003FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U0300.pdf">Combining Diacritical Marks</a>, <a href="http://www.unicode.org/charts/PDF/U0370.pdf">Greek [and Coptic]</a>
</td>
</tr>
<tr>
<td><a href="004.html">00400-004FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U0400.pdf">Cyrillic</a></td>
</tr>

<tr>
<td><a href="020.html">02000-020FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2000.pdf">General Punctuation</a>, <a href="http://www.unicode.org/charts/PDF/U2070.pdf">Superscripts and Subscripts</a>, <a href="http://www.unicode.org/charts/PDF/U20A0.pdf">Currency Symbols</a>,
<a href="http://www.unicode.org/charts/PDF/U20D0.pdf">Combining Diacritical Marks for Symbols</a></td>
</tr>
<tr>
<td><a href="021.html">02100-021FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2100.pdf">Letter-like Symbols</a>, <a href="http://www.unicode.org/charts/PDF/U2150.pdf">Number Forms</a>, <a href="http://www.unicode.org/charts/PDF/U2190.pdf">Arrows</a></td>
</tr>
<tr>
<td><a href="022.html">02200-022FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2200.pdf">Mathematical Operators</a></td>
</tr>
<tr>
<td><a href="023.html">02300-023FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2300.pdf">Miscellaneous Technical</a></td>
</tr>
<tr>
<td><a href="024.html">02400-024FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2400.pdf">Control Pictures</a>, <a href="http://www.unicode.org/charts/PDF/U2440.pdf">Optical Character Recognition</a>, <a href="http://www.unicode.org/charts/PDF/U2460.pdf">Enclosed Alphanumerics</a></td>
</tr>
<tr>
<td><a href="025.html">02500-025FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2500.pdf">Box Drawing</a>, <a href="http://www.unicode.org/charts/PDF/U2580.pdf">Block Elements</a>, <a href="http://www.unicode.org/charts/PDF/U25A0.pdf">Geometric Shapes</a></td>
</tr>
<tr>
<td><a href="026.html">02600-026FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2600.pdf">Miscellaneous Symbols</a></td>
</tr>
<tr>
<td><a href="027.html">02700-027FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2700.pdf">Dingbats</a>,
<a href="http://www.unicode.org/charts/PDF/U27C0.pdf">Miscellaneous Mathematical Symbols-A</a>,
<a href="http://www.unicode.org/charts/PDF/U27F0.pdf">Supplemental Arrows-A</a></td>
</tr>
<tr>
<td><a href="029.html">02900-029FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2900.pdf">Supplemental Arrows-B</a>,  <a href="http://www.unicode.org/charts/PDF/U2980.pdf">Miscellaneous Mathematical Symbols-B</a></td>
</tr>
<tr>
<td><a href="02A.html">02A00-02AFF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U2A00.pdf">Supplemental Mathematical Operators</a></td>
</tr>
<tr>
<td><a href="030.html">03000-030FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U3000.pdf">CJK Symbols and
Punctuation</a>,
<a href="http://www.unicode.org/charts/PDF/U3040.pdf">Hiragana</a>, <a href="http://www.unicode.org/charts/PDF/U30A0.pdf">Katakana</a></td>
</tr>
<tr>
<td><a href="0FB.html">0FB00-0FBFF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/UFB00.pdf">Alphabetic Presentation Forms</a></td>
</tr>
<tr>
<td><a href="0FE.html">0FE00-0FEFF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/UFE00.pdf">Variation
Selectors</a>,
<a href="http://www.unicode.org/charts/PDF/UFE20.pdf">Combining Half Marks</a>,
<a href="http://www.unicode.org/charts/PDF/UFE30.pdf">CJK Compatibility Forms</a>, <a href="http://www.unicode.org/charts/PDF/UFE50.pdf">Small Form Variants</a>,
<a href="http://www.unicode.org/charts/PDF/UFE70.pdf">Arabic Presentation Forms-B</a></td>
</tr>
<tr>
<td><a href="1D4.html">1D400-1D4FF</a></td>
<td><a href="http://www.unicode.org/charts/PDF/U1D400.pdf">Mathematical Styled Latin (Bold, Italic, Bold Italic, Script,
Bold Script begins)</a>
</td>
</tr>
<tr>
<td><a href="1D5.html">1D500-1D5FF</a></td>
<td>Mathematical Styled Latin (Bold Script ends, Fraktur, Double-struck,
Bold Fraktur, Sans-serif, Sans-serif Bold begins)
</td>
</tr>
<tr>
<td><a href="1D6.html">1D600-1D6FF</a></td>
<td>Mathematical Styled Latin (Sans-serif Bold ends, Sans-serif Italic,
Sans-serif Bold Italic, Monospace, Bold), Mathematical Styled Greek (Bold, Italic begins)</td>
</tr>
<tr>
<td><a href="1D7.html">1D700-1D7FF</a></td>
<td>Mathematical Styled Greek (Italic continued, Bold Italic,
Sans-serif Bold), Mathematical Styled Digits </td>
</tr>
</tbody>
</table>
</body>
</html>
</saxon:output>
</xsl:template>

</xsl:stylesheet>
