Documentation / MathType

  • Demos
  • Visit our website
  • Downloads
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • MathType
                        • MathType Integrations
                        • MathType web interface features
                        • MathType web interface features

                        Encoding attributes

                        Reading time: 1min

                        MathType integration works with MathML, but under some circumstances, it modifies the XML encoding slightly.

                        MathType imports and exports MathML which, sometimes, cannot be placed directly inside HTML files. For example, the Moodle platform filters some HTML tags (APPLET, OBJECT, EMBED, etc.) and all unrecognized XML tags, and so it removes any MathML formula. This also occurs when the MathML appears inside an HTML attribute (for example, the SRC attribute of an IMG tag) and the browser, wrongly, tries to parse it.

                        In these situations, the 5 reserved characters of XML are replaced by other characters as shown in the following table:

                        Original XML character Replacing character
                        < (#3C) « (#AB)
                        > (#3E) » (#BB)
                        & (#26) § (#A7)
                        " (#22) ¨ (#A8)
                        ' (#27) ` (#60)

                        Then, recovering the MathML from the modified version is as simple as undoing the replacement. We provide below-attached the content os a .XSLT file that does this replacement.

                        <?xml version="1.0" encoding="UTF-8"?>
                        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
                         <!-- template for text -->
                         <xsl:template match="child::text()">
                         <!-- « (#AB), » (#BB), § (#A7), ¨ (#A8), ` (#B4) -->
                         <xsl:variable name="text" select="translate(.,'&#xAB;&#xBB;&#xA7;&#xA8;','&lt;&gt;&amp;&quot;')"/>
                         <!-- ` (#B4) -->
                         <xsl:value-of disable-output-escaping="yes" select='translate($text,"&#xB4;","&apos;")'/>
                         </xsl:template>
                         <!-- template for other nodes (including attributes) -->
                         <xsl:template match="@*|*">
                         <xsl:copy>
                         <xsl:apply-templates select="@*|node()"/>
                         </xsl:copy>
                         </xsl:template>
                        </xsl:stylesheet>
                        

                        Was this article helpful?

                        Yes
                        No
                        Give feedback about this article

                        Related Articles

                        • MathType API documentation
                        • Tips to use with MathType for Windows
                        • MathType Add-in for Microsoft 365

                        Making people’s STEM work more meaningful

                        MathType

                        • MathType for Office Tools
                        • MathType for Mac
                        • MathType for Microsoft 365
                        • MathType for Google Workspace
                        • MathType for LMS
                        • MathType for XML Editors
                        • Arabic notation
                        • Our products accessibility
                        • MathType is online

                        WirisQuizzes

                        Learning Lemur

                        Solutions for Education

                        • Blackboard Learn
                        • Brightspace by D2L
                        • Canvas
                        • Google Classroom
                        • Moodle
                        • Schoology

                        Solutions for Publishing Houses

                        Solutions for Technical Writers

                        Solutions for Chemistry

                        Integrations

                        • HTML Editors
                        • MathType in WordPress

                        Pricing

                        Company

                        Careers

                        Blog

                        Contact Us

                        Buy Now

                        Plugin Downloads

                        © Wiris 2025

                        • Cookie Settings
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Powered by Helpjuice
                        Expand