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.
Files changed (224) hide show
  1. package/README.md +2 -2
  2. package/constants.d.ts +12 -12
  3. package/constants.js +16 -16
  4. package/dom/functions.d.ts +14 -14
  5. package/dom/functions.js +56 -57
  6. package/dom/functions.js.map +1 -1
  7. package/dom/index.d.ts +6 -6
  8. package/dom/index.js +22 -22
  9. package/dom/util.d.ts +7 -7
  10. package/dom/util.js +42 -43
  11. package/dom/util.js.map +1 -1
  12. package/dom/xdocument.d.ts +16 -16
  13. package/dom/xdocument.js +73 -74
  14. package/dom/xdocument.js.map +1 -1
  15. package/dom/xml-functions.d.ts +58 -58
  16. package/dom/xml-functions.js +369 -370
  17. package/dom/xml-functions.js.map +1 -1
  18. package/dom/xml-output-options.d.ts +6 -6
  19. package/dom/xml-output-options.js +2 -2
  20. package/dom/xml-parser.d.ts +47 -47
  21. package/dom/xml-parser.js +307 -307
  22. package/dom/xml-parser.js.map +1 -1
  23. package/dom/xmltoken.d.ts +12 -12
  24. package/dom/xmltoken.js +101 -101
  25. package/dom/xnode.d.ts +73 -73
  26. package/dom/xnode.js +450 -450
  27. package/dom/xnode.js.map +1 -1
  28. package/index.d.ts +4 -4
  29. package/index.js +12 -12
  30. package/package.json +11 -11
  31. package/test-without-jest.d.ts +1 -0
  32. package/test-without-jest.js +63 -0
  33. package/test-without-jest.js.map +1 -0
  34. package/umd/constants.d.ts +12 -12
  35. package/umd/dom/functions.d.ts +14 -14
  36. package/umd/dom/index.d.ts +6 -6
  37. package/umd/dom/util.d.ts +7 -7
  38. package/umd/dom/xdocument.d.ts +16 -16
  39. package/umd/dom/xml-functions.d.ts +58 -58
  40. package/umd/dom/xml-output-options.d.ts +6 -6
  41. package/umd/dom/xml-parser.d.ts +47 -47
  42. package/umd/dom/xmltoken.d.ts +12 -12
  43. package/umd/dom/xnode.d.ts +73 -73
  44. package/umd/index.d.ts +4 -4
  45. package/umd/test-without-jest.d.ts +1 -0
  46. package/umd/xpath/common-function.d.ts +8 -8
  47. package/umd/xpath/expr-context.d.ts +111 -111
  48. package/umd/xpath/expressions/binary-expr.d.ts +11 -11
  49. package/umd/xpath/expressions/expression.d.ts +4 -4
  50. package/umd/xpath/expressions/filter-expr.d.ts +9 -9
  51. package/umd/xpath/expressions/function-call-expr.d.ts +12 -12
  52. package/umd/xpath/expressions/index.d.ts +13 -13
  53. package/umd/xpath/expressions/literal-expr.d.ts +7 -7
  54. package/umd/xpath/expressions/location-expr.d.ts +15 -15
  55. package/umd/xpath/expressions/number-expr.d.ts +7 -7
  56. package/umd/xpath/expressions/path-expr.d.ts +9 -9
  57. package/umd/xpath/expressions/predicate-expr.d.ts +8 -8
  58. package/umd/xpath/expressions/step-expr.d.ts +25 -25
  59. package/umd/xpath/expressions/token-expr.d.ts +7 -7
  60. package/umd/xpath/expressions/unary-minus-expr.d.ts +8 -8
  61. package/umd/xpath/expressions/union-expr.d.ts +9 -9
  62. package/umd/xpath/expressions/variable-expr.d.ts +7 -7
  63. package/umd/xpath/functions/index.d.ts +2 -2
  64. package/umd/xpath/functions/internal-functions.d.ts +2 -2
  65. package/umd/xpath/functions/non-standard.d.ts +12 -12
  66. package/umd/xpath/functions/standard-20.d.ts +5 -5
  67. package/umd/xpath/functions/standard.d.ts +40 -40
  68. package/umd/xpath/grammar-rule-candidate.d.ts +8 -8
  69. package/umd/xpath/index.d.ts +3 -3
  70. package/umd/xpath/match-resolver.d.ts +55 -55
  71. package/umd/xpath/node-tests/index.d.ts +8 -8
  72. package/umd/xpath/node-tests/node-test-any.d.ts +6 -6
  73. package/umd/xpath/node-tests/node-test-comment.d.ts +6 -6
  74. package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
  75. package/umd/xpath/node-tests/node-test-name.d.ts +10 -10
  76. package/umd/xpath/node-tests/node-test-nc.d.ts +9 -9
  77. package/umd/xpath/node-tests/node-test-pi.d.ts +8 -8
  78. package/umd/xpath/node-tests/node-test-text.d.ts +6 -6
  79. package/umd/xpath/node-tests/node-test.d.ts +5 -5
  80. package/umd/xpath/tokens.d.ts +62 -62
  81. package/umd/xpath/values/boolean-value.d.ts +11 -11
  82. package/umd/xpath/values/index.d.ts +5 -5
  83. package/umd/xpath/values/node-set-value.d.ts +11 -11
  84. package/umd/xpath/values/node-value.d.ts +7 -7
  85. package/umd/xpath/values/number-value.d.ts +11 -11
  86. package/umd/xpath/values/string-value.d.ts +11 -11
  87. package/umd/xpath/xpath-grammar-rules.d.ts +68 -68
  88. package/umd/xpath/xpath-token-rule.d.ts +7 -7
  89. package/umd/xpath/xpath.d.ts +174 -170
  90. package/umd/xpathdebug.d.ts +2 -2
  91. package/umd/xslt/index.d.ts +3 -3
  92. package/umd/xslt/xslt-decimal-format-settings.d.ts +28 -28
  93. package/umd/xslt/xslt-options.d.ts +7 -7
  94. package/umd/xslt/xslt-parameter.d.ts +5 -5
  95. package/umd/xslt/xslt.d.ts +207 -190
  96. package/umd/xslt-processor.js +1 -15
  97. package/umd/xslt-processor.js.map +1 -1
  98. package/xpath/common-function.d.ts +8 -8
  99. package/xpath/common-function.js +31 -32
  100. package/xpath/common-function.js.map +1 -1
  101. package/xpath/expr-context.d.ts +111 -111
  102. package/xpath/expr-context.js +189 -189
  103. package/xpath/expr-context.js.map +1 -1
  104. package/xpath/expressions/binary-expr.d.ts +11 -11
  105. package/xpath/expressions/binary-expr.js +165 -165
  106. package/xpath/expressions/binary-expr.js.map +1 -1
  107. package/xpath/expressions/expression.d.ts +4 -4
  108. package/xpath/expressions/expression.js +9 -9
  109. package/xpath/expressions/filter-expr.d.ts +9 -9
  110. package/xpath/expressions/filter-expr.js +52 -52
  111. package/xpath/expressions/filter-expr.js.map +1 -1
  112. package/xpath/expressions/function-call-expr.d.ts +12 -12
  113. package/xpath/expressions/function-call-expr.js +95 -95
  114. package/xpath/expressions/function-call-expr.js.map +1 -1
  115. package/xpath/expressions/index.d.ts +13 -13
  116. package/xpath/expressions/index.js +29 -29
  117. package/xpath/expressions/literal-expr.d.ts +7 -7
  118. package/xpath/expressions/literal-expr.js +33 -33
  119. package/xpath/expressions/literal-expr.js.map +1 -1
  120. package/xpath/expressions/location-expr.d.ts +15 -15
  121. package/xpath/expressions/location-expr.js +98 -98
  122. package/xpath/expressions/location-expr.js.map +1 -1
  123. package/xpath/expressions/number-expr.d.ts +7 -7
  124. package/xpath/expressions/number-expr.js +33 -33
  125. package/xpath/expressions/number-expr.js.map +1 -1
  126. package/xpath/expressions/path-expr.d.ts +9 -9
  127. package/xpath/expressions/path-expr.js +51 -51
  128. package/xpath/expressions/path-expr.js.map +1 -1
  129. package/xpath/expressions/predicate-expr.d.ts +8 -8
  130. package/xpath/expressions/predicate-expr.js +40 -40
  131. package/xpath/expressions/predicate-expr.js.map +1 -1
  132. package/xpath/expressions/step-expr.d.ts +25 -25
  133. package/xpath/expressions/step-expr.js +280 -280
  134. package/xpath/expressions/step-expr.js.map +1 -1
  135. package/xpath/expressions/token-expr.d.ts +7 -7
  136. package/xpath/expressions/token-expr.js +33 -33
  137. package/xpath/expressions/token-expr.js.map +1 -1
  138. package/xpath/expressions/unary-minus-expr.d.ts +8 -8
  139. package/xpath/expressions/unary-minus-expr.js +33 -33
  140. package/xpath/expressions/unary-minus-expr.js.map +1 -1
  141. package/xpath/expressions/union-expr.d.ts +9 -9
  142. package/xpath/expressions/union-expr.js +50 -50
  143. package/xpath/expressions/union-expr.js.map +1 -1
  144. package/xpath/expressions/variable-expr.d.ts +7 -7
  145. package/xpath/expressions/variable-expr.js +32 -32
  146. package/xpath/expressions/variable-expr.js.map +1 -1
  147. package/xpath/functions/index.d.ts +2 -2
  148. package/xpath/functions/index.js +18 -18
  149. package/xpath/functions/internal-functions.d.ts +2 -2
  150. package/xpath/functions/internal-functions.js +21 -22
  151. package/xpath/functions/internal-functions.js.map +1 -1
  152. package/xpath/functions/non-standard.d.ts +12 -12
  153. package/xpath/functions/non-standard.js +44 -45
  154. package/xpath/functions/non-standard.js.map +1 -1
  155. package/xpath/functions/standard-20.d.ts +5 -5
  156. package/xpath/functions/standard-20.js +25 -26
  157. package/xpath/functions/standard-20.js.map +1 -1
  158. package/xpath/functions/standard.d.ts +40 -40
  159. package/xpath/functions/standard.js +441 -442
  160. package/xpath/functions/standard.js.map +1 -1
  161. package/xpath/grammar-rule-candidate.d.ts +8 -8
  162. package/xpath/grammar-rule-candidate.js +2 -2
  163. package/xpath/index.d.ts +3 -3
  164. package/xpath/index.js +19 -19
  165. package/xpath/match-resolver.d.ts +55 -55
  166. package/xpath/match-resolver.js +136 -136
  167. package/xpath/match-resolver.js.map +1 -1
  168. package/xpath/node-tests/index.d.ts +8 -8
  169. package/xpath/node-tests/index.js +17 -17
  170. package/xpath/node-tests/node-test-any.d.ts +6 -6
  171. package/xpath/node-tests/node-test-any.js +14 -14
  172. package/xpath/node-tests/node-test-comment.d.ts +6 -6
  173. package/xpath/node-tests/node-test-comment.js +14 -14
  174. package/xpath/node-tests/node-test-element-or-attribute.d.ts +6 -6
  175. package/xpath/node-tests/node-test-element-or-attribute.js +15 -15
  176. package/xpath/node-tests/node-test-name.d.ts +10 -10
  177. package/xpath/node-tests/node-test-name.js +38 -38
  178. package/xpath/node-tests/node-test-name.js.map +1 -1
  179. package/xpath/node-tests/node-test-nc.d.ts +9 -9
  180. package/xpath/node-tests/node-test-nc.js +16 -16
  181. package/xpath/node-tests/node-test-pi.d.ts +8 -8
  182. package/xpath/node-tests/node-test-pi.js +16 -16
  183. package/xpath/node-tests/node-test-pi.js.map +1 -1
  184. package/xpath/node-tests/node-test-text.d.ts +6 -6
  185. package/xpath/node-tests/node-test-text.js +14 -14
  186. package/xpath/node-tests/node-test.d.ts +5 -5
  187. package/xpath/node-tests/node-test.js +2 -2
  188. package/xpath/tokens.d.ts +62 -62
  189. package/xpath/tokens.js +300 -300
  190. package/xpath/tokens.js.map +1 -1
  191. package/xpath/values/boolean-value.d.ts +11 -11
  192. package/xpath/values/boolean-value.js +23 -23
  193. package/xpath/values/index.d.ts +5 -5
  194. package/xpath/values/index.js +46 -46
  195. package/xpath/values/node-set-value.d.ts +11 -11
  196. package/xpath/values/node-set-value.js +27 -27
  197. package/xpath/values/node-set-value.js.map +1 -1
  198. package/xpath/values/node-value.d.ts +7 -7
  199. package/xpath/values/node-value.js +2 -2
  200. package/xpath/values/number-value.d.ts +11 -11
  201. package/xpath/values/number-value.js +23 -23
  202. package/xpath/values/string-value.d.ts +11 -11
  203. package/xpath/values/string-value.js +23 -23
  204. package/xpath/xpath-grammar-rules.d.ts +68 -68
  205. package/xpath/xpath-grammar-rules.js +74 -74
  206. package/xpath/xpath-token-rule.d.ts +7 -7
  207. package/xpath/xpath-token-rule.js +2 -2
  208. package/xpath/xpath.d.ts +174 -170
  209. package/xpath/xpath.js +911 -909
  210. package/xpath/xpath.js.map +1 -1
  211. package/xpathdebug.d.ts +2 -2
  212. package/xpathdebug.js +187 -187
  213. package/xpathdebug.js.map +1 -1
  214. package/xslt/index.d.ts +3 -3
  215. package/xslt/index.js +19 -19
  216. package/xslt/xslt-decimal-format-settings.d.ts +28 -28
  217. package/xslt/xslt-decimal-format-settings.js +2 -2
  218. package/xslt/xslt-options.d.ts +7 -7
  219. package/xslt/xslt-options.js +2 -2
  220. package/xslt/xslt-parameter.d.ts +5 -5
  221. package/xslt/xslt-parameter.js +2 -2
  222. package/xslt/xslt.d.ts +207 -190
  223. package/xslt/xslt.js +1135 -1079
  224. 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;
@@ -1,33 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copyArrayIgnoringAttributesWithoutValue = exports.copyArray = void 0;
4
- // Shallow-copies an array to the end of another array
5
- // Basically Array.concat, but works with other non-array collections
6
- function copyArray(dst, src) {
7
- if (!src)
8
- return;
9
- var dstLength = dst.length;
10
- for (var i = src.length - 1; i >= 0; --i) {
11
- dst[i + dstLength] = src[i];
12
- }
13
- }
14
- exports.copyArray = copyArray;
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":";;;AAAA,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;QACtC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;KAC/B;AACL,CAAC;AAND,8BAMC;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;QACtC,sEAAsE;QACtE,+DAA+D;QAC/D,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;YAClB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACpB;KACJ;AACL,CAAC;AATD,0FASC"}
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"}
@@ -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
+ }