Commit 8eb72da3 authored by Sylvain Schmitz's avatar Sylvain Schmitz

Merge branch 'master' of https://git.lsv.fr/schmitz/xpparser

parents 5f97e13a 69c31e0c
#!/bin/bash #!/bin/bash
fragment='xpath-2.0-core-join.rnc'
xslt=`grep 'xslt' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` xslt=`grep 'xslt' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
xquery=`grep 'xquery' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` xquery=`grep 'xquery' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
printf '\\begin{tabular}{lrrrr}\n' printf '\\begin{tabular}{lrrrrr}\n'
printf '\\toprule\n' printf '\\toprule\n'
printf 'Source & queries & XPath\\,1.0 & XPath\\,2.0 & XPath\,3.0\\\\\n' printf 'Source & queries & XPath\\,1.0 & XPath\\,2.0 & XPath\,3.0 & \\textsf{CoreXPath~2.0}\\\\\n'
printf ' & & & & & extended\\\\\n'
printf '\\midrule\n' printf '\\midrule\n'
# XSLT files # XSLT files
...@@ -24,6 +27,9 @@ do ...@@ -24,6 +27,9 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc` percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% " printf "& $percent\\\\%% "
done done
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[schemas/validation[@schema=\"$fragment\" and @valid=\"yes\"]])" $file`
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n' printf '\\\\\n'
printf "{\\\\tiny \\\\url{$url}} & & & & \\\\\\\\\n" printf "{\\\\tiny \\\\url{$url}} & & & & \\\\\\\\\n"
done done
...@@ -46,6 +52,15 @@ do ...@@ -46,6 +52,15 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc` percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% " printf "& $percent\\\\%% "
done done
count=0
for file in $xslt
do
c=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[schemas/validation[@schema=\"$fragment\" and @valid=\"yes\"]])" $file`
count=$((count+c))
done
counts[4]=$count
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n' printf '\\\\\n'
printf '\\midrule\n' printf '\\midrule\n'
...@@ -67,6 +82,9 @@ do ...@@ -67,6 +82,9 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc` percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% " printf "& $percent\\\\%% "
done done
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[schemas/validation[@schema=\"$fragment\" and @valid=\"yes\"]])" $file`
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n' printf '\\\\\n'
printf "{\\\\tiny \\\\url{$url}} & & & & \\\\\\\\\n" printf "{\\\\tiny \\\\url{$url}} & & & & \\\\\\\\\n"
done done
...@@ -89,13 +107,22 @@ do ...@@ -89,13 +107,22 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc` percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% " printf "& $percent\\\\%% "
done done
count=0
for file in $xquery
do
c=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[schemas/validation[@schema=\"$fragment\" and @valid=\"yes\"]])" $file`
count=$((count+c))
done
counts[4]=$((count + counts[i]))
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n' printf '\\\\\n'
N=$((N + n)) N=$((N + n))
printf '\\midrule\n' printf '\\midrule\n'
printf 'Total ' printf 'Total '
printf "& %'.0f " $N printf "& %'.0f " $N
for ((i=1; i < 4; ++i)) for ((i=1; i < 5; ++i))
do do
count=${counts[i]} count=${counts[i]}
percent=`echo "scale=1; 100*$count/$N" | bc` percent=`echo "scale=1; 100*$count/$N" | bc`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment