Commit ada7a0b9 authored by Sylvain Schmitz's avatar Sylvain Schmitz

add counting operator in core 1.0

parent 11735ed6
# XPath fragment of XQueryX in Relax NG compact syntax:
# counting against constants.
#
# Copyright (C) 2016-2017
# 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"
namespace xqx = "http://www.w3.org/2005/XQueryX"
count.op =
element ( eqOp | neOp | equalOp | notEqualOp
| ltOp | leOp | gtOp | geOp
| lessThanOp | lessThanOrEqualOp
| greaterThanOp | greaterThanOrEqualOp ) {
( element firstOperand { count.arg }, element secondOperand { count.arg } )
}
count.arg = int | element functionCallExpr {
element functionName {
attribute xqx:prefix { string "fn" }?,
attribute xqx:URI { string "http://www.w3.org/2005/xpath-functions" }?,
( string "count"
)
},
element arguments {
( expr | element argumentPlaceholder { empty } )*
}?
}
# XPath 1.0 Core fragment with all extensions plus counting
#
# 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"
namespace xqx = "http://www.w3.org/2005/XQueryX"
include "xpath-1.0-core-full.rnc"
include "expr/count.rnc"
op |= count.op
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