Re: Adding unicode mappings to any document (including MathML)

>What do you think about entities.xsl from my XSLT MathML library.

Where can I find entities.xsl?


>What about used algorithm?

The main algorithm is this:

   <xsl:template match = "text()" name = "text"> <xsl:param name = "x" 
select = "."/>
      <xsl:variable name = "y" select = "normalize-space($x)"/>
      <xsl:variable name = "u" select = 
"msxsl:node-set($unicode)[@value=$y]"/>
      <xsl:choose>
         <xsl:when test = "$u and msxsl:node-set($u)/@font">
            <span style = "font-family: '{msxsl:node-set($u)/@font}';">
               <xsl:copy-of select = "msxsl:node-set($u)/node()"/>
            </span>
         </xsl:when><xsl:when test = "msxsl:node-set($u)">
            <xsl:copy-of select = "msxsl:node-set($u)/node()"/>
         </xsl:when><xsl:when test = "ancestor::*[1][ self::po ]">
            <xsl:copy-of select = "$y"/>
         </xsl:when><xsl:otherwise>
            <xsl:value-of select = "$x"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

At the moment it makes use of the microsoft msxsl:node-set(...) function. 
This is another thing I am looking into generalizing (adding XSLT2.0 
support?)

the main table is created like this:

   <xsl:variable name = "unicode" select = "
      document('U+00000.xsl')/*/unicode:entry
    | document('U+00300.xsl')/*/unicode:entry | 
document('U+00370.xsl')/*/unicode:entry
    | document('U+02000.xsl')/*/unicode:entry
    | document('U+02100.xsl')/*/unicode:entry | 
document('U+02150.xsl')/*/unicode:entry | 
document('U+02190.xsl')/*/unicode:entry
    | document('U+02200.xsl')/*/unicode:entry
    | document('U+02300.xsl')/*/unicode:entry
    | document('U+03000.xsl')/*/unicode:entry
   "/>

with some of the entries from U+02300.xsl looking like this:

   <unicode:entry ver = "3.2" value = "&#9115;" font = 
"Symbol">æ</unicode:entry> <!-- left  paren upper hook -->
   <unicode:entry ver = "3.2" value = "&#9116;" font = 
"Symbol">ç</unicode:entry> <!-- left  paren extension -->
   <unicode:entry ver = "3.2" value = "&#9117;" font = 
"Symbol">è</unicode:entry> <!-- left  paren lower hook -->
   <unicode:entry ver = "3.2" value = "&#9118;" font = 
"Symbol">ö</unicode:entry> <!-- right paren upper hook -->
   <unicode:entry ver = "3.2" value = "&#9119;" font = 
"Symbol">÷</unicode:entry> <!-- right paren extension -->
   <unicode:entry ver = "3.2" value = "&#9120;" font = 
"Symbol">ø</unicode:entry> <!-- right paren lower hook -->

I don't know how this differs from yours.

Also, if anyone wants the complete thing, ask me via e-mail and I will send 
it you.

-rhd-
mailto:msclrhd@hotmail.com

_________________________________________________________________

Received on Friday, 14 March 2003 08:28:15 UTC