| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** All rights reserved.
|
|---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
|---|
| 6 | **
|
|---|
| 7 | ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
|
|---|
| 8 | **
|
|---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 10 | ** Commercial Usage
|
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 14 | ** a written agreement between you and Nokia.
|
|---|
| 15 | **
|
|---|
| 16 | ** GNU Lesser General Public License Usage
|
|---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 20 | ** packaging of this file. Please review the following information to
|
|---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 23 | **
|
|---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
|---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
|---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you have questions regarding the use of this file, please contact
|
|---|
| 37 | ** Nokia at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #include "qanyuri_p.h"
|
|---|
| 43 | #include "qatomizer_p.h"
|
|---|
| 44 | #include "qbuiltintypes_p.h"
|
|---|
| 45 | #include "qcardinalityverifier_p.h"
|
|---|
| 46 | #include "qcommonsequencetypes_p.h"
|
|---|
| 47 | #include "qcommonvalues_p.h"
|
|---|
| 48 | #include "qemptysequence_p.h"
|
|---|
| 49 | #include "qcommonnamespaces_p.h"
|
|---|
| 50 | #include "qxmlname.h"
|
|---|
| 51 | #include "qatomicstring_p.h"
|
|---|
| 52 |
|
|---|
| 53 | /* Functions */
|
|---|
| 54 | #include "qaccessorfns_p.h"
|
|---|
| 55 | #include "qaggregatefns_p.h"
|
|---|
| 56 | #include "qassemblestringfns_p.h"
|
|---|
| 57 | #include "qbooleanfns_p.h"
|
|---|
| 58 | #include "qcomparestringfns_p.h"
|
|---|
| 59 | #include "qcomparingaggregator_p.h"
|
|---|
| 60 | #include "qcontextfns_p.h"
|
|---|
| 61 | #include "qdatetimefn_p.h"
|
|---|
| 62 | #include "qdatetimefns_p.h"
|
|---|
| 63 | #include "qdeepequalfn_p.h"
|
|---|
| 64 | #include "qerrorfn_p.h"
|
|---|
| 65 | #include "qnodefns_p.h"
|
|---|
| 66 | #include "qnumericfns_p.h"
|
|---|
| 67 | #include "qpatternmatchingfns_p.h"
|
|---|
| 68 | #include "qqnamefns_p.h"
|
|---|
| 69 | #include "qresolveurifn_p.h"
|
|---|
| 70 | #include "qsequencefns_p.h"
|
|---|
| 71 | #include "qsequencegeneratingfns_p.h"
|
|---|
| 72 | #include "qstringvaluefns_p.h"
|
|---|
| 73 | #include "qsubstringfns_p.h"
|
|---|
| 74 | #include "qtimezonefns_p.h"
|
|---|
| 75 | #include "qtracefn_p.h"
|
|---|
| 76 |
|
|---|
| 77 | #include "qxpath20corefunctions_p.h"
|
|---|
| 78 |
|
|---|
| 79 | QT_BEGIN_NAMESPACE
|
|---|
| 80 |
|
|---|
| 81 | using namespace QPatternist;
|
|---|
| 82 |
|
|---|
| 83 | Expression::Ptr XPath20CoreFunctions::retrieveExpression(const QXmlName name,
|
|---|
| 84 | const Expression::List &args,
|
|---|
| 85 | const FunctionSignature::Ptr &sign) const
|
|---|
| 86 | {
|
|---|
| 87 | Q_ASSERT(sign);
|
|---|
| 88 |
|
|---|
| 89 | Expression::Ptr fn;
|
|---|
| 90 | #define testFN(ln, cname) else if(name.localName() == StandardLocalNames::ln) fn = Expression::Ptr(new cname())
|
|---|
| 91 |
|
|---|
| 92 | if(false) /* Dummy for the macro handling. Will be optimized away anyway. */
|
|---|
| 93 | return Expression::Ptr();
|
|---|
| 94 | /* Alphabetic order. */
|
|---|
| 95 | testFN(QName, QNameFN);
|
|---|
| 96 | testFN(abs, AbsFN);
|
|---|
| 97 | testFN(adjust_date_to_timezone, AdjustDateToTimezoneFN);
|
|---|
| 98 | testFN(adjust_dateTime_to_timezone, AdjustDateTimeToTimezoneFN);
|
|---|
| 99 | testFN(adjust_time_to_timezone, AdjustTimeToTimezoneFN);
|
|---|
| 100 | testFN(avg, AvgFN);
|
|---|
| 101 | testFN(base_uri, BaseURIFN);
|
|---|
| 102 | testFN(codepoint_equal, CodepointEqualFN);
|
|---|
| 103 | testFN(codepoints_to_string, CodepointsToStringFN);
|
|---|
| 104 | testFN(collection, CollectionFN);
|
|---|
| 105 | testFN(compare, CompareFN);
|
|---|
| 106 | testFN(current_date, CurrentDateFN);
|
|---|
| 107 | testFN(current_dateTime, CurrentDateTimeFN);
|
|---|
| 108 | testFN(current_time, CurrentTimeFN);
|
|---|
| 109 | testFN(dateTime, DateTimeFN);
|
|---|
| 110 | testFN(day_from_date, DayFromAbstractDateTimeFN);
|
|---|
| 111 | testFN(day_from_dateTime, DayFromAbstractDateTimeFN);
|
|---|
| 112 | testFN(days_from_duration, DaysFromDurationFN);
|
|---|
| 113 | testFN(deep_equal, DeepEqualFN);
|
|---|
| 114 | testFN(default_collation, DefaultCollationFN);
|
|---|
| 115 | testFN(distinct_values, DistinctValuesFN);
|
|---|
| 116 | testFN(doc, DocFN);
|
|---|
| 117 | testFN(doc_available, DocAvailableFN);
|
|---|
| 118 | testFN(document_uri, DocumentURIFN);
|
|---|
| 119 | testFN(empty, Existence<Expression::IDEmptyFN>);
|
|---|
| 120 | testFN(encode_for_uri, EncodeForURIFN);
|
|---|
| 121 | testFN(ends_with, EndsWithFN);
|
|---|
| 122 | testFN(error, ErrorFN);
|
|---|
| 123 | testFN(escape_html_uri, EscapeHtmlURIFN);
|
|---|
| 124 | testFN(exists, Existence<Expression::IDExistsFN>);
|
|---|
| 125 | testFN(hours_from_dateTime, HoursFromAbstractDateTimeFN);
|
|---|
| 126 | testFN(hours_from_duration, HoursFromDurationFN);
|
|---|
| 127 | testFN(hours_from_time, HoursFromAbstractDateTimeFN);
|
|---|
| 128 | testFN(idref, IdrefFN);
|
|---|
| 129 | testFN(implicit_timezone, ImplicitTimezoneFN);
|
|---|
| 130 | testFN(in_scope_prefixes, InScopePrefixesFN);
|
|---|
| 131 | testFN(index_of, IndexOfFN);
|
|---|
| 132 | testFN(insert_before, InsertBeforeFN);
|
|---|
| 133 | testFN(iri_to_uri, IriToURIFN);
|
|---|
| 134 | testFN(local_name_from_QName, LocalNameFromQNameFN);
|
|---|
| 135 | testFN(lower_case, LowerCaseFN);
|
|---|
| 136 | testFN(matches, MatchesFN);
|
|---|
| 137 | testFN(max, MaxFN);
|
|---|
| 138 | testFN(min, MinFN);
|
|---|
| 139 | testFN(minutes_from_dateTime, MinutesFromAbstractDateTimeFN);
|
|---|
| 140 | testFN(minutes_from_duration, MinutesFromDurationFN);
|
|---|
| 141 | testFN(minutes_from_time, MinutesFromAbstractDateTimeFN);
|
|---|
| 142 | testFN(month_from_date, MonthFromAbstractDateTimeFN);
|
|---|
| 143 | testFN(month_from_dateTime, MonthFromAbstractDateTimeFN);
|
|---|
| 144 | testFN(months_from_duration, MonthsFromDurationFN);
|
|---|
| 145 | testFN(namespace_uri_for_prefix, NamespaceURIForPrefixFN);
|
|---|
| 146 | testFN(namespace_uri_from_QName, NamespaceURIFromQNameFN);
|
|---|
| 147 | testFN(nilled, NilledFN);
|
|---|
| 148 | testFN(node_name, NodeNameFN);
|
|---|
| 149 | testFN(normalize_unicode, NormalizeUnicodeFN);
|
|---|
| 150 | testFN(prefix_from_QName, PrefixFromQNameFN);
|
|---|
| 151 | testFN(remove, RemoveFN);
|
|---|
| 152 | testFN(replace, ReplaceFN);
|
|---|
| 153 | testFN(resolve_QName, ResolveQNameFN);
|
|---|
| 154 | testFN(resolve_uri, ResolveURIFN);
|
|---|
| 155 | testFN(generic_string_join, StringJoinFN);
|
|---|
| 156 | testFN(reverse, ReverseFN);
|
|---|
| 157 | testFN(root, RootFN);
|
|---|
| 158 | testFN(round_half_to_even, RoundHalfToEvenFN);
|
|---|
| 159 | testFN(seconds_from_dateTime, SecondsFromAbstractDateTimeFN);
|
|---|
| 160 | testFN(seconds_from_duration, SecondsFromDurationFN);
|
|---|
| 161 | testFN(seconds_from_time, SecondsFromAbstractDateTimeFN);
|
|---|
| 162 | testFN(static_base_uri, StaticBaseURIFN);
|
|---|
| 163 | testFN(string_join, StringJoinFN);
|
|---|
| 164 | testFN(string_to_codepoints, StringToCodepointsFN);
|
|---|
| 165 | testFN(subsequence, SubsequenceFN);
|
|---|
| 166 | testFN(timezone_from_date, TimezoneFromAbstractDateTimeFN);
|
|---|
| 167 | testFN(timezone_from_dateTime, TimezoneFromAbstractDateTimeFN);
|
|---|
| 168 | testFN(timezone_from_time, TimezoneFromAbstractDateTimeFN);
|
|---|
| 169 | testFN(tokenize, TokenizeFN);
|
|---|
| 170 | testFN(trace, TraceFN);
|
|---|
| 171 | testFN(upper_case, UpperCaseFN);
|
|---|
| 172 | testFN(year_from_date, YearFromAbstractDateTimeFN);
|
|---|
| 173 | testFN(year_from_dateTime, YearFromAbstractDateTimeFN);
|
|---|
| 174 | testFN(years_from_duration, YearsFromDurationFN);
|
|---|
| 175 | #undef testFN
|
|---|
| 176 |
|
|---|
| 177 | if(fn)
|
|---|
| 178 | {
|
|---|
| 179 | fn->setOperands(args);
|
|---|
| 180 | fn->as<FunctionCall>()->setSignature(sign);
|
|---|
| 181 | }
|
|---|
| 182 | else
|
|---|
| 183 | {
|
|---|
| 184 | /* Do the ones which are not FunctionCall sub-classes. The effect is
|
|---|
| 185 | * that FunctionCall sub-classes has "automatic" type checking in the base
|
|---|
| 186 | * class done from the background of their function signature, while
|
|---|
| 187 | * these special classes are on their own, and must do it manually. */
|
|---|
| 188 | if(name.localName() == StandardLocalNames::data)
|
|---|
| 189 | fn = Expression::Ptr(new Atomizer(args.first()));
|
|---|
| 190 | else if(name.localName() == StandardLocalNames::zero_or_one)
|
|---|
| 191 | fn = Expression::Ptr(new CardinalityVerifier(args.first(), Cardinality::zeroOrOne(),
|
|---|
| 192 | ReportContext::FORG0003));
|
|---|
| 193 | else if(name.localName() == StandardLocalNames::one_or_more)
|
|---|
| 194 | fn = Expression::Ptr(new CardinalityVerifier(args.first(), Cardinality::oneOrMore(),
|
|---|
| 195 | ReportContext::FORG0004));
|
|---|
| 196 | else if(name.localName() == StandardLocalNames::exactly_one)
|
|---|
| 197 | fn = Expression::Ptr(new CardinalityVerifier(args.first(), Cardinality::exactlyOne(),
|
|---|
| 198 | ReportContext::FORG0005));
|
|---|
| 199 | else if(name.localName() == StandardLocalNames::unordered)
|
|---|
| 200 | /* We don't make use of the unordered() function, so just pop in
|
|---|
| 201 | * the arg. */
|
|---|
| 202 | fn = args.first();
|
|---|
| 203 | }
|
|---|
| 204 |
|
|---|
| 205 | return fn;
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 | FunctionSignature::Ptr XPath20CoreFunctions::retrieveFunctionSignature(const NamePool::Ptr &np,
|
|---|
| 209 | const QXmlName name)
|
|---|
| 210 | {
|
|---|
| 211 | if(StandardNamespaces::fn != name.namespaceURI() && name.namespaceURI() != StandardNamespaces::InternalXSLT)
|
|---|
| 212 | return FunctionSignature::Ptr();
|
|---|
| 213 |
|
|---|
| 214 | FunctionSignature::Ptr s(functionSignatures().value(name));
|
|---|
| 215 |
|
|---|
| 216 | if(!s)
|
|---|
| 217 | {
|
|---|
| 218 | const QXmlName::LocalNameCode localName = name.localName();
|
|---|
| 219 |
|
|---|
| 220 | /* Alphabetic order. */
|
|---|
| 221 | if(StandardLocalNames::QName == localName)
|
|---|
| 222 | {
|
|---|
| 223 | s = addFunction(StandardLocalNames::QName, 2, 2, CommonSequenceTypes::ExactlyOneQName);
|
|---|
| 224 | s->appendArgument(argument(np, "paramURI"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 225 | s->appendArgument(argument(np, "paramQName"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 226 | }
|
|---|
| 227 | else if(StandardLocalNames::abs == localName)
|
|---|
| 228 | {
|
|---|
| 229 | s = addFunction(StandardLocalNames::abs, 1, 1, CommonSequenceTypes::ZeroOrOneNumeric,
|
|---|
| 230 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 231 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNumeric);
|
|---|
| 232 | }
|
|---|
| 233 | else if(StandardLocalNames::adjust_date_to_timezone == localName)
|
|---|
| 234 | {
|
|---|
| 235 | s = addFunction(StandardLocalNames::adjust_date_to_timezone, 1, 2, CommonSequenceTypes::ZeroOrOneDate,
|
|---|
| 236 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 237 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 238 | s->appendArgument(argument(np, "timezone"), CommonSequenceTypes::ZeroOrOneDayTimeDuration);
|
|---|
| 239 | }
|
|---|
| 240 | else if(StandardLocalNames::adjust_dateTime_to_timezone == localName)
|
|---|
| 241 | {
|
|---|
| 242 | s = addFunction(StandardLocalNames::adjust_dateTime_to_timezone, 1, 2, CommonSequenceTypes::ZeroOrOneDateTime,
|
|---|
| 243 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 244 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 245 | s->appendArgument(argument(np, "timezone"), CommonSequenceTypes::ZeroOrOneDayTimeDuration);
|
|---|
| 246 | }
|
|---|
| 247 | else if(StandardLocalNames::adjust_time_to_timezone == localName)
|
|---|
| 248 | {
|
|---|
| 249 | s = addFunction(StandardLocalNames::adjust_time_to_timezone, 1, 2, CommonSequenceTypes::ZeroOrOneTime,
|
|---|
| 250 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 251 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 252 | s->appendArgument(argument(np, "timezone"), CommonSequenceTypes::ZeroOrOneDayTimeDuration);
|
|---|
| 253 | }
|
|---|
| 254 | else if(StandardLocalNames::avg == localName)
|
|---|
| 255 | {
|
|---|
| 256 | s = addFunction(StandardLocalNames::avg, 1, 1, CommonSequenceTypes::ZeroOrOneAtomicType,
|
|---|
| 257 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 258 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 259 | }
|
|---|
| 260 | else if(StandardLocalNames::base_uri == localName)
|
|---|
| 261 | {
|
|---|
| 262 | s = addFunction(StandardLocalNames::base_uri, 0, 1, CommonSequenceTypes::ZeroOrOneAnyURI,
|
|---|
| 263 | Expression::UseContextItem);
|
|---|
| 264 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNode);
|
|---|
| 265 | }
|
|---|
| 266 | else if(StandardLocalNames::codepoint_equal == localName)
|
|---|
| 267 | {
|
|---|
| 268 | s = addFunction(StandardLocalNames::codepoint_equal, 2, 2, CommonSequenceTypes::ZeroOrOneBoolean);
|
|---|
| 269 | s->appendArgument(argument(np, "comparand1"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 270 | s->appendArgument(argument(np, "comparand2"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 271 | }
|
|---|
| 272 | else if(StandardLocalNames::codepoints_to_string == localName)
|
|---|
| 273 | {
|
|---|
| 274 | s = addFunction(StandardLocalNames::codepoints_to_string, 1, 1, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 275 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreIntegers);
|
|---|
| 276 | }
|
|---|
| 277 | else if(StandardLocalNames::collection == localName)
|
|---|
| 278 | {
|
|---|
| 279 | s = addFunction(StandardLocalNames::collection, 0, 1, CommonSequenceTypes::ZeroOrMoreNodes);
|
|---|
| 280 | s->appendArgument(argument(np, "uri"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 281 | }
|
|---|
| 282 | else if(StandardLocalNames::compare == localName)
|
|---|
| 283 | {
|
|---|
| 284 | s = addFunction(StandardLocalNames::compare, 2, 3, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 285 | Expression::LastOperandIsCollation);
|
|---|
| 286 | s->appendArgument(argument(np, "comparand1"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 287 | s->appendArgument(argument(np, "comparand2"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 288 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 289 | }
|
|---|
| 290 | else if(StandardLocalNames::current_date == localName)
|
|---|
| 291 | {
|
|---|
| 292 | s = addFunction(StandardLocalNames::current_date, 0, 0, CommonSequenceTypes::ExactlyOneDate,
|
|---|
| 293 | Expression::DisableElimination);
|
|---|
| 294 | }
|
|---|
| 295 | else if(StandardLocalNames::current_dateTime == localName)
|
|---|
| 296 | {
|
|---|
| 297 | s = addFunction(StandardLocalNames::current_dateTime, 0, 0, CommonSequenceTypes::ExactlyOneDateTime,
|
|---|
| 298 | Expression::DisableElimination);
|
|---|
| 299 | }
|
|---|
| 300 | else if(StandardLocalNames::current_time == localName)
|
|---|
| 301 | {
|
|---|
| 302 | s = addFunction(StandardLocalNames::current_time, 0, 0, CommonSequenceTypes::ExactlyOneTime,
|
|---|
| 303 | Expression::DisableElimination);
|
|---|
| 304 | }
|
|---|
| 305 | else if(StandardLocalNames::data == localName)
|
|---|
| 306 | {
|
|---|
| 307 | s = addFunction(StandardLocalNames::data, 1, 1, CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 308 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 309 | }
|
|---|
| 310 | else if(StandardLocalNames::dateTime == localName)
|
|---|
| 311 | {
|
|---|
| 312 | s = addFunction(StandardLocalNames::dateTime, 2, 2, CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 313 | s->appendArgument(argument(np, "arg1"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 314 | s->appendArgument(argument(np, "arg2"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 315 | }
|
|---|
| 316 | else if(StandardLocalNames::day_from_date == localName)
|
|---|
| 317 | {
|
|---|
| 318 | s = addFunction(StandardLocalNames::day_from_date, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 319 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 320 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 321 | }
|
|---|
| 322 | else if(StandardLocalNames::day_from_dateTime == localName)
|
|---|
| 323 | {
|
|---|
| 324 | s = addFunction(StandardLocalNames::day_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 325 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 326 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 327 | }
|
|---|
| 328 | else if(StandardLocalNames::days_from_duration == localName)
|
|---|
| 329 | {
|
|---|
| 330 | s = addFunction(StandardLocalNames::days_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 331 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 332 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 333 | }
|
|---|
| 334 | else if(StandardLocalNames::deep_equal == localName)
|
|---|
| 335 | {
|
|---|
| 336 | s = addFunction(StandardLocalNames::deep_equal, 2, 3, CommonSequenceTypes::ExactlyOneBoolean,
|
|---|
| 337 | Expression::LastOperandIsCollation);
|
|---|
| 338 | s->appendArgument(argument(np, "arg1"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 339 | s->appendArgument(argument(np, "arg2"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 340 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 341 | }
|
|---|
| 342 | else if(StandardLocalNames::default_collation == localName)
|
|---|
| 343 | {
|
|---|
| 344 | s = addFunction(StandardLocalNames::default_collation, 0, 0, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 345 | }
|
|---|
| 346 | else if(StandardLocalNames::distinct_values == localName)
|
|---|
| 347 | {
|
|---|
| 348 | s = addFunction(StandardLocalNames::distinct_values, 1, 2, CommonSequenceTypes::ZeroOrMoreAtomicTypes,
|
|---|
| 349 | Expression::LastOperandIsCollation |
|
|---|
| 350 | Expression::EmptynessFollowsChild |
|
|---|
| 351 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 352 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 353 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 354 | }
|
|---|
| 355 | else if(StandardLocalNames::doc == localName)
|
|---|
| 356 | {
|
|---|
| 357 | s = addFunction(StandardLocalNames::doc, 1, 1, CommonSequenceTypes::ZeroOrOneDocumentNode, Expression::DisableElimination);
|
|---|
| 358 | s->appendArgument(argument(np, "uri"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 359 | }
|
|---|
| 360 | else if(StandardLocalNames::doc_available == localName)
|
|---|
| 361 | {
|
|---|
| 362 | s = addFunction(StandardLocalNames::doc_available, 1, 1, CommonSequenceTypes::ExactlyOneBoolean, Expression::DisableElimination);
|
|---|
| 363 | s->appendArgument(argument(np, "uri"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 364 | }
|
|---|
| 365 | else if(StandardLocalNames::document_uri == localName)
|
|---|
| 366 | {
|
|---|
| 367 | s = addFunction(StandardLocalNames::document_uri, 1, 1, CommonSequenceTypes::ZeroOrOneAnyURI);
|
|---|
| 368 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNode);
|
|---|
| 369 | }
|
|---|
| 370 | else if(StandardLocalNames::empty == localName)
|
|---|
| 371 | {
|
|---|
| 372 | s = addFunction(StandardLocalNames::empty, 1, 1, CommonSequenceTypes::ExactlyOneBoolean, Expression::IDEmptyFN);
|
|---|
| 373 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 374 | }
|
|---|
| 375 | else if(StandardLocalNames::encode_for_uri == localName)
|
|---|
| 376 | {
|
|---|
| 377 | s = addFunction(StandardLocalNames::encode_for_uri, 1, 1, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 378 | s->appendArgument(argument(np, "uriPart"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 379 | }
|
|---|
| 380 | else if(StandardLocalNames::ends_with == localName)
|
|---|
| 381 | {
|
|---|
| 382 | s = addFunction(StandardLocalNames::ends_with, 2, 3, CommonSequenceTypes::ExactlyOneBoolean,
|
|---|
| 383 | Expression::LastOperandIsCollation);
|
|---|
| 384 | s->appendArgument(argument(np, "arg1"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 385 | s->appendArgument(argument(np, "arg2"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 386 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 387 | }
|
|---|
| 388 | else if(StandardLocalNames::error == localName)
|
|---|
| 389 | {
|
|---|
| 390 | s = addFunction(StandardLocalNames::error, 0, 3, CommonSequenceTypes::None,
|
|---|
| 391 | Expression::DisableElimination | Expression::DisableTypingDeduction);
|
|---|
| 392 | s->appendArgument(argument(np, "error"), CommonSequenceTypes::ZeroOrOneQName);
|
|---|
| 393 | s->appendArgument(argument(np, "description"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 394 | s->appendArgument(argument(np, "errorObject"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 395 | }
|
|---|
| 396 | else if(StandardLocalNames::escape_html_uri == localName)
|
|---|
| 397 | {
|
|---|
| 398 | s = addFunction(StandardLocalNames::escape_html_uri, 1, 1, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 399 | s->appendArgument(argument(np, "uri"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 400 | }
|
|---|
| 401 | else if(StandardLocalNames::exactly_one == localName)
|
|---|
| 402 | {
|
|---|
| 403 | s = addFunction(StandardLocalNames::exactly_one, 1, 1, CommonSequenceTypes::ExactlyOneItem);
|
|---|
| 404 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ExactlyOneItem);
|
|---|
| 405 | }
|
|---|
| 406 | else if(StandardLocalNames::exists == localName)
|
|---|
| 407 | {
|
|---|
| 408 | s = addFunction(StandardLocalNames::exists, 1, 1, CommonSequenceTypes::ExactlyOneBoolean, Expression::IDExistsFN);
|
|---|
| 409 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 410 | }
|
|---|
| 411 | else if(StandardLocalNames::hours_from_dateTime == localName)
|
|---|
| 412 | {
|
|---|
| 413 | s = addFunction(StandardLocalNames::hours_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 414 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 415 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 416 | }
|
|---|
| 417 | else if(StandardLocalNames::hours_from_duration == localName)
|
|---|
| 418 | {
|
|---|
| 419 | s = addFunction(StandardLocalNames::hours_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 420 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 421 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 422 | }
|
|---|
| 423 | else if(StandardLocalNames::hours_from_time == localName)
|
|---|
| 424 | {
|
|---|
| 425 | s = addFunction(StandardLocalNames::hours_from_time, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 426 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 427 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 428 | }
|
|---|
| 429 | else if(StandardLocalNames::idref == localName)
|
|---|
| 430 | {
|
|---|
| 431 | s = addFunction(StandardLocalNames::idref, 1, 2, CommonSequenceTypes::ZeroOrMoreElements,
|
|---|
| 432 | Expression::UseContextItem);
|
|---|
| 433 | s->appendArgument(argument(np, "idrefs"), CommonSequenceTypes::ZeroOrMoreStrings);
|
|---|
| 434 | s->appendArgument(argument(np, "node"), CommonSequenceTypes::ExactlyOneNode);
|
|---|
| 435 | }
|
|---|
| 436 | else if(StandardLocalNames::implicit_timezone == localName)
|
|---|
| 437 | {
|
|---|
| 438 | s = addFunction(StandardLocalNames::implicit_timezone, 0, 0, CommonSequenceTypes::ExactlyOneDayTimeDuration,
|
|---|
| 439 | Expression::DisableElimination);
|
|---|
| 440 | }
|
|---|
| 441 | else if(StandardLocalNames::in_scope_prefixes == localName)
|
|---|
| 442 | {
|
|---|
| 443 | s = addFunction(StandardLocalNames::in_scope_prefixes, 1, 1, CommonSequenceTypes::ZeroOrMoreStrings);
|
|---|
| 444 | s->appendArgument(argument(np, "element"), CommonSequenceTypes::ExactlyOneElement);
|
|---|
| 445 | }
|
|---|
| 446 | else if(StandardLocalNames::index_of == localName)
|
|---|
| 447 | {
|
|---|
| 448 | s = addFunction(StandardLocalNames::index_of, 2, 3, CommonSequenceTypes::ZeroOrMoreIntegers,
|
|---|
| 449 | Expression::LastOperandIsCollation);
|
|---|
| 450 | s->appendArgument(argument(np, "seqParam"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 451 | s->appendArgument(argument(np, "searchParam"), CommonSequenceTypes::ExactlyOneAtomicType);
|
|---|
| 452 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 453 | }
|
|---|
| 454 | else if(StandardLocalNames::insert_before == localName)
|
|---|
| 455 | {
|
|---|
| 456 | s = addFunction(StandardLocalNames::insert_before, 3, 3, CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 457 | s->appendArgument(argument(np, "target"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 458 | s->appendArgument(argument(np, "position"), CommonSequenceTypes::ExactlyOneInteger);
|
|---|
| 459 | s->appendArgument(argument(np, "insert"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 460 | }
|
|---|
| 461 | else if(StandardLocalNames::iri_to_uri == localName)
|
|---|
| 462 | {
|
|---|
| 463 | s = addFunction(StandardLocalNames::iri_to_uri, 1, 1, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 464 | s->appendArgument(argument(np, "uri_part"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 465 | }
|
|---|
| 466 | else if(StandardLocalNames::local_name_from_QName == localName)
|
|---|
| 467 | {
|
|---|
| 468 | s = addFunction(StandardLocalNames::local_name_from_QName, 1, 1, CommonSequenceTypes::ZeroOrOneNCName,
|
|---|
| 469 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 470 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneQName);
|
|---|
| 471 | }
|
|---|
| 472 | else if(StandardLocalNames::lower_case == localName)
|
|---|
| 473 | {
|
|---|
| 474 | s = addFunction(StandardLocalNames::lower_case, 1, 1, CommonSequenceTypes::ExactlyOneString,
|
|---|
| 475 | Expression::IDLowerCaseFN);
|
|---|
| 476 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 477 | }
|
|---|
| 478 | else if(StandardLocalNames::matches == localName)
|
|---|
| 479 | {
|
|---|
| 480 | s = addFunction(StandardLocalNames::matches, 2, 3, CommonSequenceTypes::ExactlyOneBoolean);
|
|---|
| 481 | s->appendArgument(argument(np, "input"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 482 | s->appendArgument(argument(np, "pattern"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 483 | s->appendArgument(argument(np, "flags"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 484 | }
|
|---|
| 485 | else if(StandardLocalNames::max == localName)
|
|---|
| 486 | {
|
|---|
| 487 | s = addFunction(StandardLocalNames::max, 1, 2, CommonSequenceTypes::ZeroOrOneAtomicType,
|
|---|
| 488 | Expression::LastOperandIsCollation |
|
|---|
| 489 | Expression::EmptynessFollowsChild |
|
|---|
| 490 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 491 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 492 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 493 | }
|
|---|
| 494 | else if(StandardLocalNames::min == localName)
|
|---|
| 495 | {
|
|---|
| 496 | s = addFunction(StandardLocalNames::min, 1, 2, CommonSequenceTypes::ZeroOrOneAtomicType,
|
|---|
| 497 | Expression::LastOperandIsCollation |
|
|---|
| 498 | Expression::EmptynessFollowsChild |
|
|---|
| 499 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 500 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 501 | s->appendArgument(argument(np, "collation"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 502 | }
|
|---|
| 503 | else if(StandardLocalNames::minutes_from_dateTime == localName)
|
|---|
| 504 | {
|
|---|
| 505 | s = addFunction(StandardLocalNames::minutes_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 506 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 507 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 508 | }
|
|---|
| 509 | else if(StandardLocalNames::minutes_from_duration == localName)
|
|---|
| 510 | {
|
|---|
| 511 | s = addFunction(StandardLocalNames::minutes_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 512 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 513 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 514 | }
|
|---|
| 515 | else if(StandardLocalNames::minutes_from_time == localName)
|
|---|
| 516 | {
|
|---|
| 517 | s = addFunction(StandardLocalNames::minutes_from_time, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 518 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 519 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 520 | }
|
|---|
| 521 | else if(StandardLocalNames::month_from_date == localName)
|
|---|
| 522 | {
|
|---|
| 523 | s = addFunction(StandardLocalNames::month_from_date, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 524 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 525 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 526 | }
|
|---|
| 527 | else if(StandardLocalNames::month_from_dateTime == localName)
|
|---|
| 528 | {
|
|---|
| 529 | s = addFunction(StandardLocalNames::month_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 530 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 531 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 532 | }
|
|---|
| 533 | else if(StandardLocalNames::months_from_duration == localName)
|
|---|
| 534 | {
|
|---|
| 535 | s = addFunction(StandardLocalNames::months_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 536 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 537 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 538 | }
|
|---|
| 539 | else if(StandardLocalNames::namespace_uri_for_prefix == localName)
|
|---|
| 540 | {
|
|---|
| 541 | s = addFunction(StandardLocalNames::namespace_uri_for_prefix, 2, 2, CommonSequenceTypes::ZeroOrOneAnyURI);
|
|---|
| 542 | s->appendArgument(argument(np, "prefix"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 543 | s->appendArgument(argument(np, "element"), CommonSequenceTypes::ExactlyOneElement);
|
|---|
| 544 | }
|
|---|
| 545 | else if(StandardLocalNames::namespace_uri_from_QName == localName)
|
|---|
| 546 | {
|
|---|
| 547 | s = addFunction(StandardLocalNames::namespace_uri_from_QName, 1, 1, CommonSequenceTypes::ZeroOrOneAnyURI,
|
|---|
| 548 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 549 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneQName);
|
|---|
| 550 | }
|
|---|
| 551 | else if(StandardLocalNames::nilled == localName)
|
|---|
| 552 | {
|
|---|
| 553 | s = addFunction(StandardLocalNames::nilled, 1, 1, CommonSequenceTypes::ZeroOrOneBoolean);
|
|---|
| 554 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNode);
|
|---|
| 555 | }
|
|---|
| 556 | else if(StandardLocalNames::node_name == localName)
|
|---|
| 557 | {
|
|---|
| 558 | s = addFunction(StandardLocalNames::node_name, 1, 1, CommonSequenceTypes::ZeroOrOneQName);
|
|---|
| 559 | s->appendArgument(argument(np, "theNode"), CommonSequenceTypes::ZeroOrOneNode);
|
|---|
| 560 | }
|
|---|
| 561 | else if(StandardLocalNames::normalize_unicode == localName)
|
|---|
| 562 | {
|
|---|
| 563 | s = addFunction(StandardLocalNames::normalize_unicode, 1, 2, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 564 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 565 | s->appendArgument(argument(np, "normalizationForm"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 566 | }
|
|---|
| 567 | else if(StandardLocalNames::one_or_more == localName)
|
|---|
| 568 | {
|
|---|
| 569 | s = addFunction(StandardLocalNames::one_or_more, 1, 1, CommonSequenceTypes::OneOrMoreItems);
|
|---|
| 570 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 571 | }
|
|---|
| 572 | else if(StandardLocalNames::prefix_from_QName == localName)
|
|---|
| 573 | {
|
|---|
| 574 | s = addFunction(StandardLocalNames::prefix_from_QName, 1, 1, CommonSequenceTypes::ZeroOrOneNCName,
|
|---|
| 575 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 576 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneQName);
|
|---|
| 577 | }
|
|---|
| 578 | else if(StandardLocalNames::remove == localName)
|
|---|
| 579 | {
|
|---|
| 580 | s = addFunction(StandardLocalNames::remove, 2, 2, CommonSequenceTypes::ZeroOrMoreItems,
|
|---|
| 581 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 582 | s->appendArgument(argument(np, "target"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 583 | s->appendArgument(argument(np, "position"), CommonSequenceTypes::ExactlyOneInteger);
|
|---|
| 584 | }
|
|---|
| 585 | else if(StandardLocalNames::replace == localName)
|
|---|
| 586 | {
|
|---|
| 587 | s = addFunction(StandardLocalNames::replace, 3, 4, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 588 | s->appendArgument(argument(np, "input"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 589 | s->appendArgument(argument(np, "pattern"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 590 | s->appendArgument(argument(np, "replacement"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 591 | s->appendArgument(argument(np, "flags"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 592 | }
|
|---|
| 593 | else if(StandardLocalNames::resolve_QName == localName)
|
|---|
| 594 | {
|
|---|
| 595 | s = addFunction(StandardLocalNames::resolve_QName, 2, 2, CommonSequenceTypes::ZeroOrOneQName,
|
|---|
| 596 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 597 | s->appendArgument(argument(np, "qname"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 598 | s->appendArgument(argument(np, "element"), CommonSequenceTypes::ExactlyOneElement);
|
|---|
| 599 | }
|
|---|
| 600 | else if(StandardLocalNames::resolve_uri == localName)
|
|---|
| 601 | {
|
|---|
| 602 | s = addFunction(StandardLocalNames::resolve_uri, 1, 2, CommonSequenceTypes::ZeroOrOneAnyURI,
|
|---|
| 603 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 604 | s->appendArgument(argument(np, "relative"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 605 | s->appendArgument(argument(np, "base"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 606 | }
|
|---|
| 607 | else if(StandardLocalNames::reverse == localName)
|
|---|
| 608 | {
|
|---|
| 609 | s = addFunction(StandardLocalNames::reverse, 1, 1, CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 610 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 611 | }
|
|---|
| 612 | else if(StandardLocalNames::root == localName)
|
|---|
| 613 | {
|
|---|
| 614 | s = addFunction(StandardLocalNames::root, 0, 1, CommonSequenceTypes::ZeroOrOneNode,
|
|---|
| 615 | Expression::EmptynessFollowsChild |
|
|---|
| 616 | Expression::RewriteToEmptyOnEmpty |
|
|---|
| 617 | Expression::UseContextItem);
|
|---|
| 618 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNode);
|
|---|
| 619 | }
|
|---|
| 620 | else if(StandardLocalNames::round_half_to_even == localName)
|
|---|
| 621 | {
|
|---|
| 622 | s = addFunction(StandardLocalNames::round_half_to_even, 1, 2, CommonSequenceTypes::ZeroOrOneNumeric,
|
|---|
| 623 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 624 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneNumeric);
|
|---|
| 625 | s->appendArgument(argument(np, "precision"), CommonSequenceTypes::ExactlyOneInteger);
|
|---|
| 626 | }
|
|---|
| 627 | else if(StandardLocalNames::seconds_from_dateTime == localName)
|
|---|
| 628 | {
|
|---|
| 629 | s = addFunction(StandardLocalNames::seconds_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneDecimal,
|
|---|
| 630 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 631 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 632 | }
|
|---|
| 633 | else if(StandardLocalNames::seconds_from_duration == localName)
|
|---|
| 634 | {
|
|---|
| 635 | s = addFunction(StandardLocalNames::seconds_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneDecimal,
|
|---|
| 636 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 637 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 638 | }
|
|---|
| 639 | else if(StandardLocalNames::seconds_from_time == localName)
|
|---|
| 640 | {
|
|---|
| 641 | s = addFunction(StandardLocalNames::seconds_from_time, 1, 1, CommonSequenceTypes::ZeroOrOneDecimal,
|
|---|
| 642 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 643 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 644 | }
|
|---|
| 645 | else if(StandardLocalNames::static_base_uri == localName)
|
|---|
| 646 | {
|
|---|
| 647 | s = addFunction(StandardLocalNames::static_base_uri, 0, 0, CommonSequenceTypes::ExactlyOneAnyURI, Expression::EmptynessFollowsChild);
|
|---|
| 648 | }
|
|---|
| 649 | else if(StandardLocalNames::string_join == localName)
|
|---|
| 650 | {
|
|---|
| 651 | s = addFunction(StandardLocalNames::string_join, 2, 2, CommonSequenceTypes::ExactlyOneString);
|
|---|
| 652 | s->appendArgument(argument(np, "arg1"), CommonSequenceTypes::ZeroOrMoreStrings);
|
|---|
| 653 | s->appendArgument(argument(np, "separator"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 654 | }
|
|---|
| 655 | else if(StandardLocalNames::generic_string_join == localName)
|
|---|
| 656 | {
|
|---|
| 657 | s = addFunction(StandardLocalNames::generic_string_join, 2, 2, CommonSequenceTypes::ExactlyOneString,
|
|---|
| 658 | Expression::IDIgnorableExpression,
|
|---|
| 659 | Expression::Properties(),
|
|---|
| 660 | StandardNamespaces::InternalXSLT);
|
|---|
| 661 | s->appendArgument(argument(np, "arg1"), CommonSequenceTypes::ZeroOrMoreAtomicTypes);
|
|---|
| 662 | s->appendArgument(argument(np, "separator"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 663 | }
|
|---|
| 664 | else if(StandardLocalNames::string_to_codepoints == localName)
|
|---|
| 665 | {
|
|---|
| 666 | s = addFunction(StandardLocalNames::string_to_codepoints, 1, 1, CommonSequenceTypes::ZeroOrMoreIntegers);
|
|---|
| 667 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 668 | }
|
|---|
| 669 | else if(StandardLocalNames::subsequence == localName)
|
|---|
| 670 | {
|
|---|
| 671 | s = addFunction(StandardLocalNames::subsequence, 2, 3, CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 672 | s->appendArgument(argument(np, "sourceSeq"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 673 | s->appendArgument(argument(np, "startingLoc"), CommonSequenceTypes::ExactlyOneDouble);
|
|---|
| 674 | s->appendArgument(argument(np, "length"), CommonSequenceTypes::ExactlyOneDouble);
|
|---|
| 675 | }
|
|---|
| 676 | else if(StandardLocalNames::timezone_from_date == localName)
|
|---|
| 677 | {
|
|---|
| 678 | s = addFunction(StandardLocalNames::timezone_from_date, 1, 1, CommonSequenceTypes::ZeroOrOneDayTimeDuration,
|
|---|
| 679 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 680 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 681 | }
|
|---|
| 682 | else if(StandardLocalNames::timezone_from_dateTime == localName)
|
|---|
| 683 | {
|
|---|
| 684 | s = addFunction(StandardLocalNames::timezone_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneDayTimeDuration,
|
|---|
| 685 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 686 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 687 | }
|
|---|
| 688 | else if(StandardLocalNames::timezone_from_time == localName)
|
|---|
| 689 | {
|
|---|
| 690 | s = addFunction(StandardLocalNames::timezone_from_time, 1, 1, CommonSequenceTypes::ZeroOrOneDayTimeDuration,
|
|---|
| 691 | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 692 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneTime);
|
|---|
| 693 | }
|
|---|
| 694 | else if(StandardLocalNames::tokenize == localName)
|
|---|
| 695 | {
|
|---|
| 696 | s = addFunction(StandardLocalNames::tokenize, 2, 3, CommonSequenceTypes::ZeroOrMoreStrings);
|
|---|
| 697 | s->appendArgument(argument(np, "input"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 698 | s->appendArgument(argument(np, "pattern"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 699 | s->appendArgument(argument(np, "flags"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 700 | }
|
|---|
| 701 | else if(StandardLocalNames::trace == localName)
|
|---|
| 702 | {
|
|---|
| 703 | s = addFunction(StandardLocalNames::trace, 2, 2, CommonSequenceTypes::ZeroOrMoreItems,
|
|---|
| 704 | Expression::DisableElimination);
|
|---|
| 705 | s->appendArgument(argument(np, "value"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 706 | s->appendArgument(argument(np, "label"), CommonSequenceTypes::ExactlyOneString);
|
|---|
| 707 | }
|
|---|
| 708 | else if(StandardLocalNames::unordered == localName)
|
|---|
| 709 | {
|
|---|
| 710 | s = addFunction(StandardLocalNames::unordered, 1, 1, CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 711 | s->appendArgument(argument(np, "sourceSeq"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 712 | }
|
|---|
| 713 | else if(StandardLocalNames::upper_case == localName)
|
|---|
| 714 | {
|
|---|
| 715 | s = addFunction(StandardLocalNames::upper_case, 1, 1, CommonSequenceTypes::ExactlyOneString,
|
|---|
| 716 | Expression::IDUpperCaseFN);
|
|---|
| 717 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneString);
|
|---|
| 718 | }
|
|---|
| 719 | else if(StandardLocalNames::year_from_date == localName)
|
|---|
| 720 | {
|
|---|
| 721 | s = addFunction(StandardLocalNames::year_from_date, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 722 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 723 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDate);
|
|---|
| 724 | }
|
|---|
| 725 | else if(StandardLocalNames::year_from_dateTime == localName)
|
|---|
| 726 | {
|
|---|
| 727 | s = addFunction(StandardLocalNames::year_from_dateTime, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 728 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 729 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDateTime);
|
|---|
| 730 | }
|
|---|
| 731 | else if(StandardLocalNames::years_from_duration == localName)
|
|---|
| 732 | {
|
|---|
| 733 | s = addFunction(StandardLocalNames::years_from_duration, 1, 1, CommonSequenceTypes::ZeroOrOneInteger,
|
|---|
| 734 | Expression::EmptynessFollowsChild | Expression::RewriteToEmptyOnEmpty);
|
|---|
| 735 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrOneDuration);
|
|---|
| 736 | }
|
|---|
| 737 | else if(StandardLocalNames::zero_or_one == localName)
|
|---|
| 738 | {
|
|---|
| 739 | s = addFunction(StandardLocalNames::zero_or_one, 1, 1, CommonSequenceTypes::ZeroOrOneItem);
|
|---|
| 740 | s->appendArgument(argument(np, "arg"), CommonSequenceTypes::ZeroOrMoreItems);
|
|---|
| 741 | }
|
|---|
| 742 | }
|
|---|
| 743 |
|
|---|
| 744 | return s;
|
|---|
| 745 | }
|
|---|
| 746 |
|
|---|
| 747 |
|
|---|
| 748 | QT_END_NAMESPACE
|
|---|