New version of MathML filter

New version of MathML filter

by Zbigniew Fiedorowicz -
Number of replies: 4
I am attaching below a new version of the MathML filter.  Besides incorporating some of Bruno's suggestions, there are a few more tweaks of character entities (math symbols), an improvement in error handling, some primitive cache cleanup code, a minor recompilation of mimetex.cgi to add an additional symbol and maybe a few other things I can't remember offhand. I think the filter now approaches beta quality. The CVS has also been updated.
Average of ratings: Useful (1)
In reply to Zbigniew Fiedorowicz

Re: New version of MathML filter

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
A small suggestion for optimisation - str_replace supports arrays as arguments ... I think this will be somewhat faster that calling str_replace multiple times.
In reply to Martin Dougiamas

Re: New version of MathML filter

by Zbigniew Fiedorowicz -

OK, I tried this. I don't get the impression that this makes the script run any faster. In fact I get the impression it runs maybe a little bit slower. Also this change makes the script less readable and writable.

PS. I put some timing code into the two versions of the script, and it confirms my subjective impression. The complicated string theory pages take 33-40 seconds to process. The version of the script with many str_replace() statements always takes 2 or 3 seconds less to complete than the one with a single str_replace() with array arguments.

Average of ratings: Useful (1)
In reply to Zbigniew Fiedorowicz

Re: New version of MathML filter

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Cool, thanks for the speed comparison - that's useful to know.

Is the new caching helping the math filters?
In reply to Zbigniew Fiedorowicz

Re: New version of MathML filter

by Bruno Vernier -
OK, I finally had a chance to test the latest mathml filter

it still works fine smile

the only trouble I had were:

1. I did not realize that filters are now declared in the database not in config.php (which had me baffled for a bit)

2. my debian Xalan v1.2-2 executable behaves slightly differently than Zig's and I suggest that the xalan variable include the first argument so that we debian-types don't have to go hunting for it in the system call way below

default xalan should be modified to "/usr/local/bin/Xalan - "
with an extra dash

and debian xalan can then be "/usr/bin/xalan -XSL "

thanks for making the mmltex.xsl use relative paths (that works)