Math: Converting to MathML - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Math: Converting to MathML

Description:

Math: Converting to MathML. Goal: Convert publisher-dependent ... Complex operations (changing node order while iteratively traversing node tree) dformula ... – PowerPoint PPT presentation

Number of Views:551
Avg rating:3.0/5.0
Slides: 11
Provided by: timoth70
Category:

less

Transcript and Presenter's Notes

Title: Math: Converting to MathML


1
Math Converting to MathML
  • Eric Lamont Rankin
  • Grainger Engineering Library Information Center
  • University of Illinois at Urbana-Champaign
  • http//dli.grainger.uiuc.edu rankin_at_uiuc.edu

2
Math Converting to MathML
  • Goal Convert publisher-dependent SGML math
    markup to standard MathML
  • Use XSLT to transform markup from one form to
    another
  • Challenges encountered along the way

3
Math Converting to MathML
  • Use XSLT to transform markup from one schema to
    another
  • Convert SGML markup into MathML presentational
    tags
  • Validate MathML using plugin (IBM Techexplorer)
    and native browser (W3C Amaya)
  • One XSL stylesheet for each publisher

4
Math Converting to MathML
  • Use XSLT to transform markup from one form to
    another
  • Simple mapping (renaming tags)

ltdformulagt . . . lt/dformulagt
ltmathgt . . . lt/mathgt
ltxsltemplate matchdformulagt ltxslelement
namemathgt ltxslapply-templates/gt
lt/xslelementgt lt/xsltemplategt


5
Math Converting to MathML
  • Use XSLT to transform markup from one form to
    another
  • Complex operations (changing node order while
    iteratively traversing node tree)

ltmathgt ltmsubsupgt ltmrowgtltmchar
namealpha/gtlt/mrowgt
ltmrowgtltmigtilt/mngtlt/mrowgt
ltmrowgtltmngt2lt/mngtlt/mrowgt lt/msubsupgt lt/mathgt
ltdformulagt ltggtalt/ggt ltsupgt2lt/supgt
ltinfgtilt/infgt lt/dformulagt
6
Math Converting to MathML
  • Ugly source code snippet

ltxslwhen test"sup or inf"gt ltxslfor-each
select"childnode()"gt ltxslchoosegt
ltxslwhen test"name(selfnode())'sup'
and name(following-siblingnode()1)'inf'"gt
ltxslelement name"msubsup"gt
ltxslelement name"mrow"gt
ltxslapply-templates
select"preceding-siblingnode()1"/gt
lt/xslelementgt
ltxslelement name"mrow"gt ltxslapply-template
s select"following-siblingnode()1"/gt lt/xsle
lementgt ltxslelement name"mrow"gt
ltxslapply-templates select"selfnode()"/gt lt/xs
lelementgt lt/xslelementgt
lt/xslwhengt . . . THERE ARE FIVE
MORE CASES TO HANDLE !
7
Math Converting to MathML
  • Challenges encountered along the way
  • Scripting needed to parse text nodes

ltdformulagta2clt/dformulagt becomes ltmathgtltmigtalt/mi
gtltmogtlt/mogtltmngt2lt/mngtltmogtlt/mogtltmigtclt/migtlt/mathgt
Original SGML math markup does not distinguish
between variables, operators, and numbers
explicitly.
8
Math Converting to MathML
  • Challenges encountered along the way
  • Rendering does not always conform to spec

ltmfenced open closegt . . .
lt/mfencedgt
ltmogtlt/mogt . . . ltmogtlt/mogt
There should be no difference (rendered using
Amaya)
9
Math Converting to MathML
  • Challenges encountered along the way
  • Browsers render equations slightly differently

Original print from publisher Techexplorer
(Netscape) Amaya
10
Math Converting to MathML
  • XSLT allows us to generate standard MathML from
    publisher-dependent SGML math markup
  • MathML can be rendered in browsers without the
    need to style (Amaya, Techexplorer)
  • Next Step
  • create XSL stylesheets for remaining publishers
  • continue to minimize hand editing
Write a Comment
User Comments (0)
About PowerShow.com