- From: Reece Dunn <msclrhd@hotmail.com>
- Date: Fri, 14 Mar 2003 13:28:08 +0000
- To: shade33@mail.ru
- Cc: www-math@w3.org
- Message-ID: <F16uAy0BYTxHwMQFLcV00000f62@hotmail.com>
>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 = "⎛" font =
"Symbol">æ</unicode:entry> <!-- left paren upper hook -->
<unicode:entry ver = "3.2" value = "⎜" font =
"Symbol">ç</unicode:entry> <!-- left paren extension -->
<unicode:entry ver = "3.2" value = "⎝" font =
"Symbol">è</unicode:entry> <!-- left paren lower hook -->
<unicode:entry ver = "3.2" value = "⎞" font =
"Symbol">ö</unicode:entry> <!-- right paren upper hook -->
<unicode:entry ver = "3.2" value = "⎟" font =
"Symbol">÷</unicode:entry> <!-- right paren extension -->
<unicode:entry ver = "3.2" value = "⎠" 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
_________________________________________________________________
Attachments
- application/x-zip-compressed attachment: unicode.zip
Received on Friday, 14 March 2003 08:28:15 UTC