xslt-processor 3.0.0 → 3.0.2
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/README.md +2 -2
- package/constants.d.ts +12 -12
- package/constants.js +16 -16
- package/dom/functions.d.ts +14 -14
- package/dom/functions.js +56 -57
- package/dom/functions.js.map +1 -1
- package/dom/index.d.ts +6 -6
- package/dom/index.js +22 -22
- package/dom/util.d.ts +7 -7
- package/dom/util.js +42 -43
- package/dom/util.js.map +1 -1
- package/dom/xdocument.d.ts +16 -16
- package/dom/xdocument.js +73 -74
- package/dom/xdocument.js.map +1 -1
- package/dom/xml-functions.d.ts +58 -58
- package/dom/xml-functions.js +369 -370
- package/dom/xml-functions.js.map +1 -1
- package/dom/xml-output-options.d.ts +6 -6
- package/dom/xml-output-options.js +2 -2
- package/dom/xml-parser.d.ts +47 -47
- package/dom/xml-parser.js +307 -307
- package/dom/xml-parser.js.map +1 -1
- package/dom/xmltoken.d.ts +12 -12
- package/dom/xmltoken.js +101 -101
- package/dom/xnode.d.ts +73 -73
- package/dom/xnode.js +450 -450
- package/dom/xnode.js.map +1 -1
- package/index.d.ts +4 -4
- package/index.js +12 -12
- package/package.json +11 -11
- package/test-without-jest.d.ts +1 -0
- package/test-without-jest.js +63 -0
- package/test-without-jest.js.map +1 -0
- package/umd/constants.d.ts +12 -12
- package/umd/dom/functions.d.ts +14 -14
- package/umd/dom/index.d.ts +6 -6
- package/umd/dom/util.d.ts +7 -7
- package/umd/dom/xdocument.d.ts +16 -16
- package/umd/dom/xml-functions.d.ts +58 -58
- package/umd/dom/xml-output-options.d.ts +6 -6
- package/umd/dom/xml-parser.d.ts +47 -47
- package/umd/dom/xmltoken.d.ts +12 -12
- package/umd/dom/xnode.d.ts +73 -73
- package/umd/index.d.ts +4 -4
- package/umd/test-without-jest.d.ts +1 -0
- package/umd/xpath/common-function.d.ts +8 -8
- package/umd/xpath/expr-context.d.ts +111 -111
- package/umd/xpath/expressions/binary-expr.d.ts +11 -11
- package/umd/xpath/expressions/expression.d.ts +4 -4
- package/umd/xpath/expressions/filter-expr.d.ts +9 -9
- package/umd/xpath/expressions/function-call-expr.d.ts +12 -12
- package/umd/xpath/expressions/index.d.ts +13 -13
- package/umd/xpath/expressions/literal-expr.d.ts +7 -7
- package/umd/xpath/expressions/location-expr.d.ts +15 -15
- package/umd/xpath/expressions/number-expr.d.ts +7 -7
- package/umd/xpath/expressions/path-expr.d.ts +9 -9
- package/umd/xpath/expressions/predicate-expr.d.ts +8 -8
- package/umd/xpath/expressions/step-expr.d.ts +25 -25
- package/umd/xpath/expressions/token-expr.d.ts +7 -7
- package/umd/xpath/expressions/unary-minus-expr.d.ts +8 -8
- package/umd/xpath/expressions/union-expr.d.ts +9 -9
- package/umd/xpath/expressions/variable-expr.d.ts +7 -7
- package/umd/xpath/functions/index.d.ts +2 -2
- package/umd/xpath/functions/internal-functions.d.ts +2 -2
- package/umd/xpath/functions/non-standard.d.ts +12 -12
- package/umd/xpath/functions/standard-20.d.ts +5 -5
- package/umd/xpath/functions/standard.d.ts +40 -40
- package/umd/xpath/grammar-rule-candidate.d.ts +8 -8
- package/umd/xpath/index.d.ts +3 -3
- package/umd/xpath/match-resolver.d.ts +55 -55
- package/umd/xpath/node-tests/index.d.ts +8 -8
- package/umd/xpath/node-tests/node-test-any.d.ts +6 -6
- package/umd/xpath/node-tests/node-test-comment.d.ts +6 -6
- package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
- package/umd/xpath/node-tests/node-test-name.d.ts +10 -10
- package/umd/xpath/node-tests/node-test-nc.d.ts +9 -9
- package/umd/xpath/node-tests/node-test-pi.d.ts +8 -8
- package/umd/xpath/node-tests/node-test-text.d.ts +6 -6
- package/umd/xpath/node-tests/node-test.d.ts +5 -5
- package/umd/xpath/tokens.d.ts +62 -62
- package/umd/xpath/values/boolean-value.d.ts +11 -11
- package/umd/xpath/values/index.d.ts +5 -5
- package/umd/xpath/values/node-set-value.d.ts +11 -11
- package/umd/xpath/values/node-value.d.ts +7 -7
- package/umd/xpath/values/number-value.d.ts +11 -11
- package/umd/xpath/values/string-value.d.ts +11 -11
- package/umd/xpath/xpath-grammar-rules.d.ts +68 -68
- package/umd/xpath/xpath-token-rule.d.ts +7 -7
- package/umd/xpath/xpath.d.ts +174 -170
- package/umd/xpathdebug.d.ts +2 -2
- package/umd/xslt/index.d.ts +3 -3
- package/umd/xslt/xslt-decimal-format-settings.d.ts +28 -28
- package/umd/xslt/xslt-options.d.ts +7 -7
- package/umd/xslt/xslt-parameter.d.ts +5 -5
- package/umd/xslt/xslt.d.ts +207 -190
- package/umd/xslt-processor.js +1 -15
- package/umd/xslt-processor.js.map +1 -1
- package/xpath/common-function.d.ts +8 -8
- package/xpath/common-function.js +31 -32
- package/xpath/common-function.js.map +1 -1
- package/xpath/expr-context.d.ts +111 -111
- package/xpath/expr-context.js +189 -189
- package/xpath/expr-context.js.map +1 -1
- package/xpath/expressions/binary-expr.d.ts +11 -11
- package/xpath/expressions/binary-expr.js +165 -165
- package/xpath/expressions/binary-expr.js.map +1 -1
- package/xpath/expressions/expression.d.ts +4 -4
- package/xpath/expressions/expression.js +9 -9
- package/xpath/expressions/filter-expr.d.ts +9 -9
- package/xpath/expressions/filter-expr.js +52 -52
- package/xpath/expressions/filter-expr.js.map +1 -1
- package/xpath/expressions/function-call-expr.d.ts +12 -12
- package/xpath/expressions/function-call-expr.js +95 -95
- package/xpath/expressions/function-call-expr.js.map +1 -1
- package/xpath/expressions/index.d.ts +13 -13
- package/xpath/expressions/index.js +29 -29
- package/xpath/expressions/literal-expr.d.ts +7 -7
- package/xpath/expressions/literal-expr.js +33 -33
- package/xpath/expressions/literal-expr.js.map +1 -1
- package/xpath/expressions/location-expr.d.ts +15 -15
- package/xpath/expressions/location-expr.js +98 -98
- package/xpath/expressions/location-expr.js.map +1 -1
- package/xpath/expressions/number-expr.d.ts +7 -7
- package/xpath/expressions/number-expr.js +33 -33
- package/xpath/expressions/number-expr.js.map +1 -1
- package/xpath/expressions/path-expr.d.ts +9 -9
- package/xpath/expressions/path-expr.js +51 -51
- package/xpath/expressions/path-expr.js.map +1 -1
- package/xpath/expressions/predicate-expr.d.ts +8 -8
- package/xpath/expressions/predicate-expr.js +40 -40
- package/xpath/expressions/predicate-expr.js.map +1 -1
- package/xpath/expressions/step-expr.d.ts +25 -25
- package/xpath/expressions/step-expr.js +280 -280
- package/xpath/expressions/step-expr.js.map +1 -1
- package/xpath/expressions/token-expr.d.ts +7 -7
- package/xpath/expressions/token-expr.js +33 -33
- package/xpath/expressions/token-expr.js.map +1 -1
- package/xpath/expressions/unary-minus-expr.d.ts +8 -8
- package/xpath/expressions/unary-minus-expr.js +33 -33
- package/xpath/expressions/unary-minus-expr.js.map +1 -1
- package/xpath/expressions/union-expr.d.ts +9 -9
- package/xpath/expressions/union-expr.js +50 -50
- package/xpath/expressions/union-expr.js.map +1 -1
- package/xpath/expressions/variable-expr.d.ts +7 -7
- package/xpath/expressions/variable-expr.js +32 -32
- package/xpath/expressions/variable-expr.js.map +1 -1
- package/xpath/functions/index.d.ts +2 -2
- package/xpath/functions/index.js +18 -18
- package/xpath/functions/internal-functions.d.ts +2 -2
- package/xpath/functions/internal-functions.js +21 -22
- package/xpath/functions/internal-functions.js.map +1 -1
- package/xpath/functions/non-standard.d.ts +12 -12
- package/xpath/functions/non-standard.js +44 -45
- package/xpath/functions/non-standard.js.map +1 -1
- package/xpath/functions/standard-20.d.ts +5 -5
- package/xpath/functions/standard-20.js +25 -26
- package/xpath/functions/standard-20.js.map +1 -1
- package/xpath/functions/standard.d.ts +40 -40
- package/xpath/functions/standard.js +441 -442
- package/xpath/functions/standard.js.map +1 -1
- package/xpath/grammar-rule-candidate.d.ts +8 -8
- package/xpath/grammar-rule-candidate.js +2 -2
- package/xpath/index.d.ts +3 -3
- package/xpath/index.js +19 -19
- package/xpath/match-resolver.d.ts +55 -55
- package/xpath/match-resolver.js +136 -136
- package/xpath/match-resolver.js.map +1 -1
- package/xpath/node-tests/index.d.ts +8 -8
- package/xpath/node-tests/index.js +17 -17
- package/xpath/node-tests/node-test-any.d.ts +6 -6
- package/xpath/node-tests/node-test-any.js +14 -14
- package/xpath/node-tests/node-test-comment.d.ts +6 -6
- package/xpath/node-tests/node-test-comment.js +14 -14
- package/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
- package/xpath/node-tests/node-test-element-or-attribute.js +15 -15
- package/xpath/node-tests/node-test-name.d.ts +10 -10
- package/xpath/node-tests/node-test-name.js +38 -38
- package/xpath/node-tests/node-test-name.js.map +1 -1
- package/xpath/node-tests/node-test-nc.d.ts +9 -9
- package/xpath/node-tests/node-test-nc.js +16 -16
- package/xpath/node-tests/node-test-pi.d.ts +8 -8
- package/xpath/node-tests/node-test-pi.js +16 -16
- package/xpath/node-tests/node-test-pi.js.map +1 -1
- package/xpath/node-tests/node-test-text.d.ts +6 -6
- package/xpath/node-tests/node-test-text.js +14 -14
- package/xpath/node-tests/node-test.d.ts +5 -5
- package/xpath/node-tests/node-test.js +2 -2
- package/xpath/tokens.d.ts +62 -62
- package/xpath/tokens.js +300 -300
- package/xpath/tokens.js.map +1 -1
- package/xpath/values/boolean-value.d.ts +11 -11
- package/xpath/values/boolean-value.js +23 -23
- package/xpath/values/index.d.ts +5 -5
- package/xpath/values/index.js +46 -46
- package/xpath/values/node-set-value.d.ts +11 -11
- package/xpath/values/node-set-value.js +27 -27
- package/xpath/values/node-set-value.js.map +1 -1
- package/xpath/values/node-value.d.ts +7 -7
- package/xpath/values/node-value.js +2 -2
- package/xpath/values/number-value.d.ts +11 -11
- package/xpath/values/number-value.js +23 -23
- package/xpath/values/string-value.d.ts +11 -11
- package/xpath/values/string-value.js +23 -23
- package/xpath/xpath-grammar-rules.d.ts +68 -68
- package/xpath/xpath-grammar-rules.js +74 -74
- package/xpath/xpath-token-rule.d.ts +7 -7
- package/xpath/xpath-token-rule.js +2 -2
- package/xpath/xpath.d.ts +174 -170
- package/xpath/xpath.js +911 -909
- package/xpath/xpath.js.map +1 -1
- package/xpathdebug.d.ts +2 -2
- package/xpathdebug.js +187 -187
- package/xpathdebug.js.map +1 -1
- package/xslt/index.d.ts +3 -3
- package/xslt/index.js +19 -19
- package/xslt/xslt-decimal-format-settings.d.ts +28 -28
- package/xslt/xslt-decimal-format-settings.js +2 -2
- package/xslt/xslt-options.d.ts +7 -7
- package/xslt/xslt-options.js +2 -2
- package/xslt/xslt-parameter.d.ts +5 -5
- package/xslt/xslt-parameter.js +2 -2
- package/xslt/xslt.d.ts +207 -190
- package/xslt/xslt.js +1135 -1079
- package/xslt/xslt.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare function copyArray(dst: any[], src: any[]): void;
|
|
2
|
-
/**
|
|
3
|
-
* This is an optimization for copying attribute lists in IE. IE includes many
|
|
4
|
-
* extraneous properties in its DOM attribute lists, which take require
|
|
5
|
-
* significant extra processing when evaluating attribute steps. With this
|
|
6
|
-
* function, we ignore any such attributes that has an empty string value.
|
|
7
|
-
*/
|
|
8
|
-
export declare function copyArrayIgnoringAttributesWithoutValue(dst: any[], src: any[]): void;
|
|
1
|
+
export declare function copyArray(dst: any[], src: any[]): void;
|
|
2
|
+
/**
|
|
3
|
+
* This is an optimization for copying attribute lists in IE. IE includes many
|
|
4
|
+
* extraneous properties in its DOM attribute lists, which take require
|
|
5
|
+
* significant extra processing when evaluating attribute steps. With this
|
|
6
|
+
* function, we ignore any such attributes that has an empty string value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function copyArrayIgnoringAttributesWithoutValue(dst: any[], src: any[]): void;
|
package/xpath/common-function.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This is an optimization for copying attribute lists in IE. IE includes many
|
|
17
|
-
* extraneous properties in its DOM attribute lists, which take require
|
|
18
|
-
* significant extra processing when evaluating attribute steps. With this
|
|
19
|
-
* function, we ignore any such attributes that has an empty string value.
|
|
20
|
-
*/
|
|
21
|
-
function copyArrayIgnoringAttributesWithoutValue(dst, src) {
|
|
22
|
-
if (!src)
|
|
23
|
-
return;
|
|
24
|
-
for (var i = src.length - 1; i >= 0; --i) {
|
|
25
|
-
// this test will pass so long as the attribute has a non-empty string
|
|
26
|
-
// value, even if that value is "false", "0", "undefined", etc.
|
|
27
|
-
if (src[i].nodeValue) {
|
|
28
|
-
dst.push(src[i]);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.copyArrayIgnoringAttributesWithoutValue = copyArrayIgnoringAttributesWithoutValue;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyArray = copyArray;
|
|
4
|
+
exports.copyArrayIgnoringAttributesWithoutValue = copyArrayIgnoringAttributesWithoutValue;
|
|
5
|
+
// Shallow-copies an array to the end of another array
|
|
6
|
+
// Basically Array.concat, but works with other non-array collections
|
|
7
|
+
function copyArray(dst, src) {
|
|
8
|
+
if (!src)
|
|
9
|
+
return;
|
|
10
|
+
var dstLength = dst.length;
|
|
11
|
+
for (var i = src.length - 1; i >= 0; --i) {
|
|
12
|
+
dst[i + dstLength] = src[i];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* This is an optimization for copying attribute lists in IE. IE includes many
|
|
17
|
+
* extraneous properties in its DOM attribute lists, which take require
|
|
18
|
+
* significant extra processing when evaluating attribute steps. With this
|
|
19
|
+
* function, we ignore any such attributes that has an empty string value.
|
|
20
|
+
*/
|
|
21
|
+
function copyArrayIgnoringAttributesWithoutValue(dst, src) {
|
|
22
|
+
if (!src)
|
|
23
|
+
return;
|
|
24
|
+
for (var i = src.length - 1; i >= 0; --i) {
|
|
25
|
+
// this test will pass so long as the attribute has a non-empty string
|
|
26
|
+
// value, even if that value is "false", "0", "undefined", etc.
|
|
27
|
+
if (src[i].nodeValue) {
|
|
28
|
+
dst.push(src[i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
33
32
|
//# sourceMappingURL=common-function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-function.js","sourceRoot":"","sources":["../../src/xpath/common-function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-function.js","sourceRoot":"","sources":["../../src/xpath/common-function.ts"],"names":[],"mappings":";;AAEA,8BAMC;AAQD,0FASC;AAzBD,sDAAsD;AACtD,qEAAqE;AACrE,SAAgB,SAAS,CAAC,GAAU,EAAE,GAAU;IAC5C,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,IAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uCAAuC,CAAC,GAAU,EAAE,GAAU;IAC1E,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QACvC,sEAAsE;QACtE,+DAA+D;QAC/D,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;YACnB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACL,CAAC;AACL,CAAC"}
|
package/xpath/expr-context.d.ts
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { XNode } from '../dom';
|
|
2
|
-
import { XsltDecimalFormatSettings } from '../xslt/xslt-decimal-format-settings';
|
|
3
|
-
import { NodeValue } from './values';
|
|
4
|
-
/**
|
|
5
|
-
* XPath expression evaluation context. An XPath context consists of a
|
|
6
|
-
* DOM node, a list of DOM nodes that contains this node, a number
|
|
7
|
-
* that represents the position of the single node in the list, and a
|
|
8
|
-
* current set of variable bindings. (See XPath spec.)
|
|
9
|
-
*
|
|
10
|
-
* setVariable(name, expr) -- binds given XPath expression to the
|
|
11
|
-
* name.
|
|
12
|
-
*
|
|
13
|
-
* getVariable(name) -- what the name says.
|
|
14
|
-
*
|
|
15
|
-
* setNode(position) -- sets the context to the node at the given
|
|
16
|
-
* position. Needed to implement scoping rules for variables in
|
|
17
|
-
* XPath. (A variable is visible to all subsequent siblings, not
|
|
18
|
-
* only to its children.)
|
|
19
|
-
*
|
|
20
|
-
* set/isCaseInsensitive -- specifies whether node name tests should
|
|
21
|
-
* be case sensitive. If you're executing xpaths against a regular
|
|
22
|
-
* HTML DOM, you probably don't want case-sensitivity, because
|
|
23
|
-
* browsers tend to disagree about whether elements & attributes
|
|
24
|
-
* should be upper/lower case. If you're running xpaths in an
|
|
25
|
-
* XSLT instance, you probably DO want case sensitivity, as per the
|
|
26
|
-
* XSL spec.
|
|
27
|
-
*
|
|
28
|
-
* set/isReturnOnFirstMatch -- whether XPath evaluation should quit as soon
|
|
29
|
-
* as a result is found. This is an optimization that might make sense if you
|
|
30
|
-
* only care about the first result.
|
|
31
|
-
*
|
|
32
|
-
* set/isIgnoreNonElementNodesForNTA -- whether to ignore non-element nodes
|
|
33
|
-
* when evaluating the "node()" any node test. While technically this is
|
|
34
|
-
* contrary to the XPath spec, practically it can enhance performance
|
|
35
|
-
* significantly, and makes sense if you a) use "node()" when you mean "*",
|
|
36
|
-
* and b) use "//" when you mean "/descendant::* /".
|
|
37
|
-
*/
|
|
38
|
-
export declare class ExprContext {
|
|
39
|
-
position: number;
|
|
40
|
-
nodeList: XNode[];
|
|
41
|
-
outputPosition: number;
|
|
42
|
-
outputNodeList: XNode[];
|
|
43
|
-
outputDepth: number;
|
|
44
|
-
xsltVersion: '1.0' | '2.0' | '3.0';
|
|
45
|
-
variables: {
|
|
46
|
-
[name: string]: NodeValue;
|
|
47
|
-
};
|
|
48
|
-
knownNamespaces: {
|
|
49
|
-
[alias: string]: string;
|
|
50
|
-
};
|
|
51
|
-
caseInsensitive: any;
|
|
52
|
-
ignoreAttributesWithoutValue: any;
|
|
53
|
-
returnOnFirstMatch: any;
|
|
54
|
-
ignoreNonElementNodesForNTA: any;
|
|
55
|
-
parent: ExprContext;
|
|
56
|
-
root: XNode;
|
|
57
|
-
decimalFormatSettings: XsltDecimalFormatSettings;
|
|
58
|
-
inApplyTemplates: boolean;
|
|
59
|
-
baseTemplateMatched: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Constructor -- gets the node, its position, the node set it
|
|
62
|
-
* belongs to, and a parent context as arguments. The parent context
|
|
63
|
-
* is used to implement scoping rules for variables: if a variable
|
|
64
|
-
* is not found in the current context, it is looked for in the
|
|
65
|
-
* parent context, recursively. Except for node, all arguments have
|
|
66
|
-
* default values: default position is 0, default node set is the
|
|
67
|
-
* set that contains only the node, and the default parent is null.
|
|
68
|
-
*
|
|
69
|
-
* Notice that position starts at 0 at the outside interface;
|
|
70
|
-
* inside XPath expressions this shows up as position()=1.
|
|
71
|
-
* @param nodeList TODO
|
|
72
|
-
* @param outputNodeList TODO
|
|
73
|
-
* @param opt_position TODO
|
|
74
|
-
* @param opt_outputPosition TODO
|
|
75
|
-
* @param opt_parent TODO
|
|
76
|
-
* @param opt_caseInsensitive TODO
|
|
77
|
-
* @param opt_ignoreAttributesWithoutValue TODO
|
|
78
|
-
* @param opt_returnOnFirstMatch TODO
|
|
79
|
-
* @param opt_ignoreNonElementNodesForNTA TODO
|
|
80
|
-
*/
|
|
81
|
-
constructor(nodeList: XNode[], outputNodeList: XNode[], xsltVersion?: '1.0' | '2.0' | '3.0', opt_position?: number, opt_outputPosition?: number, opt_outputDepth?: number, opt_decimalFormatSettings?: XsltDecimalFormatSettings, opt_variables?: {
|
|
82
|
-
[name: string]: any;
|
|
83
|
-
}, opt_knownNamespaces?: {
|
|
84
|
-
[alias: string]: string;
|
|
85
|
-
}, opt_parent?: ExprContext, opt_caseInsensitive?: any, opt_ignoreAttributesWithoutValue?: any, opt_returnOnFirstMatch?: any, opt_ignoreNonElementNodesForNTA?: any);
|
|
86
|
-
/**
|
|
87
|
-
* clone() -- creates a new context with the current context as
|
|
88
|
-
* parent. If passed as argument to clone(), the new context has a
|
|
89
|
-
* different node, position, or node set. What is not passed is
|
|
90
|
-
* inherited from the cloned context.
|
|
91
|
-
* @param opt_nodeList TODO
|
|
92
|
-
* @param opt_outputNodeList TODO
|
|
93
|
-
* @param opt_position TODO
|
|
94
|
-
* @param opt_outputPosition TODO
|
|
95
|
-
* @returns TODO
|
|
96
|
-
*/
|
|
97
|
-
clone(opt_nodeList?: XNode[], opt_outputNodeList?: XNode[], opt_position?: number, opt_outputPosition?: number): ExprContext;
|
|
98
|
-
cloneByOutput(opt_outputNodeList?: XNode[], opt_outputPosition?: number, opt_outputDepth?: number): ExprContext;
|
|
99
|
-
setVariable(name?: any, value?: any): void;
|
|
100
|
-
getVariable(name: string): NodeValue;
|
|
101
|
-
setNode(position: number): void;
|
|
102
|
-
contextSize(): number;
|
|
103
|
-
isCaseInsensitive(): any;
|
|
104
|
-
setCaseInsensitive(caseInsensitive: any): any;
|
|
105
|
-
isIgnoreAttributesWithoutValue(): any;
|
|
106
|
-
setIgnoreAttributesWithoutValue(ignore: any): any;
|
|
107
|
-
isReturnOnFirstMatch(): any;
|
|
108
|
-
setReturnOnFirstMatch(returnOnFirstMatch: any): any;
|
|
109
|
-
isIgnoreNonElementNodesForNTA(): any;
|
|
110
|
-
setIgnoreNonElementNodesForNTA(ignoreNonElementNodesForNTA: any): any;
|
|
111
|
-
}
|
|
1
|
+
import { XNode } from '../dom';
|
|
2
|
+
import { XsltDecimalFormatSettings } from '../xslt/xslt-decimal-format-settings';
|
|
3
|
+
import { NodeValue } from './values';
|
|
4
|
+
/**
|
|
5
|
+
* XPath expression evaluation context. An XPath context consists of a
|
|
6
|
+
* DOM node, a list of DOM nodes that contains this node, a number
|
|
7
|
+
* that represents the position of the single node in the list, and a
|
|
8
|
+
* current set of variable bindings. (See XPath spec.)
|
|
9
|
+
*
|
|
10
|
+
* setVariable(name, expr) -- binds given XPath expression to the
|
|
11
|
+
* name.
|
|
12
|
+
*
|
|
13
|
+
* getVariable(name) -- what the name says.
|
|
14
|
+
*
|
|
15
|
+
* setNode(position) -- sets the context to the node at the given
|
|
16
|
+
* position. Needed to implement scoping rules for variables in
|
|
17
|
+
* XPath. (A variable is visible to all subsequent siblings, not
|
|
18
|
+
* only to its children.)
|
|
19
|
+
*
|
|
20
|
+
* set/isCaseInsensitive -- specifies whether node name tests should
|
|
21
|
+
* be case sensitive. If you're executing xpaths against a regular
|
|
22
|
+
* HTML DOM, you probably don't want case-sensitivity, because
|
|
23
|
+
* browsers tend to disagree about whether elements & attributes
|
|
24
|
+
* should be upper/lower case. If you're running xpaths in an
|
|
25
|
+
* XSLT instance, you probably DO want case sensitivity, as per the
|
|
26
|
+
* XSL spec.
|
|
27
|
+
*
|
|
28
|
+
* set/isReturnOnFirstMatch -- whether XPath evaluation should quit as soon
|
|
29
|
+
* as a result is found. This is an optimization that might make sense if you
|
|
30
|
+
* only care about the first result.
|
|
31
|
+
*
|
|
32
|
+
* set/isIgnoreNonElementNodesForNTA -- whether to ignore non-element nodes
|
|
33
|
+
* when evaluating the "node()" any node test. While technically this is
|
|
34
|
+
* contrary to the XPath spec, practically it can enhance performance
|
|
35
|
+
* significantly, and makes sense if you a) use "node()" when you mean "*",
|
|
36
|
+
* and b) use "//" when you mean "/descendant::* /".
|
|
37
|
+
*/
|
|
38
|
+
export declare class ExprContext {
|
|
39
|
+
position: number;
|
|
40
|
+
nodeList: XNode[];
|
|
41
|
+
outputPosition: number;
|
|
42
|
+
outputNodeList: XNode[];
|
|
43
|
+
outputDepth: number;
|
|
44
|
+
xsltVersion: '1.0' | '2.0' | '3.0';
|
|
45
|
+
variables: {
|
|
46
|
+
[name: string]: NodeValue;
|
|
47
|
+
};
|
|
48
|
+
knownNamespaces: {
|
|
49
|
+
[alias: string]: string;
|
|
50
|
+
};
|
|
51
|
+
caseInsensitive: any;
|
|
52
|
+
ignoreAttributesWithoutValue: any;
|
|
53
|
+
returnOnFirstMatch: any;
|
|
54
|
+
ignoreNonElementNodesForNTA: any;
|
|
55
|
+
parent: ExprContext;
|
|
56
|
+
root: XNode;
|
|
57
|
+
decimalFormatSettings: XsltDecimalFormatSettings;
|
|
58
|
+
inApplyTemplates: boolean;
|
|
59
|
+
baseTemplateMatched: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Constructor -- gets the node, its position, the node set it
|
|
62
|
+
* belongs to, and a parent context as arguments. The parent context
|
|
63
|
+
* is used to implement scoping rules for variables: if a variable
|
|
64
|
+
* is not found in the current context, it is looked for in the
|
|
65
|
+
* parent context, recursively. Except for node, all arguments have
|
|
66
|
+
* default values: default position is 0, default node set is the
|
|
67
|
+
* set that contains only the node, and the default parent is null.
|
|
68
|
+
*
|
|
69
|
+
* Notice that position starts at 0 at the outside interface;
|
|
70
|
+
* inside XPath expressions this shows up as position()=1.
|
|
71
|
+
* @param nodeList TODO
|
|
72
|
+
* @param outputNodeList TODO
|
|
73
|
+
* @param opt_position TODO
|
|
74
|
+
* @param opt_outputPosition TODO
|
|
75
|
+
* @param opt_parent TODO
|
|
76
|
+
* @param opt_caseInsensitive TODO
|
|
77
|
+
* @param opt_ignoreAttributesWithoutValue TODO
|
|
78
|
+
* @param opt_returnOnFirstMatch TODO
|
|
79
|
+
* @param opt_ignoreNonElementNodesForNTA TODO
|
|
80
|
+
*/
|
|
81
|
+
constructor(nodeList: XNode[], outputNodeList: XNode[], xsltVersion?: '1.0' | '2.0' | '3.0', opt_position?: number, opt_outputPosition?: number, opt_outputDepth?: number, opt_decimalFormatSettings?: XsltDecimalFormatSettings, opt_variables?: {
|
|
82
|
+
[name: string]: any;
|
|
83
|
+
}, opt_knownNamespaces?: {
|
|
84
|
+
[alias: string]: string;
|
|
85
|
+
}, opt_parent?: ExprContext, opt_caseInsensitive?: any, opt_ignoreAttributesWithoutValue?: any, opt_returnOnFirstMatch?: any, opt_ignoreNonElementNodesForNTA?: any);
|
|
86
|
+
/**
|
|
87
|
+
* clone() -- creates a new context with the current context as
|
|
88
|
+
* parent. If passed as argument to clone(), the new context has a
|
|
89
|
+
* different node, position, or node set. What is not passed is
|
|
90
|
+
* inherited from the cloned context.
|
|
91
|
+
* @param opt_nodeList TODO
|
|
92
|
+
* @param opt_outputNodeList TODO
|
|
93
|
+
* @param opt_position TODO
|
|
94
|
+
* @param opt_outputPosition TODO
|
|
95
|
+
* @returns TODO
|
|
96
|
+
*/
|
|
97
|
+
clone(opt_nodeList?: XNode[], opt_outputNodeList?: XNode[], opt_position?: number, opt_outputPosition?: number): ExprContext;
|
|
98
|
+
cloneByOutput(opt_outputNodeList?: XNode[], opt_outputPosition?: number, opt_outputDepth?: number): ExprContext;
|
|
99
|
+
setVariable(name?: any, value?: any): void;
|
|
100
|
+
getVariable(name: string): NodeValue;
|
|
101
|
+
setNode(position: number): void;
|
|
102
|
+
contextSize(): number;
|
|
103
|
+
isCaseInsensitive(): any;
|
|
104
|
+
setCaseInsensitive(caseInsensitive: any): any;
|
|
105
|
+
isIgnoreAttributesWithoutValue(): any;
|
|
106
|
+
setIgnoreAttributesWithoutValue(ignore: any): any;
|
|
107
|
+
isReturnOnFirstMatch(): any;
|
|
108
|
+
setReturnOnFirstMatch(returnOnFirstMatch: any): any;
|
|
109
|
+
isIgnoreNonElementNodesForNTA(): any;
|
|
110
|
+
setIgnoreNonElementNodesForNTA(ignoreNonElementNodesForNTA: any): any;
|
|
111
|
+
}
|