Skip to content

Instantly share code, notes, and snippets.

@physikerwelt
Created February 27, 2014 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save physikerwelt/9252751 to your computer and use it in GitHub Desktop.
Save physikerwelt/9252751 to your computer and use it in GitHub Desktop.
xquery declare default element namespace "http://www.w3.org/1998/Math/MathML";
for $m in db2-fn:xmlcolumn("math.math_mathml") return
for $x in $m//*:apply
[*[1]/name() ='sin'
and *[2]/name() ='apply'
and *[2][*[1]/name() ='csymbol'
and *[1][./text() = 'superscript']
and *[3]/name() ='cn'
and *[3][./text() = '2']]]
where
fn:count($x/*[2]/*[1]/*) = 0
and fn:count($x/*[2]/*[3]/*) = 0
and fn:count($x/*[2]/*) = 3
and fn:count($x/*) = 2
return
data($m/*[1]/@alttext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment