Commit 76bb3edc authored by Sylvain Schmitz's avatar Sylvain Schmitz

XPath 3.0 std in composition

parent 8442f63f
# XPath 3.0 fragment of XQueryX in Relax NG compact syntax with only
# standard functions
#
# Copyright (C) 2016-2018
# David Baelde, Anthony Lick and Sylvain Schmitz (ENS Cachan)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
default namespace = "http://www.w3.org/2005/XQueryX"
fn.math = external "fn/math.rnc"
fn.std = external "fn/standard.rnc"
include "xpath-3.0.rnc" {
fun = element functionCallExpr {
element functionName { fn.math | fn.std },
element arguments {
( expr | element argumentPlaceholder { empty } )*
}?
}
}
\ No newline at end of file
......@@ -3,9 +3,10 @@
xslt=`grep 'xslt' 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 'Source & \\!\\!queries & \\!\\!XPath\\,1.0 & \\!\\!XPath\\,2.0 & \\!\\!XPath\,3.0\\\\\n'
printf 'Sources & Queries & \\multicolumn{4}{c}{Coverage}\\\\\n'
printf ' & & XPath\\,1.0 & XPath\\,2.0 & XPath\,3.0 & XPath\,3.0\,std\\\\\n'
printf '\\midrule\n'
# total number of XSLT queries
......@@ -25,6 +26,15 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
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=\"xpath-3.0-std.rnc\" and @valid=\"yes\"]])" $file`
count=$((count+c))
done
counts[4]=$count
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n'
N=$n
......@@ -45,13 +55,22 @@ do
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
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=\"xpath-3.0-std.rnc\" and @valid=\"yes\"]])" $file`
count=$((count+c))
done
counts[4]=$((count + counts[4]))
percent=`echo "scale=1; 100*$count/$n" | bc`
printf "& $percent\\\\%% "
printf '\\\\\n'
N=$((N + n))
printf '\\midrule\n'
printf 'Total '
printf "& %'.0f " $N
for ((i=1; i < 4; ++i))
for ((i=1; i < 5; ++i))
do
count=${counts[i]}
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