xslt-processor 3.4.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +817 -0
- package/index.d.ts +817 -4
- package/index.js +4467 -12
- package/index.js.map +1 -1
- package/index.mjs +4431 -0
- package/index.mjs.map +1 -0
- package/package.json +23 -18
- package/umd/xslt-processor.global.js +9 -0
- package/umd/xslt-processor.global.js.map +1 -0
- package/constants.d.ts +0 -12
- package/constants.js +0 -17
- package/constants.js.map +0 -1
- package/dom/functions.d.ts +0 -14
- package/dom/functions.js +0 -57
- package/dom/functions.js.map +0 -1
- package/dom/index.d.ts +0 -7
- package/dom/index.js +0 -24
- package/dom/index.js.map +0 -1
- package/dom/util.d.ts +0 -7
- package/dom/util.js +0 -43
- package/dom/util.js.map +0 -1
- package/dom/xbrowser-node.d.ts +0 -9
- package/dom/xbrowser-node.js +0 -32
- package/dom/xbrowser-node.js.map +0 -1
- package/dom/xdocument.d.ts +0 -16
- package/dom/xdocument.js +0 -74
- package/dom/xdocument.js.map +0 -1
- package/dom/xml-functions.d.ts +0 -73
- package/dom/xml-functions.js +0 -402
- package/dom/xml-functions.js.map +0 -1
- package/dom/xml-output-options.d.ts +0 -6
- package/dom/xml-output-options.js +0 -3
- package/dom/xml-output-options.js.map +0 -1
- package/dom/xml-parser.d.ts +0 -47
- package/dom/xml-parser.js +0 -308
- package/dom/xml-parser.js.map +0 -1
- package/dom/xmltoken.d.ts +0 -12
- package/dom/xmltoken.js +0 -102
- package/dom/xmltoken.js.map +0 -1
- package/dom/xnode.d.ts +0 -73
- package/dom/xnode.js +0 -451
- package/dom/xnode.js.map +0 -1
- package/test-without-jest.d.ts +0 -1
- package/test-without-jest.js +0 -63
- package/test-without-jest.js.map +0 -1
- package/umd/constants.d.ts +0 -12
- package/umd/dom/functions.d.ts +0 -14
- package/umd/dom/index.d.ts +0 -7
- package/umd/dom/util.d.ts +0 -7
- package/umd/dom/xbrowser-node.d.ts +0 -9
- package/umd/dom/xdocument.d.ts +0 -16
- package/umd/dom/xml-functions.d.ts +0 -73
- package/umd/dom/xml-output-options.d.ts +0 -6
- package/umd/dom/xml-parser.d.ts +0 -47
- package/umd/dom/xmltoken.d.ts +0 -12
- package/umd/dom/xnode.d.ts +0 -73
- package/umd/index.d.ts +0 -4
- package/umd/test-without-jest.d.ts +0 -1
- package/umd/xpath/common-function.d.ts +0 -8
- package/umd/xpath/expr-context.d.ts +0 -116
- package/umd/xpath/expressions/binary-expr.d.ts +0 -11
- package/umd/xpath/expressions/expression.d.ts +0 -4
- package/umd/xpath/expressions/filter-expr.d.ts +0 -9
- package/umd/xpath/expressions/function-call-expr.d.ts +0 -12
- package/umd/xpath/expressions/index.d.ts +0 -13
- package/umd/xpath/expressions/literal-expr.d.ts +0 -7
- package/umd/xpath/expressions/location-expr.d.ts +0 -15
- package/umd/xpath/expressions/number-expr.d.ts +0 -7
- package/umd/xpath/expressions/path-expr.d.ts +0 -9
- package/umd/xpath/expressions/predicate-expr.d.ts +0 -8
- package/umd/xpath/expressions/step-expr.d.ts +0 -25
- package/umd/xpath/expressions/token-expr.d.ts +0 -7
- package/umd/xpath/expressions/unary-minus-expr.d.ts +0 -8
- package/umd/xpath/expressions/union-expr.d.ts +0 -9
- package/umd/xpath/expressions/variable-expr.d.ts +0 -7
- package/umd/xpath/functions/index.d.ts +0 -4
- package/umd/xpath/functions/internal-functions.d.ts +0 -2
- package/umd/xpath/functions/non-standard.d.ts +0 -12
- package/umd/xpath/functions/standard-20.d.ts +0 -5
- package/umd/xpath/functions/standard.d.ts +0 -40
- package/umd/xpath/functions/xslt-specific.d.ts +0 -3
- package/umd/xpath/grammar-rule-candidate.d.ts +0 -8
- package/umd/xpath/index.d.ts +0 -3
- package/umd/xpath/match-resolver.d.ts +0 -55
- package/umd/xpath/node-tests/index.d.ts +0 -8
- package/umd/xpath/node-tests/node-test-any.d.ts +0 -6
- package/umd/xpath/node-tests/node-test-comment.d.ts +0 -6
- package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
- package/umd/xpath/node-tests/node-test-name.d.ts +0 -10
- package/umd/xpath/node-tests/node-test-nc.d.ts +0 -9
- package/umd/xpath/node-tests/node-test-pi.d.ts +0 -8
- package/umd/xpath/node-tests/node-test-text.d.ts +0 -6
- package/umd/xpath/node-tests/node-test.d.ts +0 -5
- package/umd/xpath/tokens.d.ts +0 -62
- package/umd/xpath/values/boolean-value.d.ts +0 -11
- package/umd/xpath/values/index.d.ts +0 -5
- package/umd/xpath/values/node-set-value.d.ts +0 -11
- package/umd/xpath/values/node-value.d.ts +0 -7
- package/umd/xpath/values/number-value.d.ts +0 -11
- package/umd/xpath/values/string-value.d.ts +0 -11
- package/umd/xpath/xpath-grammar-rules.d.ts +0 -68
- package/umd/xpath/xpath-token-rule.d.ts +0 -7
- package/umd/xpath/xpath.d.ts +0 -174
- package/umd/xpathdebug.d.ts +0 -2
- package/umd/xslt/index.d.ts +0 -3
- package/umd/xslt/xslt-decimal-format-settings.d.ts +0 -28
- package/umd/xslt/xslt-options.d.ts +0 -7
- package/umd/xslt/xslt-parameter.d.ts +0 -5
- package/umd/xslt/xslt.d.ts +0 -275
- package/umd/xslt-processor.js +0 -2
- package/umd/xslt-processor.js.map +0 -1
- package/xpath/common-function.d.ts +0 -8
- package/xpath/common-function.js +0 -32
- package/xpath/common-function.js.map +0 -1
- package/xpath/expr-context.d.ts +0 -116
- package/xpath/expr-context.js +0 -191
- package/xpath/expr-context.js.map +0 -1
- package/xpath/expressions/binary-expr.d.ts +0 -11
- package/xpath/expressions/binary-expr.js +0 -166
- package/xpath/expressions/binary-expr.js.map +0 -1
- package/xpath/expressions/expression.d.ts +0 -4
- package/xpath/expressions/expression.js +0 -10
- package/xpath/expressions/expression.js.map +0 -1
- package/xpath/expressions/filter-expr.d.ts +0 -9
- package/xpath/expressions/filter-expr.js +0 -53
- package/xpath/expressions/filter-expr.js.map +0 -1
- package/xpath/expressions/function-call-expr.d.ts +0 -12
- package/xpath/expressions/function-call-expr.js +0 -97
- package/xpath/expressions/function-call-expr.js.map +0 -1
- package/xpath/expressions/index.d.ts +0 -13
- package/xpath/expressions/index.js +0 -30
- package/xpath/expressions/index.js.map +0 -1
- package/xpath/expressions/literal-expr.d.ts +0 -7
- package/xpath/expressions/literal-expr.js +0 -34
- package/xpath/expressions/literal-expr.js.map +0 -1
- package/xpath/expressions/location-expr.d.ts +0 -15
- package/xpath/expressions/location-expr.js +0 -99
- package/xpath/expressions/location-expr.js.map +0 -1
- package/xpath/expressions/number-expr.d.ts +0 -7
- package/xpath/expressions/number-expr.js +0 -34
- package/xpath/expressions/number-expr.js.map +0 -1
- package/xpath/expressions/path-expr.d.ts +0 -9
- package/xpath/expressions/path-expr.js +0 -52
- package/xpath/expressions/path-expr.js.map +0 -1
- package/xpath/expressions/predicate-expr.d.ts +0 -8
- package/xpath/expressions/predicate-expr.js +0 -41
- package/xpath/expressions/predicate-expr.js.map +0 -1
- package/xpath/expressions/step-expr.d.ts +0 -25
- package/xpath/expressions/step-expr.js +0 -281
- package/xpath/expressions/step-expr.js.map +0 -1
- package/xpath/expressions/token-expr.d.ts +0 -7
- package/xpath/expressions/token-expr.js +0 -34
- package/xpath/expressions/token-expr.js.map +0 -1
- package/xpath/expressions/unary-minus-expr.d.ts +0 -8
- package/xpath/expressions/unary-minus-expr.js +0 -34
- package/xpath/expressions/unary-minus-expr.js.map +0 -1
- package/xpath/expressions/union-expr.d.ts +0 -9
- package/xpath/expressions/union-expr.js +0 -51
- package/xpath/expressions/union-expr.js.map +0 -1
- package/xpath/expressions/variable-expr.d.ts +0 -7
- package/xpath/expressions/variable-expr.js +0 -33
- package/xpath/expressions/variable-expr.js.map +0 -1
- package/xpath/functions/index.d.ts +0 -4
- package/xpath/functions/index.js +0 -21
- package/xpath/functions/index.js.map +0 -1
- package/xpath/functions/internal-functions.d.ts +0 -2
- package/xpath/functions/internal-functions.js +0 -22
- package/xpath/functions/internal-functions.js.map +0 -1
- package/xpath/functions/non-standard.d.ts +0 -12
- package/xpath/functions/non-standard.js +0 -45
- package/xpath/functions/non-standard.js.map +0 -1
- package/xpath/functions/standard-20.d.ts +0 -5
- package/xpath/functions/standard-20.js +0 -26
- package/xpath/functions/standard-20.js.map +0 -1
- package/xpath/functions/standard.d.ts +0 -40
- package/xpath/functions/standard.js +0 -442
- package/xpath/functions/standard.js.map +0 -1
- package/xpath/functions/xslt-specific.d.ts +0 -3
- package/xpath/functions/xslt-specific.js +0 -14
- package/xpath/functions/xslt-specific.js.map +0 -1
- package/xpath/grammar-rule-candidate.d.ts +0 -8
- package/xpath/grammar-rule-candidate.js +0 -3
- package/xpath/grammar-rule-candidate.js.map +0 -1
- package/xpath/index.d.ts +0 -3
- package/xpath/index.js +0 -20
- package/xpath/index.js.map +0 -1
- package/xpath/match-resolver.d.ts +0 -55
- package/xpath/match-resolver.js +0 -137
- package/xpath/match-resolver.js.map +0 -1
- package/xpath/node-tests/index.d.ts +0 -8
- package/xpath/node-tests/index.js +0 -18
- package/xpath/node-tests/index.js.map +0 -1
- package/xpath/node-tests/node-test-any.d.ts +0 -6
- package/xpath/node-tests/node-test-any.js +0 -15
- package/xpath/node-tests/node-test-any.js.map +0 -1
- package/xpath/node-tests/node-test-comment.d.ts +0 -6
- package/xpath/node-tests/node-test-comment.js +0 -15
- package/xpath/node-tests/node-test-comment.js.map +0 -1
- package/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
- package/xpath/node-tests/node-test-element-or-attribute.js +0 -16
- package/xpath/node-tests/node-test-element-or-attribute.js.map +0 -1
- package/xpath/node-tests/node-test-name.d.ts +0 -10
- package/xpath/node-tests/node-test-name.js +0 -39
- package/xpath/node-tests/node-test-name.js.map +0 -1
- package/xpath/node-tests/node-test-nc.d.ts +0 -9
- package/xpath/node-tests/node-test-nc.js +0 -17
- package/xpath/node-tests/node-test-nc.js.map +0 -1
- package/xpath/node-tests/node-test-pi.d.ts +0 -8
- package/xpath/node-tests/node-test-pi.js +0 -17
- package/xpath/node-tests/node-test-pi.js.map +0 -1
- package/xpath/node-tests/node-test-text.d.ts +0 -6
- package/xpath/node-tests/node-test-text.js +0 -15
- package/xpath/node-tests/node-test-text.js.map +0 -1
- package/xpath/node-tests/node-test.d.ts +0 -5
- package/xpath/node-tests/node-test.js +0 -3
- package/xpath/node-tests/node-test.js.map +0 -1
- package/xpath/tokens.d.ts +0 -62
- package/xpath/tokens.js +0 -301
- package/xpath/tokens.js.map +0 -1
- package/xpath/values/boolean-value.d.ts +0 -11
- package/xpath/values/boolean-value.js +0 -24
- package/xpath/values/boolean-value.js.map +0 -1
- package/xpath/values/index.d.ts +0 -5
- package/xpath/values/index.js +0 -47
- package/xpath/values/index.js.map +0 -1
- package/xpath/values/node-set-value.d.ts +0 -11
- package/xpath/values/node-set-value.js +0 -28
- package/xpath/values/node-set-value.js.map +0 -1
- package/xpath/values/node-value.d.ts +0 -7
- package/xpath/values/node-value.js +0 -3
- package/xpath/values/node-value.js.map +0 -1
- package/xpath/values/number-value.d.ts +0 -11
- package/xpath/values/number-value.js +0 -24
- package/xpath/values/number-value.js.map +0 -1
- package/xpath/values/string-value.d.ts +0 -11
- package/xpath/values/string-value.js +0 -24
- package/xpath/values/string-value.js.map +0 -1
- package/xpath/xpath-grammar-rules.d.ts +0 -68
- package/xpath/xpath-grammar-rules.js +0 -75
- package/xpath/xpath-grammar-rules.js.map +0 -1
- package/xpath/xpath-token-rule.d.ts +0 -7
- package/xpath/xpath-token-rule.js +0 -3
- package/xpath/xpath-token-rule.js.map +0 -1
- package/xpath/xpath.d.ts +0 -174
- package/xpath/xpath.js +0 -912
- package/xpath/xpath.js.map +0 -1
- package/xpathdebug.d.ts +0 -2
- package/xpathdebug.js +0 -188
- package/xpathdebug.js.map +0 -1
- package/xslt/index.d.ts +0 -3
- package/xslt/index.js +0 -20
- package/xslt/index.js.map +0 -1
- package/xslt/xslt-decimal-format-settings.d.ts +0 -28
- package/xslt/xslt-decimal-format-settings.js +0 -3
- package/xslt/xslt-decimal-format-settings.js.map +0 -1
- package/xslt/xslt-options.d.ts +0 -7
- package/xslt/xslt-options.js +0 -3
- package/xslt/xslt-options.js.map +0 -1
- package/xslt/xslt-parameter.d.ts +0 -5
- package/xslt/xslt-parameter.js +0 -3
- package/xslt/xslt-parameter.js.map +0 -1
- package/xslt/xslt.d.ts +0 -275
- package/xslt/xslt.js +0 -1329
- package/xslt/xslt.js.map +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ExprContext } from '../expr-context';
|
|
2
|
-
import { Expression } from './expression';
|
|
3
|
-
export declare class FunctionCallExpr extends Expression {
|
|
4
|
-
name: any;
|
|
5
|
-
args: any[];
|
|
6
|
-
xPathFunctions: {
|
|
7
|
-
[key: string]: Function;
|
|
8
|
-
};
|
|
9
|
-
constructor(name: any);
|
|
10
|
-
appendArg(arg: any): void;
|
|
11
|
-
evaluate(context: ExprContext): any;
|
|
12
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.FunctionCallExpr = void 0;
|
|
19
|
-
var functions_1 = require("../functions");
|
|
20
|
-
var non_standard_1 = require("../functions/non-standard");
|
|
21
|
-
var standard_20_1 = require("../functions/standard-20");
|
|
22
|
-
var boolean_value_1 = require("../values/boolean-value");
|
|
23
|
-
var expression_1 = require("./expression");
|
|
24
|
-
var FunctionCallExpr = /** @class */ (function (_super) {
|
|
25
|
-
__extends(FunctionCallExpr, _super);
|
|
26
|
-
function FunctionCallExpr(name) {
|
|
27
|
-
var _this = _super.call(this) || this;
|
|
28
|
-
_this.xPathFunctions = {
|
|
29
|
-
boolean: functions_1.boolean,
|
|
30
|
-
ceiling: functions_1.ceiling,
|
|
31
|
-
concat: functions_1.concat,
|
|
32
|
-
contains: functions_1.contains,
|
|
33
|
-
count: functions_1.count,
|
|
34
|
-
current: functions_1.current,
|
|
35
|
-
'ends-with': functions_1.endsWith,
|
|
36
|
-
false: functions_1._false,
|
|
37
|
-
'format-number': functions_1.formatNumber,
|
|
38
|
-
floor: functions_1.floor,
|
|
39
|
-
'generate-id': functions_1.generateId,
|
|
40
|
-
id: functions_1.id,
|
|
41
|
-
key: functions_1.key,
|
|
42
|
-
lang: functions_1.lang,
|
|
43
|
-
last: functions_1.last,
|
|
44
|
-
'local-name': functions_1.localName,
|
|
45
|
-
'lower-case': standard_20_1.lowerCase,
|
|
46
|
-
'replace': standard_20_1._replace,
|
|
47
|
-
matches: functions_1.matches,
|
|
48
|
-
name: functions_1._name,
|
|
49
|
-
'namespace-uri': functions_1.namespaceUri,
|
|
50
|
-
'normalize-space': functions_1.normalizeSpace,
|
|
51
|
-
not: functions_1.not,
|
|
52
|
-
number: functions_1.number,
|
|
53
|
-
position: functions_1.position,
|
|
54
|
-
round: functions_1.round,
|
|
55
|
-
'starts-with': functions_1.startsWith,
|
|
56
|
-
string: functions_1._string,
|
|
57
|
-
'xml-to-json': functions_1.xmlToJson,
|
|
58
|
-
substring: functions_1.substring,
|
|
59
|
-
'substring-before': functions_1.substringBefore,
|
|
60
|
-
'substring-after': functions_1.substringAfter,
|
|
61
|
-
sum: functions_1.sum,
|
|
62
|
-
'string-length': functions_1.stringLength,
|
|
63
|
-
translate: functions_1.translate,
|
|
64
|
-
true: functions_1._true,
|
|
65
|
-
'upper-case': standard_20_1.upperCase,
|
|
66
|
-
// TODO(mesch): The following functions are custom. There is a
|
|
67
|
-
// standard that defines how to add functions, which should be
|
|
68
|
-
// applied here.
|
|
69
|
-
'ext-join': non_standard_1.extJoin,
|
|
70
|
-
// ext-if() evaluates and returns its second argument, if the
|
|
71
|
-
// boolean value of its first argument is true, otherwise it
|
|
72
|
-
// evaluates and returns its third argument.
|
|
73
|
-
'ext-if': non_standard_1.extIf,
|
|
74
|
-
// ext-cardinal() evaluates its single argument as a number, and
|
|
75
|
-
// returns the current node that many times. It can be used in the
|
|
76
|
-
// select attribute to iterate over an integer range.
|
|
77
|
-
'ext-cardinal': non_standard_1.extCardinal
|
|
78
|
-
};
|
|
79
|
-
_this.name = name;
|
|
80
|
-
_this.args = [];
|
|
81
|
-
return _this;
|
|
82
|
-
}
|
|
83
|
-
FunctionCallExpr.prototype.appendArg = function (arg) {
|
|
84
|
-
this.args.push(arg);
|
|
85
|
-
};
|
|
86
|
-
FunctionCallExpr.prototype.evaluate = function (context) {
|
|
87
|
-
var functionName = "".concat(this.name.value);
|
|
88
|
-
var resolvedFunction = this.xPathFunctions[functionName];
|
|
89
|
-
if (resolvedFunction) {
|
|
90
|
-
return resolvedFunction.call(this, context);
|
|
91
|
-
}
|
|
92
|
-
return new boolean_value_1.BooleanValue(false);
|
|
93
|
-
};
|
|
94
|
-
return FunctionCallExpr;
|
|
95
|
-
}(expression_1.Expression));
|
|
96
|
-
exports.FunctionCallExpr = FunctionCallExpr;
|
|
97
|
-
//# sourceMappingURL=function-call-expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-call-expr.js","sourceRoot":"","sources":["../../../src/xpath/expressions/function-call-expr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,0CAm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IAAI,CAAC;QACjB,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;;IACnB,CAAC;IAED,oCAAS,GAAT,UAAU,GAAQ;QACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,mCAAQ,GAAR,UAAS,OAAoB;QACzB,IAAM,YAAY,GAAG,UAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QAC1C,IAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAC3D,IAAI,gBAAgB,EAAE,CAAC;YACnB,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACL,uBAAC;AAAD,CAAC,AAjFD,CAAsC,uBAAU,GAiF/C;AAjFY,4CAAgB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './binary-expr';
|
|
2
|
-
export * from './filter-expr';
|
|
3
|
-
export * from './function-call-expr';
|
|
4
|
-
export * from './literal-expr';
|
|
5
|
-
export * from './location-expr';
|
|
6
|
-
export * from './number-expr';
|
|
7
|
-
export * from './path-expr';
|
|
8
|
-
export * from './predicate-expr';
|
|
9
|
-
export * from './step-expr';
|
|
10
|
-
export * from './token-expr';
|
|
11
|
-
export * from './unary-minus-expr';
|
|
12
|
-
export * from './union-expr';
|
|
13
|
-
export * from './variable-expr';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./binary-expr"), exports);
|
|
18
|
-
__exportStar(require("./filter-expr"), exports);
|
|
19
|
-
__exportStar(require("./function-call-expr"), exports);
|
|
20
|
-
__exportStar(require("./literal-expr"), exports);
|
|
21
|
-
__exportStar(require("./location-expr"), exports);
|
|
22
|
-
__exportStar(require("./number-expr"), exports);
|
|
23
|
-
__exportStar(require("./path-expr"), exports);
|
|
24
|
-
__exportStar(require("./predicate-expr"), exports);
|
|
25
|
-
__exportStar(require("./step-expr"), exports);
|
|
26
|
-
__exportStar(require("./token-expr"), exports);
|
|
27
|
-
__exportStar(require("./unary-minus-expr"), exports);
|
|
28
|
-
__exportStar(require("./union-expr"), exports);
|
|
29
|
-
__exportStar(require("./variable-expr"), exports);
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/xpath/expressions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B;AAC9B,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,gDAA8B;AAC9B,8CAA4B;AAC5B,mDAAiC;AACjC,8CAA4B;AAC5B,+CAA6B;AAC7B,qDAAmC;AACnC,+CAA6B;AAC7B,kDAAgC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.LiteralExpr = void 0;
|
|
19
|
-
var string_value_1 = require("../values/string-value");
|
|
20
|
-
var expression_1 = require("./expression");
|
|
21
|
-
var LiteralExpr = /** @class */ (function (_super) {
|
|
22
|
-
__extends(LiteralExpr, _super);
|
|
23
|
-
function LiteralExpr(value) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.value = value;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
LiteralExpr.prototype.evaluate = function () {
|
|
29
|
-
return new string_value_1.StringValue(this.value);
|
|
30
|
-
};
|
|
31
|
-
return LiteralExpr;
|
|
32
|
-
}(expression_1.Expression));
|
|
33
|
-
exports.LiteralExpr = LiteralExpr;
|
|
34
|
-
//# sourceMappingURL=literal-expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"literal-expr.js","sourceRoot":"","sources":["../../../src/xpath/expressions/literal-expr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,2CAA0C;AAE1C;IAAiC,+BAAU;IAGvC,qBAAY,KAAU;QAClB,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;IACvB,CAAC;IAED,8BAAQ,GAAR;QACI,OAAO,IAAI,0BAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACL,kBAAC;AAAD,CAAC,AAXD,CAAiC,uBAAU,GAW1C;AAXY,kCAAW"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ExprContext } from "../expr-context";
|
|
2
|
-
import { NodeSetValue } from "../values/node-set-value";
|
|
3
|
-
import { Expression } from "./expression";
|
|
4
|
-
import { XPath } from "../xpath";
|
|
5
|
-
import { StepExpr } from "./step-expr";
|
|
6
|
-
export declare class LocationExpr extends Expression {
|
|
7
|
-
absolute: boolean;
|
|
8
|
-
steps: StepExpr[];
|
|
9
|
-
xPath: XPath;
|
|
10
|
-
constructor(xPath: XPath);
|
|
11
|
-
appendStep(s: StepExpr): void;
|
|
12
|
-
prependStep(s: StepExpr): void;
|
|
13
|
-
private _combineSteps;
|
|
14
|
-
evaluate(context: ExprContext): NodeSetValue;
|
|
15
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.LocationExpr = void 0;
|
|
19
|
-
var node_set_value_1 = require("../values/node-set-value");
|
|
20
|
-
var node_test_any_1 = require("../node-tests/node-test-any");
|
|
21
|
-
var tokens_1 = require("../tokens");
|
|
22
|
-
var expression_1 = require("./expression");
|
|
23
|
-
var LocationExpr = /** @class */ (function (_super) {
|
|
24
|
-
__extends(LocationExpr, _super);
|
|
25
|
-
function LocationExpr(xPath) {
|
|
26
|
-
var _this = _super.call(this) || this;
|
|
27
|
-
_this.absolute = false;
|
|
28
|
-
_this.steps = [];
|
|
29
|
-
_this.xPath = xPath;
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
LocationExpr.prototype.appendStep = function (s) {
|
|
33
|
-
var combinedStep = this._combineSteps(this.steps[this.steps.length - 1], s);
|
|
34
|
-
if (combinedStep) {
|
|
35
|
-
this.steps[this.steps.length - 1] = combinedStep;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.steps.push(s);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
LocationExpr.prototype.prependStep = function (s) {
|
|
42
|
-
var combinedStep = this._combineSteps(s, this.steps[0]);
|
|
43
|
-
if (combinedStep) {
|
|
44
|
-
this.steps[0] = combinedStep;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
this.steps.unshift(s);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
// DGF try to combine two steps into one step (perf enhancement)
|
|
51
|
-
LocationExpr.prototype._combineSteps = function (prevStep, nextStep) {
|
|
52
|
-
if (!prevStep)
|
|
53
|
-
return null;
|
|
54
|
-
if (!nextStep)
|
|
55
|
-
return null;
|
|
56
|
-
var hasPredicates = prevStep.predicates && prevStep.predicates.length > 0;
|
|
57
|
-
if (prevStep.nodeTest instanceof node_test_any_1.NodeTestAny && !hasPredicates) {
|
|
58
|
-
// maybe suitable to be combined
|
|
59
|
-
if (prevStep.axis == tokens_1.xPathAxis.DESCENDANT_OR_SELF) {
|
|
60
|
-
if (nextStep.axis == tokens_1.xPathAxis.CHILD) {
|
|
61
|
-
// HBC - commenting out, because this is not a valid reduction
|
|
62
|
-
//nextStep.axis = xpathAxis.DESCENDANT;
|
|
63
|
-
//return nextStep;
|
|
64
|
-
}
|
|
65
|
-
else if (nextStep.axis == tokens_1.xPathAxis.SELF) {
|
|
66
|
-
nextStep.axis = tokens_1.xPathAxis.DESCENDANT_OR_SELF;
|
|
67
|
-
return nextStep;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (prevStep.axis == tokens_1.xPathAxis.DESCENDANT) {
|
|
71
|
-
if (nextStep.axis == tokens_1.xPathAxis.SELF) {
|
|
72
|
-
nextStep.axis = tokens_1.xPathAxis.DESCENDANT;
|
|
73
|
-
return nextStep;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return null;
|
|
78
|
-
};
|
|
79
|
-
LocationExpr.prototype.evaluate = function (context) {
|
|
80
|
-
var start;
|
|
81
|
-
if (this.absolute) {
|
|
82
|
-
start = context.root;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
start = context.nodeList[context.position];
|
|
86
|
-
// TODO: `<xsl:template>` with relative path, starting on root node,
|
|
87
|
-
// conflicts with `<xsl:template match="/">`, for some reason considered as relative.
|
|
88
|
-
/* if (start.nodeName === '#document' && this.steps[0].axis === 'self-and-siblings') {
|
|
89
|
-
start = start.childNodes[0];
|
|
90
|
-
} */
|
|
91
|
-
}
|
|
92
|
-
var nodes = [];
|
|
93
|
-
this.xPath.xPathStep(nodes, this.steps, 0, start, context);
|
|
94
|
-
return new node_set_value_1.NodeSetValue(nodes);
|
|
95
|
-
};
|
|
96
|
-
return LocationExpr;
|
|
97
|
-
}(expression_1.Expression));
|
|
98
|
-
exports.LocationExpr = LocationExpr;
|
|
99
|
-
//# sourceMappingURL=location-expr.js.map
|
|
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AC;QAED,IAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,6BAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACL,mBAAC;AAAD,CAAC,AAzED,CAAkC,uBAAU,GAyE3C;AAzEY,oCAAY"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.NumberExpr = void 0;
|
|
19
|
-
var number_value_1 = require("../values/number-value");
|
|
20
|
-
var expression_1 = require("./expression");
|
|
21
|
-
var NumberExpr = /** @class */ (function (_super) {
|
|
22
|
-
__extends(NumberExpr, _super);
|
|
23
|
-
function NumberExpr(value) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.value = value;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
NumberExpr.prototype.evaluate = function () {
|
|
29
|
-
return new number_value_1.NumberValue(this.value);
|
|
30
|
-
};
|
|
31
|
-
return NumberExpr;
|
|
32
|
-
}(expression_1.Expression));
|
|
33
|
-
exports.NumberExpr = NumberExpr;
|
|
34
|
-
//# sourceMappingURL=number-expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-expr.js","sourceRoot":"","sources":["../../../src/xpath/expressions/number-expr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,2CAA0C;AAE1C;IAAgC,8BAAU;IAGtC,oBAAY,KAAU;QAClB,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;IACvB,CAAC;IAED,6BAAQ,GAAR;QACI,OAAO,IAAI,0BAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IACL,iBAAC;AAAD,CAAC,AAXD,CAAgC,uBAAU,GAWzC;AAXY,gCAAU"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExprContext } from "..";
|
|
2
|
-
import { NodeSetValue } from "../values/node-set-value";
|
|
3
|
-
import { Expression } from "./expression";
|
|
4
|
-
export declare class PathExpr extends Expression {
|
|
5
|
-
filter: any;
|
|
6
|
-
rel: any;
|
|
7
|
-
constructor(filter: any, rel: any);
|
|
8
|
-
evaluate(ctx: ExprContext): NodeSetValue;
|
|
9
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PathExpr = void 0;
|
|
19
|
-
var node_set_value_1 = require("../values/node-set-value");
|
|
20
|
-
var expression_1 = require("./expression");
|
|
21
|
-
var PathExpr = /** @class */ (function (_super) {
|
|
22
|
-
__extends(PathExpr, _super);
|
|
23
|
-
function PathExpr(filter, rel) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.filter = filter;
|
|
26
|
-
_this.rel = rel;
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
PathExpr.prototype.evaluate = function (ctx) {
|
|
30
|
-
var nodes = this.filter.evaluate(ctx).nodeSetValue();
|
|
31
|
-
var nodes1 = [];
|
|
32
|
-
if (ctx.returnOnFirstMatch) {
|
|
33
|
-
for (var i = 0; i < nodes.length; ++i) {
|
|
34
|
-
nodes1 = this.rel.evaluate(ctx.clone(nodes, undefined, i)).nodeSetValue();
|
|
35
|
-
if (nodes1.length > 0) {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return new node_set_value_1.NodeSetValue(nodes1);
|
|
40
|
-
}
|
|
41
|
-
for (var i = 0; i < nodes.length; ++i) {
|
|
42
|
-
var nodes0 = this.rel.evaluate(ctx.clone(nodes, undefined, i)).nodeSetValue();
|
|
43
|
-
for (var ii = 0; ii < nodes0.length; ++ii) {
|
|
44
|
-
nodes1.push(nodes0[ii]);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return new node_set_value_1.NodeSetValue(nodes1);
|
|
48
|
-
};
|
|
49
|
-
return PathExpr;
|
|
50
|
-
}(expression_1.Expression));
|
|
51
|
-
exports.PathExpr = PathExpr;
|
|
52
|
-
//# sourceMappingURL=path-expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-expr.js","sourceRoot":"","sources":["../../../src/xpath/expressions/path-expr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,2DAAwD;AACxD,2CAA0C;AAE1C;IAA8B,4BAAU;IAIpC,kBAAY,MAAW,EAAE,GAAQ;QAC7B,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,GAAG,GAAG,GAAG,CAAC;;IACnB,CAAC;IAED,2BAAQ,GAAR,UAAS,GAAgB;QACrB,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC;QACvD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,CAAC,kBAAkB,EAAE,CAAC;YACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;gBACpC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;gBAC1E,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpB,MAAM;gBACV,CAAC;YACL,CAAC;YACD,OAAO,IAAI,6BAAY,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACpC,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;YAChF,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;gBACxC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC;QACD,OAAO,IAAI,6BAAY,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IACL,eAAC;AAAD,CAAC,AA/BD,CAA8B,uBAAU,GA+BvC;AA/BY,4BAAQ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExprContext } from "..";
|
|
2
|
-
import { BooleanValue } from "../values/boolean-value";
|
|
3
|
-
import { Expression } from "./expression";
|
|
4
|
-
export declare class PredicateExpr extends Expression {
|
|
5
|
-
expression: Expression;
|
|
6
|
-
constructor(expression: Expression);
|
|
7
|
-
evaluate(context: ExprContext): BooleanValue;
|
|
8
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PredicateExpr = void 0;
|
|
19
|
-
var boolean_value_1 = require("../values/boolean-value");
|
|
20
|
-
var expression_1 = require("./expression");
|
|
21
|
-
var PredicateExpr = /** @class */ (function (_super) {
|
|
22
|
-
__extends(PredicateExpr, _super);
|
|
23
|
-
function PredicateExpr(expression) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.expression = expression;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
PredicateExpr.prototype.evaluate = function (context) {
|
|
29
|
-
var value = this.expression.evaluate(context);
|
|
30
|
-
if (value.type == 'number') {
|
|
31
|
-
// NOTE(mesch): Internally, position is represented starting with
|
|
32
|
-
// 0, however in XPath position starts with 1. See functions
|
|
33
|
-
// position() and last().
|
|
34
|
-
return new boolean_value_1.BooleanValue(context.position == value.numberValue() - 1);
|
|
35
|
-
}
|
|
36
|
-
return new boolean_value_1.BooleanValue(value.booleanValue());
|
|
37
|
-
};
|
|
38
|
-
return PredicateExpr;
|
|
39
|
-
}(expression_1.Expression));
|
|
40
|
-
exports.PredicateExpr = PredicateExpr;
|
|
41
|
-
//# sourceMappingURL=predicate-expr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"predicate-expr.js","sourceRoot":"","sources":["../../../src/xpath/expressions/predicate-expr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,yDAAuD;AACvD,2CAA0C;AAE1C;IAAmC,iCAAU;IAGzC,uBAAY,UAAsB;QAC9B,YAAA,MAAK,WAAE,SAAC;QACR,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;;IACjC,CAAC;IAED,gCAAQ,GAAR,UAAS,OAAoB;QACzB,IAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,KAAK,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;YACzB,iEAAiE;YACjE,4DAA4D;YAC5D,yBAAyB;YACzB,OAAO,IAAI,4BAAY,CAAC,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;QACzE,CAAC;QAED,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,CAAC;IACL,oBAAC;AAAD,CAAC,AAnBD,CAAmC,uBAAU,GAmB5C;AAnBY,sCAAa"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ExprContext } from '../expr-context';
|
|
2
|
-
import { NodeSetValue } from '../values/node-set-value';
|
|
3
|
-
import { Expression } from './expression';
|
|
4
|
-
import { XPath } from '../xpath';
|
|
5
|
-
import { PredicateExpr } from './predicate-expr';
|
|
6
|
-
export declare class StepExpr extends Expression {
|
|
7
|
-
axis: any;
|
|
8
|
-
nodeTest: any;
|
|
9
|
-
predicate: any;
|
|
10
|
-
hasPositionalPredicate: any;
|
|
11
|
-
xPath: XPath;
|
|
12
|
-
constructor(axis: any, nodeTest: any, xPath: XPath, opt_predicate?: any);
|
|
13
|
-
/**
|
|
14
|
-
* Determines whether a predicate expression contains a "positional selector".
|
|
15
|
-
* A positional selector filters nodes from the nodeList input based on their
|
|
16
|
-
* position within that list. When such selectors are encountered, the
|
|
17
|
-
* evaluation of the predicate cannot be depth-first, because the positional
|
|
18
|
-
* selector may be based on the result of evaluating predicates that precede
|
|
19
|
-
* it.
|
|
20
|
-
*/
|
|
21
|
-
private predicateExprHasPositionalSelector;
|
|
22
|
-
private exprReturnsNumberValue;
|
|
23
|
-
appendPredicate(predicateExpression: PredicateExpr): void;
|
|
24
|
-
evaluate(context: ExprContext): NodeSetValue;
|
|
25
|
-
}
|