Communicating with the MathFlow editors
{{htmlmetatags> metatag-keywords=(mathflow, xml editor, sdk, mathml, equation, wiris, math, maths, documentation, advanced user-guide) metatag-description=(Learn how to use MathFlow SDK to customize the MathFlow editor in an XML environment.) }}
====== Communicating with the MathFlow editors ======
===== MathML =====
Use the following Javascript methods when working with MathML:
^Javascript MethodDescription |string getFormattedMathML(int markupType, int formatLevel, boolean [[http://www.w3.org/TR/MathML/chapter2.html#interf.namespace|namespaceAttr]], string [[http://www.w3.org/TR/MathML2/appendixa.html#parsing.dtd.prefix|namespacePrefix]], int characterType)|Returns the MathML for the current equation with the specified format. Specific values for the parameters are as follows:
markupType 0 Mixed content/presentation markup 1 Presentation markup format 2 Content markup format (if possible) 3 Normalized presentation format (extra mrows removed)
formatLevel 0 Pretty printed (on multiple lines and indented to make reading easier) 1 Packed (all on one line, no indenting or extra spaces) 2 Packed and escaped (all on one line, all <>& shown as escaped characters) 3 Packed and wrapped (no extra white space, but returns added at nearest tag at 80 columns)
[[http://www.w3.org/TR/MathML/chapter2.html#interf.namespace|namespaceAttr]] States whether or not a namespace prefix should be added to each tag.
[[http://www.w3.org/TR/MathML2/appendixa.html#parsing.dtd.prefix|namespacePrefix]] Used with namespaceAttr. Prepends every tag with this namespace.
characterType 0 Special characters are shown as entity names if possible. 1 Special characters are shown in the format &#xXXXX; where X is a hexadecimal value. 2 Special characters are shown in UTF-8 format. This is the binary representation of the characters and may look strange in many text-processing programs.| |void setMathML(String new_mml)|Sets the MathML source for the current equation.| ===== Options file =====
The SDK editor components allow you to pass an optional OptionsInfo object as a parameter to their constructor. The “’OptionsInfo”’ class allows you to create, save and read options to a file. This allows the application to retain user settings.
<a><button>Previous: Applications</button></a><a><button>Next: Simple Editor application</button></a>