![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: MathML 2 ascii?by Aristotle (Chancellor) |
on Jan 25, 2005 at 03:46 UTC ( [id://424783]=note: print w/replies, xml ) | Need Help?? |
Use the right tool for the job. This here is nowhere near a full implementation of a ASCII renderer for MathML, but it's a start that will work for your one example document.
This translates your sample input to (joule / (meter ^ 2)) Yes, XSLT is horribly verbose, but if you can see past the long-winded identifiers and the redundancy caused by closing tags, you'll find the basic modus operandi of the language to be a compact, elegant way of expressing tree manipulations. (I've often toyed with the idea of writing a strictly lexical translator that would allow transformations to be expressed in a less redundant, more human friendly syntax.) The following could be used as a driver script if you need to do this from Perl.
Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|