OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] include MathML files with the help of XSL


What do you guys think of using MathType to generate MathML?
 
http://www.dessci.com/en/reference/white_papers/tug_paper.pdf
 
http://www.dessci.com/en/reference/white_papers/mt_mathml.htm
 
Please note that I don't receive any money or free software from them. I just have been using them since grad school and they have been keeping up w/ the latest and greatest.
 
Any other suggestions for GUI editors to generate equations would be appreciated.
-----Original Message-----
From: Zoltán János Jánosi [mailto:jazoja4@gmail.com]
Sent: Thursday, June 28, 2012 8:16 AM
To: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] include MathML files with the help of XSL

Here is the result of "dynamically include MathML files with the help of XSLT when generating HTML files":

Test setup:

Content of the transformation XSL file:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=""/>
    <xsl:output method="html" encoding="utf-8" indent="yes" />
    <xsl:template match="inlineequation | equation | informalequation">
        <xsl:variable name="id" select="@id"/>
        <xsl:variable name="mathml" select="concat('math/',$id, '.math')"/>
        <xsl:apply-templates select="document($mathml,.)/*"/>
    </xsl:template>
</xsl:stylesheet>

I used Saxon 6.5.5 (http://sourceforge.net/projects/saxon/files/saxon6/6.5.5/saxon6-5-5.zip/download) as an XSLT 1.0 processor. (XSLT 2.0 processors gave errors with DocBook v1.77.1)

The following command was used:

java -jar saxon.jar -o output.html DSP_DocBook_v44_v0.45.xml HTML5_MathML.xsl

The resulting html file contains the MathML equations and in FireFox they look great.

This solution is not perfect (lacks differrences of equation types), but it works and is a good starting point for further development.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]