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.
Files changed (264) hide show
  1. package/index.d.mts +817 -0
  2. package/index.d.ts +817 -4
  3. package/index.js +4467 -12
  4. package/index.js.map +1 -1
  5. package/index.mjs +4431 -0
  6. package/index.mjs.map +1 -0
  7. package/package.json +23 -18
  8. package/umd/xslt-processor.global.js +9 -0
  9. package/umd/xslt-processor.global.js.map +1 -0
  10. package/constants.d.ts +0 -12
  11. package/constants.js +0 -17
  12. package/constants.js.map +0 -1
  13. package/dom/functions.d.ts +0 -14
  14. package/dom/functions.js +0 -57
  15. package/dom/functions.js.map +0 -1
  16. package/dom/index.d.ts +0 -7
  17. package/dom/index.js +0 -24
  18. package/dom/index.js.map +0 -1
  19. package/dom/util.d.ts +0 -7
  20. package/dom/util.js +0 -43
  21. package/dom/util.js.map +0 -1
  22. package/dom/xbrowser-node.d.ts +0 -9
  23. package/dom/xbrowser-node.js +0 -32
  24. package/dom/xbrowser-node.js.map +0 -1
  25. package/dom/xdocument.d.ts +0 -16
  26. package/dom/xdocument.js +0 -74
  27. package/dom/xdocument.js.map +0 -1
  28. package/dom/xml-functions.d.ts +0 -73
  29. package/dom/xml-functions.js +0 -402
  30. package/dom/xml-functions.js.map +0 -1
  31. package/dom/xml-output-options.d.ts +0 -6
  32. package/dom/xml-output-options.js +0 -3
  33. package/dom/xml-output-options.js.map +0 -1
  34. package/dom/xml-parser.d.ts +0 -47
  35. package/dom/xml-parser.js +0 -308
  36. package/dom/xml-parser.js.map +0 -1
  37. package/dom/xmltoken.d.ts +0 -12
  38. package/dom/xmltoken.js +0 -102
  39. package/dom/xmltoken.js.map +0 -1
  40. package/dom/xnode.d.ts +0 -73
  41. package/dom/xnode.js +0 -451
  42. package/dom/xnode.js.map +0 -1
  43. package/test-without-jest.d.ts +0 -1
  44. package/test-without-jest.js +0 -63
  45. package/test-without-jest.js.map +0 -1
  46. package/umd/constants.d.ts +0 -12
  47. package/umd/dom/functions.d.ts +0 -14
  48. package/umd/dom/index.d.ts +0 -7
  49. package/umd/dom/util.d.ts +0 -7
  50. package/umd/dom/xbrowser-node.d.ts +0 -9
  51. package/umd/dom/xdocument.d.ts +0 -16
  52. package/umd/dom/xml-functions.d.ts +0 -73
  53. package/umd/dom/xml-output-options.d.ts +0 -6
  54. package/umd/dom/xml-parser.d.ts +0 -47
  55. package/umd/dom/xmltoken.d.ts +0 -12
  56. package/umd/dom/xnode.d.ts +0 -73
  57. package/umd/index.d.ts +0 -4
  58. package/umd/test-without-jest.d.ts +0 -1
  59. package/umd/xpath/common-function.d.ts +0 -8
  60. package/umd/xpath/expr-context.d.ts +0 -116
  61. package/umd/xpath/expressions/binary-expr.d.ts +0 -11
  62. package/umd/xpath/expressions/expression.d.ts +0 -4
  63. package/umd/xpath/expressions/filter-expr.d.ts +0 -9
  64. package/umd/xpath/expressions/function-call-expr.d.ts +0 -12
  65. package/umd/xpath/expressions/index.d.ts +0 -13
  66. package/umd/xpath/expressions/literal-expr.d.ts +0 -7
  67. package/umd/xpath/expressions/location-expr.d.ts +0 -15
  68. package/umd/xpath/expressions/number-expr.d.ts +0 -7
  69. package/umd/xpath/expressions/path-expr.d.ts +0 -9
  70. package/umd/xpath/expressions/predicate-expr.d.ts +0 -8
  71. package/umd/xpath/expressions/step-expr.d.ts +0 -25
  72. package/umd/xpath/expressions/token-expr.d.ts +0 -7
  73. package/umd/xpath/expressions/unary-minus-expr.d.ts +0 -8
  74. package/umd/xpath/expressions/union-expr.d.ts +0 -9
  75. package/umd/xpath/expressions/variable-expr.d.ts +0 -7
  76. package/umd/xpath/functions/index.d.ts +0 -4
  77. package/umd/xpath/functions/internal-functions.d.ts +0 -2
  78. package/umd/xpath/functions/non-standard.d.ts +0 -12
  79. package/umd/xpath/functions/standard-20.d.ts +0 -5
  80. package/umd/xpath/functions/standard.d.ts +0 -40
  81. package/umd/xpath/functions/xslt-specific.d.ts +0 -3
  82. package/umd/xpath/grammar-rule-candidate.d.ts +0 -8
  83. package/umd/xpath/index.d.ts +0 -3
  84. package/umd/xpath/match-resolver.d.ts +0 -55
  85. package/umd/xpath/node-tests/index.d.ts +0 -8
  86. package/umd/xpath/node-tests/node-test-any.d.ts +0 -6
  87. package/umd/xpath/node-tests/node-test-comment.d.ts +0 -6
  88. package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
  89. package/umd/xpath/node-tests/node-test-name.d.ts +0 -10
  90. package/umd/xpath/node-tests/node-test-nc.d.ts +0 -9
  91. package/umd/xpath/node-tests/node-test-pi.d.ts +0 -8
  92. package/umd/xpath/node-tests/node-test-text.d.ts +0 -6
  93. package/umd/xpath/node-tests/node-test.d.ts +0 -5
  94. package/umd/xpath/tokens.d.ts +0 -62
  95. package/umd/xpath/values/boolean-value.d.ts +0 -11
  96. package/umd/xpath/values/index.d.ts +0 -5
  97. package/umd/xpath/values/node-set-value.d.ts +0 -11
  98. package/umd/xpath/values/node-value.d.ts +0 -7
  99. package/umd/xpath/values/number-value.d.ts +0 -11
  100. package/umd/xpath/values/string-value.d.ts +0 -11
  101. package/umd/xpath/xpath-grammar-rules.d.ts +0 -68
  102. package/umd/xpath/xpath-token-rule.d.ts +0 -7
  103. package/umd/xpath/xpath.d.ts +0 -174
  104. package/umd/xpathdebug.d.ts +0 -2
  105. package/umd/xslt/index.d.ts +0 -3
  106. package/umd/xslt/xslt-decimal-format-settings.d.ts +0 -28
  107. package/umd/xslt/xslt-options.d.ts +0 -7
  108. package/umd/xslt/xslt-parameter.d.ts +0 -5
  109. package/umd/xslt/xslt.d.ts +0 -275
  110. package/umd/xslt-processor.js +0 -2
  111. package/umd/xslt-processor.js.map +0 -1
  112. package/xpath/common-function.d.ts +0 -8
  113. package/xpath/common-function.js +0 -32
  114. package/xpath/common-function.js.map +0 -1
  115. package/xpath/expr-context.d.ts +0 -116
  116. package/xpath/expr-context.js +0 -191
  117. package/xpath/expr-context.js.map +0 -1
  118. package/xpath/expressions/binary-expr.d.ts +0 -11
  119. package/xpath/expressions/binary-expr.js +0 -166
  120. package/xpath/expressions/binary-expr.js.map +0 -1
  121. package/xpath/expressions/expression.d.ts +0 -4
  122. package/xpath/expressions/expression.js +0 -10
  123. package/xpath/expressions/expression.js.map +0 -1
  124. package/xpath/expressions/filter-expr.d.ts +0 -9
  125. package/xpath/expressions/filter-expr.js +0 -53
  126. package/xpath/expressions/filter-expr.js.map +0 -1
  127. package/xpath/expressions/function-call-expr.d.ts +0 -12
  128. package/xpath/expressions/function-call-expr.js +0 -97
  129. package/xpath/expressions/function-call-expr.js.map +0 -1
  130. package/xpath/expressions/index.d.ts +0 -13
  131. package/xpath/expressions/index.js +0 -30
  132. package/xpath/expressions/index.js.map +0 -1
  133. package/xpath/expressions/literal-expr.d.ts +0 -7
  134. package/xpath/expressions/literal-expr.js +0 -34
  135. package/xpath/expressions/literal-expr.js.map +0 -1
  136. package/xpath/expressions/location-expr.d.ts +0 -15
  137. package/xpath/expressions/location-expr.js +0 -99
  138. package/xpath/expressions/location-expr.js.map +0 -1
  139. package/xpath/expressions/number-expr.d.ts +0 -7
  140. package/xpath/expressions/number-expr.js +0 -34
  141. package/xpath/expressions/number-expr.js.map +0 -1
  142. package/xpath/expressions/path-expr.d.ts +0 -9
  143. package/xpath/expressions/path-expr.js +0 -52
  144. package/xpath/expressions/path-expr.js.map +0 -1
  145. package/xpath/expressions/predicate-expr.d.ts +0 -8
  146. package/xpath/expressions/predicate-expr.js +0 -41
  147. package/xpath/expressions/predicate-expr.js.map +0 -1
  148. package/xpath/expressions/step-expr.d.ts +0 -25
  149. package/xpath/expressions/step-expr.js +0 -281
  150. package/xpath/expressions/step-expr.js.map +0 -1
  151. package/xpath/expressions/token-expr.d.ts +0 -7
  152. package/xpath/expressions/token-expr.js +0 -34
  153. package/xpath/expressions/token-expr.js.map +0 -1
  154. package/xpath/expressions/unary-minus-expr.d.ts +0 -8
  155. package/xpath/expressions/unary-minus-expr.js +0 -34
  156. package/xpath/expressions/unary-minus-expr.js.map +0 -1
  157. package/xpath/expressions/union-expr.d.ts +0 -9
  158. package/xpath/expressions/union-expr.js +0 -51
  159. package/xpath/expressions/union-expr.js.map +0 -1
  160. package/xpath/expressions/variable-expr.d.ts +0 -7
  161. package/xpath/expressions/variable-expr.js +0 -33
  162. package/xpath/expressions/variable-expr.js.map +0 -1
  163. package/xpath/functions/index.d.ts +0 -4
  164. package/xpath/functions/index.js +0 -21
  165. package/xpath/functions/index.js.map +0 -1
  166. package/xpath/functions/internal-functions.d.ts +0 -2
  167. package/xpath/functions/internal-functions.js +0 -22
  168. package/xpath/functions/internal-functions.js.map +0 -1
  169. package/xpath/functions/non-standard.d.ts +0 -12
  170. package/xpath/functions/non-standard.js +0 -45
  171. package/xpath/functions/non-standard.js.map +0 -1
  172. package/xpath/functions/standard-20.d.ts +0 -5
  173. package/xpath/functions/standard-20.js +0 -26
  174. package/xpath/functions/standard-20.js.map +0 -1
  175. package/xpath/functions/standard.d.ts +0 -40
  176. package/xpath/functions/standard.js +0 -442
  177. package/xpath/functions/standard.js.map +0 -1
  178. package/xpath/functions/xslt-specific.d.ts +0 -3
  179. package/xpath/functions/xslt-specific.js +0 -14
  180. package/xpath/functions/xslt-specific.js.map +0 -1
  181. package/xpath/grammar-rule-candidate.d.ts +0 -8
  182. package/xpath/grammar-rule-candidate.js +0 -3
  183. package/xpath/grammar-rule-candidate.js.map +0 -1
  184. package/xpath/index.d.ts +0 -3
  185. package/xpath/index.js +0 -20
  186. package/xpath/index.js.map +0 -1
  187. package/xpath/match-resolver.d.ts +0 -55
  188. package/xpath/match-resolver.js +0 -137
  189. package/xpath/match-resolver.js.map +0 -1
  190. package/xpath/node-tests/index.d.ts +0 -8
  191. package/xpath/node-tests/index.js +0 -18
  192. package/xpath/node-tests/index.js.map +0 -1
  193. package/xpath/node-tests/node-test-any.d.ts +0 -6
  194. package/xpath/node-tests/node-test-any.js +0 -15
  195. package/xpath/node-tests/node-test-any.js.map +0 -1
  196. package/xpath/node-tests/node-test-comment.d.ts +0 -6
  197. package/xpath/node-tests/node-test-comment.js +0 -15
  198. package/xpath/node-tests/node-test-comment.js.map +0 -1
  199. package/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
  200. package/xpath/node-tests/node-test-element-or-attribute.js +0 -16
  201. package/xpath/node-tests/node-test-element-or-attribute.js.map +0 -1
  202. package/xpath/node-tests/node-test-name.d.ts +0 -10
  203. package/xpath/node-tests/node-test-name.js +0 -39
  204. package/xpath/node-tests/node-test-name.js.map +0 -1
  205. package/xpath/node-tests/node-test-nc.d.ts +0 -9
  206. package/xpath/node-tests/node-test-nc.js +0 -17
  207. package/xpath/node-tests/node-test-nc.js.map +0 -1
  208. package/xpath/node-tests/node-test-pi.d.ts +0 -8
  209. package/xpath/node-tests/node-test-pi.js +0 -17
  210. package/xpath/node-tests/node-test-pi.js.map +0 -1
  211. package/xpath/node-tests/node-test-text.d.ts +0 -6
  212. package/xpath/node-tests/node-test-text.js +0 -15
  213. package/xpath/node-tests/node-test-text.js.map +0 -1
  214. package/xpath/node-tests/node-test.d.ts +0 -5
  215. package/xpath/node-tests/node-test.js +0 -3
  216. package/xpath/node-tests/node-test.js.map +0 -1
  217. package/xpath/tokens.d.ts +0 -62
  218. package/xpath/tokens.js +0 -301
  219. package/xpath/tokens.js.map +0 -1
  220. package/xpath/values/boolean-value.d.ts +0 -11
  221. package/xpath/values/boolean-value.js +0 -24
  222. package/xpath/values/boolean-value.js.map +0 -1
  223. package/xpath/values/index.d.ts +0 -5
  224. package/xpath/values/index.js +0 -47
  225. package/xpath/values/index.js.map +0 -1
  226. package/xpath/values/node-set-value.d.ts +0 -11
  227. package/xpath/values/node-set-value.js +0 -28
  228. package/xpath/values/node-set-value.js.map +0 -1
  229. package/xpath/values/node-value.d.ts +0 -7
  230. package/xpath/values/node-value.js +0 -3
  231. package/xpath/values/node-value.js.map +0 -1
  232. package/xpath/values/number-value.d.ts +0 -11
  233. package/xpath/values/number-value.js +0 -24
  234. package/xpath/values/number-value.js.map +0 -1
  235. package/xpath/values/string-value.d.ts +0 -11
  236. package/xpath/values/string-value.js +0 -24
  237. package/xpath/values/string-value.js.map +0 -1
  238. package/xpath/xpath-grammar-rules.d.ts +0 -68
  239. package/xpath/xpath-grammar-rules.js +0 -75
  240. package/xpath/xpath-grammar-rules.js.map +0 -1
  241. package/xpath/xpath-token-rule.d.ts +0 -7
  242. package/xpath/xpath-token-rule.js +0 -3
  243. package/xpath/xpath-token-rule.js.map +0 -1
  244. package/xpath/xpath.d.ts +0 -174
  245. package/xpath/xpath.js +0 -912
  246. package/xpath/xpath.js.map +0 -1
  247. package/xpathdebug.d.ts +0 -2
  248. package/xpathdebug.js +0 -188
  249. package/xpathdebug.js.map +0 -1
  250. package/xslt/index.d.ts +0 -3
  251. package/xslt/index.js +0 -20
  252. package/xslt/index.js.map +0 -1
  253. package/xslt/xslt-decimal-format-settings.d.ts +0 -28
  254. package/xslt/xslt-decimal-format-settings.js +0 -3
  255. package/xslt/xslt-decimal-format-settings.js.map +0 -1
  256. package/xslt/xslt-options.d.ts +0 -7
  257. package/xslt/xslt-options.js +0 -3
  258. package/xslt/xslt-options.js.map +0 -1
  259. package/xslt/xslt-parameter.d.ts +0 -5
  260. package/xslt/xslt-parameter.js +0 -3
  261. package/xslt/xslt-parameter.js.map +0 -1
  262. package/xslt/xslt.d.ts +0 -275
  263. package/xslt/xslt.js +0 -1329
  264. package/xslt/xslt.js.map +0 -1
@@ -1,2 +0,0 @@
1
- export declare function assert(b: any): void;
2
- export declare function regExpEscape(text: string): string;
@@ -1,12 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeSetValue, StringValue } from "../values";
3
- export declare function extCardinal(context: ExprContext): NodeSetValue;
4
- /**
5
- * evaluates and returns its second argument, if the
6
- * boolean value of its first argument is true, otherwise it
7
- * evaluates and returns its third argument.
8
- * @param context The Expression Context
9
- * @returns A `BooleanValue`.
10
- */
11
- export declare function extIf(context: ExprContext): any;
12
- export declare function extJoin(context: ExprContext): StringValue;
@@ -1,5 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { StringValue } from "../values";
3
- export declare function upperCase(context: ExprContext): StringValue;
4
- export declare function lowerCase(context: ExprContext): StringValue;
5
- export declare function _replace(context: ExprContext): StringValue;
@@ -1,40 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { BooleanValue, NodeSetValue, NumberValue, StringValue } from "../values";
3
- export declare function boolean(context: ExprContext): BooleanValue;
4
- export declare function ceiling(context: ExprContext): NumberValue;
5
- export declare function concat(context: ExprContext): StringValue;
6
- export declare function contains(context: ExprContext): BooleanValue;
7
- export declare function count(context: ExprContext): NumberValue;
8
- export declare function current(context: ExprContext): NodeSetValue;
9
- export declare function endsWith(context: ExprContext): BooleanValue;
10
- export declare function _false(): BooleanValue;
11
- /**
12
- * XPath `format-number` function implementation.
13
- * @param context The Expression Context.
14
- * @returns A formatted number as string.
15
- */
16
- export declare function formatNumber(context: ExprContext): StringValue;
17
- export declare function floor(context: ExprContext): NumberValue;
18
- export declare function generateId(context: ExprContext): StringValue;
19
- export declare function id(context: ExprContext): NodeSetValue;
20
- export declare function lang(context: ExprContext): BooleanValue;
21
- export declare function last(context: ExprContext): NumberValue;
22
- export declare function localName(context: ExprContext): StringValue;
23
- export declare function matches(context: ExprContext): BooleanValue;
24
- export declare function _name(context: ExprContext): StringValue;
25
- export declare function namespaceUri(context: ExprContext): StringValue;
26
- export declare function normalizeSpace(context: ExprContext): StringValue;
27
- export declare function not(context: ExprContext): BooleanValue;
28
- export declare function number(context: ExprContext): NumberValue;
29
- export declare function position(context: ExprContext): NumberValue;
30
- export declare function round(context: ExprContext): NumberValue;
31
- export declare function startsWith(context: ExprContext): BooleanValue;
32
- export declare function _string(context: ExprContext): StringValue;
33
- export declare function stringLength(context: ExprContext): NumberValue;
34
- export declare function substring(context: ExprContext): StringValue;
35
- export declare function substringAfter(context: ExprContext): StringValue;
36
- export declare function substringBefore(context: ExprContext): StringValue;
37
- export declare function sum(context: ExprContext): NumberValue;
38
- export declare function translate(context: ExprContext): StringValue;
39
- export declare function _true(): BooleanValue;
40
- export declare function xmlToJson(context: ExprContext): StringValue;
@@ -1,3 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeValue } from "../values";
3
- export declare function key(context: ExprContext): NodeValue;
@@ -1,8 +0,0 @@
1
- import { XPathTokenRule } from "./xpath-token-rule";
2
- export type GrammarRuleCandidate = {
3
- tag: XPathTokenRule;
4
- rule?: any;
5
- match: any;
6
- prec?: number;
7
- expr?: any;
8
- };
@@ -1,3 +0,0 @@
1
- export * from './expr-context';
2
- export * from './xpath';
3
- export * from './xpath-token-rule';
@@ -1,55 +0,0 @@
1
- import { XNode } from "../dom";
2
- import { ExprContext } from "./expr-context";
3
- import { Expression } from "./expressions/expression";
4
- /**
5
- * Class that resolves XPath expressions, returning nodes.
6
- */
7
- export declare class MatchResolver {
8
- /**
9
- * This class entry point.
10
- * @param expression The expression to be resolved.
11
- * @param context The Expression Context
12
- * @returns An array of nodes.
13
- */
14
- expressionMatch(expression: Expression, context: ExprContext): XNode[];
15
- /**
16
- * Resolves a `LocationExpr`.
17
- * @param expression The Location Expression.
18
- * @param context The Expression Context.
19
- * @returns Either the results of a relative resolution, or the results of an
20
- * absolute resolution.
21
- */
22
- private locationExpressionMatch;
23
- /**
24
- * Resolves a `UnionExpr`.
25
- * @param expression The Union Expression.
26
- * @param context The Expression Context.
27
- * @returns The concatenated result of evaluating the both sides of the expression.
28
- */
29
- private unionExpressionMatch;
30
- /**
31
- * Finds all the nodes through absolute XPath search, starting on
32
- * the #document parent node.
33
- * @param expression The Expression.
34
- * @param context The Expression Context.
35
- * @returns The list of found nodes.
36
- */
37
- private absoluteXsltMatchByDocumentNode;
38
- /**
39
- * Finds all the nodes through absolute xPath search, starting with the
40
- * first child of the #document node.
41
- * @param expression The Expression.
42
- * @param context The Expression Context.
43
- * @returns The list of found nodes.
44
- */
45
- private absoluteXsltMatch;
46
- /**
47
- * Tries to find relative nodes from the actual context position.
48
- * If found nodes are already in the context, or if they are children of
49
- * nodes in the context, they are returned.
50
- * @param expression The expression used.
51
- * @param context The Expression Context.
52
- * @returns The list of found nodes.
53
- */
54
- private relativeXsltMatch;
55
- }
@@ -1,8 +0,0 @@
1
- export { NodeTest } from './node-test';
2
- export { NodeTestAny } from './node-test-any';
3
- export { NodeTestComment } from './node-test-comment';
4
- export { NodeTestElementOrAttribute } from './node-test-element-or-attribute';
5
- export { NodeTestName } from './node-test-name';
6
- export { NodeTestNC } from './node-test-nc';
7
- export { NodeTestPI } from './node-test-pi';
8
- export { NodeTestText } from './node-test-text';
@@ -1,6 +0,0 @@
1
- import { NodeTest } from "./node-test";
2
- export declare class NodeTestAny implements NodeTest {
3
- value: any;
4
- constructor();
5
- evaluate(): any;
6
- }
@@ -1,6 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeTest } from "./node-test";
3
- import { BooleanValue } from "../values/boolean-value";
4
- export declare class NodeTestComment implements NodeTest {
5
- evaluate(ctx: ExprContext): BooleanValue;
6
- }
@@ -1,6 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { BooleanValue } from "../values/boolean-value";
3
- import { NodeTest } from "./node-test";
4
- export declare class NodeTestElementOrAttribute implements NodeTest {
5
- evaluate(context: ExprContext): BooleanValue;
6
- }
@@ -1,10 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeValue } from "../values";
3
- import { NodeTest } from "./node-test";
4
- export declare class NodeTestName implements NodeTest {
5
- name: string;
6
- namespacePrefix: string;
7
- re: RegExp;
8
- constructor(name: string);
9
- evaluate(context: ExprContext): NodeValue;
10
- }
@@ -1,9 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeTest } from "./node-test";
3
- import { BooleanValue } from "../values/boolean-value";
4
- export declare class NodeTestNC implements NodeTest {
5
- regex: RegExp;
6
- nsprefix: any;
7
- constructor(nsprefix: string);
8
- evaluate(ctx: ExprContext): BooleanValue;
9
- }
@@ -1,8 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { BooleanValue } from "../values/boolean-value";
3
- import { NodeTest } from "./node-test";
4
- export declare class NodeTestPI implements NodeTest {
5
- target: any;
6
- constructor(target: any);
7
- evaluate(context: ExprContext): BooleanValue;
8
- }
@@ -1,6 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { BooleanValue } from "../values/boolean-value";
3
- import { NodeTest } from "./node-test";
4
- export declare class NodeTestText implements NodeTest {
5
- evaluate(ctx: ExprContext): BooleanValue;
6
- }
@@ -1,5 +0,0 @@
1
- import { ExprContext } from "../expr-context";
2
- import { NodeValue } from "../values";
3
- export interface NodeTest {
4
- evaluate(_ctx: ExprContext): NodeValue;
5
- }
@@ -1,62 +0,0 @@
1
- import { XPathTokenRule } from "./xpath-token-rule";
2
- export declare const xPathAxis: {
3
- ANCESTOR_OR_SELF: string;
4
- ANCESTOR: string;
5
- ATTRIBUTE: string;
6
- CHILD: string;
7
- DESCENDANT_OR_SELF: string;
8
- DESCENDANT: string;
9
- FOLLOWING_SIBLING: string;
10
- FOLLOWING: string;
11
- NAMESPACE: string;
12
- PARENT: string;
13
- PRECEDING_SIBLING: string;
14
- PRECEDING: string;
15
- SELF: string;
16
- SELF_AND_SIBLINGS: string;
17
- };
18
- export declare const TOK_PIPE: XPathTokenRule;
19
- export declare const TOK_DSLASH: XPathTokenRule;
20
- export declare const TOK_SLASH: XPathTokenRule;
21
- export declare const TOK_AXIS: XPathTokenRule;
22
- export declare const TOK_COLON: XPathTokenRule;
23
- export declare const TOK_AXISNAME: XPathTokenRule;
24
- export declare const TOK_PARENO: XPathTokenRule;
25
- export declare const TOK_PARENC: XPathTokenRule;
26
- export declare const TOK_DDOT: XPathTokenRule;
27
- export declare const TOK_DOT: XPathTokenRule;
28
- export declare const TOK_AT: XPathTokenRule;
29
- export declare const TOK_COMMA: XPathTokenRule;
30
- export declare const TOK_OR: XPathTokenRule;
31
- export declare const TOK_AND: XPathTokenRule;
32
- export declare const TOK_EQ: XPathTokenRule;
33
- export declare const TOK_NEQ: XPathTokenRule;
34
- export declare const TOK_GE: XPathTokenRule;
35
- export declare const TOK_GT: XPathTokenRule;
36
- export declare const TOK_LE: XPathTokenRule;
37
- export declare const TOK_LT: XPathTokenRule;
38
- export declare const TOK_PLUS: XPathTokenRule;
39
- export declare const TOK_MINUS: XPathTokenRule;
40
- export declare const TOK_DIV: XPathTokenRule;
41
- export declare const TOK_MOD: XPathTokenRule;
42
- export declare const TOK_BRACKO: XPathTokenRule;
43
- export declare const TOK_BRACKC: XPathTokenRule;
44
- export declare const TOK_DOLLAR: XPathTokenRule;
45
- export declare const TOK_NCNAME: XPathTokenRule;
46
- export declare const TOK_ASTERISK: XPathTokenRule;
47
- export declare const TOK_LITERALQ: XPathTokenRule;
48
- export declare const TOK_LITERALQQ: XPathTokenRule;
49
- export declare const TOK_NUMBER: XPathTokenRule;
50
- export declare const TOK_QNAME: XPathTokenRule;
51
- export declare const TOK_NODEO: XPathTokenRule;
52
- export declare const xPathTokenRules: XPathTokenRule[];
53
- export declare const Q_ZERO_OR_ONE: {
54
- label: string;
55
- };
56
- export declare const Q_ZERO_OR_MULTIPLE: {
57
- label: string;
58
- };
59
- export declare const Q_ONE_OR_MULTIPLE: {
60
- label: string;
61
- };
62
- export declare const ASSOC_LEFT = true;
@@ -1,11 +0,0 @@
1
- import { XNode } from "../../dom";
2
- import { NodeValue } from "./node-value";
3
- export declare class BooleanValue implements NodeValue {
4
- value: any;
5
- type: string;
6
- constructor(value: any);
7
- stringValue(): string;
8
- booleanValue(): any;
9
- numberValue(): 1 | 0;
10
- nodeSetValue(): XNode[];
11
- }
@@ -1,5 +0,0 @@
1
- export * from './boolean-value';
2
- export * from './node-set-value';
3
- export * from './node-value';
4
- export * from './number-value';
5
- export * from './string-value';
@@ -1,11 +0,0 @@
1
- import { XNode } from "../../dom";
2
- import { NodeValue } from "./node-value";
3
- export declare class NodeSetValue implements NodeValue {
4
- value: XNode[];
5
- type: string;
6
- constructor(value: XNode[]);
7
- stringValue(): string;
8
- booleanValue(): boolean;
9
- numberValue(): number;
10
- nodeSetValue(): XNode[];
11
- }
@@ -1,7 +0,0 @@
1
- import { XNode } from "../../dom";
2
- export interface NodeValue {
3
- stringValue(): string;
4
- booleanValue(): boolean;
5
- numberValue(): number;
6
- nodeSetValue(): XNode[];
7
- }
@@ -1,11 +0,0 @@
1
- import { XNode } from "../../dom";
2
- import { NodeValue } from "./node-value";
3
- export declare class NumberValue implements NodeValue {
4
- value: any;
5
- type: string;
6
- constructor(value: any);
7
- stringValue(): string;
8
- booleanValue(): boolean;
9
- numberValue(): number;
10
- nodeSetValue(): XNode[];
11
- }
@@ -1,11 +0,0 @@
1
- import { XNode } from "../../dom";
2
- import { NodeValue } from "./node-value";
3
- export declare class StringValue implements NodeValue {
4
- value: any;
5
- type: string;
6
- constructor(value: any);
7
- stringValue(): string;
8
- booleanValue(): boolean;
9
- numberValue(): number;
10
- nodeSetValue(): XNode[];
11
- }
@@ -1,68 +0,0 @@
1
- export declare const XPathLocationPath: {
2
- label: string;
3
- key: any;
4
- };
5
- export declare const XPathRelativeLocationPath: {
6
- label: string;
7
- key: any;
8
- };
9
- export declare const XPathAbsoluteLocationPath: {
10
- label: string;
11
- key: any;
12
- };
13
- export declare const XPathStep: {
14
- label: string;
15
- key: any;
16
- };
17
- export declare const XPathNodeTest: {
18
- label: string;
19
- key: any;
20
- };
21
- export declare const XPathPredicate: {
22
- label: string;
23
- key: any;
24
- };
25
- export declare const XPathLiteral: {
26
- label: string;
27
- key: any;
28
- };
29
- export declare const XPathExpr: {
30
- label: string;
31
- key: any;
32
- };
33
- export declare const XPathPrimaryExpr: {
34
- label: string;
35
- key: any;
36
- };
37
- export declare const XPathVariableReference: {
38
- label: string;
39
- key: any;
40
- };
41
- export declare const XPathNumber: {
42
- label: string;
43
- key: any;
44
- };
45
- export declare const XPathFunctionCall: {
46
- label: string;
47
- key: any;
48
- };
49
- export declare const XPathArgumentRemainder: {
50
- label: string;
51
- key: any;
52
- };
53
- export declare const XPathPathExpr: {
54
- label: string;
55
- key: any;
56
- };
57
- export declare const XPathUnionExpr: {
58
- label: string;
59
- key: any;
60
- };
61
- export declare const XPathFilterExpr: {
62
- label: string;
63
- key: any;
64
- };
65
- export declare const XPathDigits: {
66
- label: string;
67
- key: any;
68
- };
@@ -1,7 +0,0 @@
1
- export type XPathTokenRule = {
2
- label: string;
3
- prec?: number;
4
- re: RegExp;
5
- key?: any;
6
- left?: boolean;
7
- };
@@ -1,174 +0,0 @@
1
- import { ExprContext } from './expr-context';
2
- import { BinaryExpr, FunctionCallExpr, LiteralExpr, LocationExpr, NumberExpr, PathExpr, PredicateExpr, StepExpr, TokenExpr, UnaryMinusExpr, UnionExpr, VariableExpr } from './expressions';
3
- import { Expression } from './expressions/expression';
4
- import { XPathTokenRule } from './xpath-token-rule';
5
- import { XNode } from '../dom';
6
- import { NodeTestAny, NodeTestElementOrAttribute, NodeTestNC, NodeTestName, NodeTestText, NodeTestComment, NodeTestPI, NodeTest } from './node-tests';
7
- import { NodeValue } from './values';
8
- export declare class XPath {
9
- xPathParseCache: any;
10
- xPathRules: any[];
11
- xPathLog: (message: string) => void;
12
- lexerCount: number;
13
- parseCount: number;
14
- reduceCount: number;
15
- xPathGrammarRules: ((number | {
16
- label: string;
17
- key: any;
18
- } | (XPathTokenRule | {
19
- label: string;
20
- key: any;
21
- })[] | ((rel: any, slash: any, step: any) => any))[] | (number | {
22
- label: string;
23
- key: any;
24
- } | {
25
- label: string;
26
- key: any;
27
- }[] | ((nodeTest: any, axis?: string) => StepExpr))[] | (number | {
28
- label: string;
29
- key: any;
30
- } | {
31
- label: string;
32
- }[] | ((name: any, pareno: any, arg1: any, args: any) => FunctionCallExpr))[] | (number | {
33
- label: string;
34
- key: any;
35
- } | {
36
- label: string;
37
- }[] | ((expr: any, predicates: any) => any))[] | (number | boolean | {
38
- label: string;
39
- key: any;
40
- } | (XPathTokenRule | {
41
- label: string;
42
- key: any;
43
- })[] | ((expr1: any, op: any, expr2: any) => BinaryExpr))[])[];
44
- constructor();
45
- makeTokenExpr(m: any): TokenExpr;
46
- passExpr(e: any): any;
47
- makeLocationExpr1(slash: any, rel: any): any;
48
- makeLocationExpr2(dslash: any, rel: any): any;
49
- makeLocationExpr3(): LocationExpr;
50
- makeLocationExpr4(dslash: any): LocationExpr;
51
- makeLocationExpr5(step: any): LocationExpr;
52
- makeLocationExpr6(rel: any, slash: any, step: any): any;
53
- makeLocationExpr7(rel: any, dslash: any, step: any): any;
54
- makeStepExpr1(dot: any): StepExpr;
55
- makeStepExpr2(ddot: any): StepExpr;
56
- makeStepExpr3(axisname: any, axis: any, nodeTest: any): StepExpr;
57
- makeStepExpr4(at: any, nodeTest: any): StepExpr;
58
- makeStepExpr5(nodeTest: any, axis?: string): StepExpr;
59
- makeStepExpr6(step: any, predicate: any): any;
60
- makeAbbrevStep(abbrev: any): StepExpr;
61
- makeNodeTestExpr1(): NodeTestElementOrAttribute;
62
- makeNodeTestExpr2(ncname: any): NodeTestNC;
63
- makeNodeTestExpr3(qname: TokenExpr): NodeTestName;
64
- makeNodeTestExpr4(typeo: any): NodeTestAny | NodeTestComment | NodeTestPI | NodeTestText;
65
- makeNodeTestExpr5(typeo: any, target: any): NodeTestPI;
66
- makePredicateExpr(pareno: any, expression: any): PredicateExpr;
67
- makePrimaryExpr(pareno: any, expression: any): any;
68
- makeFunctionCallExpr1(name: any): FunctionCallExpr;
69
- makeFunctionCallExpr2(name: any, pareno: any, arg1: any, args: any): FunctionCallExpr;
70
- makeArgumentExpr(comma: any, expression: any): any;
71
- makeUnionExpr(expr1: Expression, pipe: TokenExpr, expr2: Expression): UnionExpr;
72
- makePathExpr1(filter: any, slash: any, rel: any): PathExpr;
73
- makePathExpr2(filter: any, dslash: any, rel: any): PathExpr;
74
- makeFilterExpr(expr: any, predicates: any): any;
75
- makeUnaryMinusExpr(minus: any, expr: any): UnaryMinusExpr;
76
- makeBinaryExpr(expr1: any, op: any, expr2: any): BinaryExpr;
77
- makeLiteralExpr(token: any): LiteralExpr;
78
- makeNumberExpr(token: any): NumberExpr;
79
- makeVariableReference(dollar: any, name: any): VariableExpr;
80
- /**
81
- * Used before parsing for optimization of common simple cases. See
82
- * the begin of xPathParse() for which they are.
83
- * @param expression The XPath expression.
84
- * @param axis The axis, if required. Default is 'child'.
85
- * @returns An `Expression` object.
86
- */
87
- makeSimpleExpr(expression: string, axis?: string): Expression;
88
- makeSimpleExpr2(expr: any): LocationExpr;
89
- stackToString(stack: any[]): string;
90
- xPathCacheLookup(expr: any): any;
91
- xPathCollectDescendants(nodeList: XNode[], node: XNode, opt_tagName?: string): void;
92
- xPathCollectDescendantsReverse(nodeList: any, node: any): void;
93
- /**
94
- * Parses and then evaluates the given XPath expression in the given
95
- * input context.
96
- * @param select The xPath string.
97
- * @param context The Expression Context.
98
- * @returns A Node Value.
99
- */
100
- xPathEval(select: string, context: ExprContext): NodeValue;
101
- /**
102
- * DGF - extract a tag name suitable for getElementsByTagName
103
- *
104
- * @param nodeTest the node test
105
- * @param ignoreNonElementNodesForNTA if true, the node list returned when
106
- * evaluating "node()" will not contain
107
- * non-element nodes. This can boost
108
- * performance. This is false by default.
109
- */
110
- xPathExtractTagNameFromNodeTest(nodeTest: NodeTest, ignoreNonElementNodesForNTA: any): string;
111
- xPathMatchStack(stack: any[], pattern: any[]): any;
112
- /**
113
- * Finds the best rule for the XPath expression provided.
114
- * @param expression The XPath string expression.
115
- * @param previous The previous matched XPath rule.
116
- * @returns The found rule and the corresponding match.
117
- */
118
- private findXPathRuleForExpression;
119
- /**
120
- * Initialization for `xPathParse`.
121
- * @see xPathParse
122
- */
123
- private xPathParseInit;
124
- /**
125
- * The entry point for the parser.
126
- * @param expression a string that contains an XPath expression.
127
- * @param axis The XPath axis. Used when the match does not start with the parent.
128
- * @returns an expression object that can be evaluated with an
129
- * expression context.
130
- */
131
- xPathParse(expression: string, axis?: string): any;
132
- private findGrammarRuleCandidate;
133
- /**
134
- * DGF xPathReduce is where the magic happens in this parser.
135
- * Check `src\xpath\xpath-grammar-rules.ts` to find the table of
136
- * grammatical rules and precedence numbers, "The productions of the grammar".
137
- *
138
- * The idea here is that we want to take a stack of tokens and apply
139
- * grammatical rules to them, "reducing" them to higher-level
140
- * tokens. Ultimately, any valid XPath should reduce to exactly one
141
- * "Expr" token.
142
- *
143
- * Reduce too early or too late, and you'll have two tokens that can't reduce
144
- * to single Expr. For example, you may hastily reduce a qname that
145
- * should name a function, incorrectly treating it as a tag name.
146
- * Or you may reduce too late, accidentally reducing the last part of the
147
- * XPath into a top-level "Expr" that won't reduce with earlier parts of
148
- * the XPath.
149
- *
150
- * A "candidate" is a grammatical rule candidate, with a given precedence
151
- * number. "ahead" is the upcoming token, which also has a precedence
152
- * number. If the token has a higher precedence number than
153
- * the rule candidate, we'll "shift" the token onto the token stack,
154
- * instead of immediately applying the rule candidate.
155
- *
156
- * Some tokens have left associativity, in which case we shift when they
157
- * have LOWER precedence than the candidate.
158
- * @param stack The actual grammar rule stack.
159
- * @param ahead The grammar rule ahead.
160
- * @return `true` if a grammar rule candidate was applied. `false` otherwise.
161
- * @private
162
- */
163
- private xPathReduce;
164
- /**
165
- * Utility function to sort a list of nodes. Used by xsltSort().
166
- * @param context The Expression Context.
167
- * @param sort TODO
168
- */
169
- xPathSort(context: ExprContext, sort: any[]): void;
170
- xPathSortByKey(v1: any, v2: any): number;
171
- xPathStep(nodes: any[], steps: any[], step: any, input: XNode, context: ExprContext): void;
172
- xPathGrammarPrecedence(frame: any): number;
173
- xPathTokenPrecedence(tag: any): any;
174
- }
@@ -1,2 +0,0 @@
1
- export declare let parseTree: (expr: any, indent: any) => any;
2
- export declare let toString: (expr: any) => any;
@@ -1,3 +0,0 @@
1
- export * from './xslt-options';
2
- export * from './xslt-parameter';
3
- export * from './xslt';
@@ -1,28 +0,0 @@
1
- /**
2
- * According to https://www.w3schools.com/xml/ref_xsl_el_decimal-format.asp:
3
- *
4
- * @property {string} name: Optional. Specifies a name for this format.
5
- * @property {string} decimalSeparator: Optional. Specifies the decimal point character. Default is ".".
6
- * @property {string} groupingSeparator: Optional. Specifies the thousands separator character. Default is ",".
7
- * @property {string} infinity: Optional. Specifies the string used to represent infinity. Default is "Infinity".
8
- * @property {string} minusSign: Optional. Specifies the character to represent negative numbers. Default is "-".
9
- * @property {string} naN: Optional. Specifies the string used when the value is not a number". Default is "NaN".
10
- * @property {string} percent: Optional. Specifies the percentage sign character. Default is "%".
11
- * @property {string} perMille: Optional. Specifies the per thousand sign character. Default is "‰".
12
- * @property {string} zeroDigit: Optional. Specifies the digit zero character. Default is "0".
13
- * @property {string} digit: Optional. Specifies the character used to indicate a place where a digit is required. Default is #.
14
- * @property {string} patternSeparator: Optional. Specifies the character used to separate positive and negative subpatterns in a format pattern. Default is ";".
15
- */
16
- export type XsltDecimalFormatSettings = {
17
- name?: string;
18
- decimalSeparator: string;
19
- groupingSeparator: string;
20
- infinity: string;
21
- minusSign: string;
22
- naN: string;
23
- percent: string;
24
- perMille: string;
25
- zeroDigit: string;
26
- digit: string;
27
- patternSeparator: string;
28
- };
@@ -1,7 +0,0 @@
1
- import { XsltParameter } from "./xslt-parameter";
2
- export type XsltOptions = {
3
- cData: boolean;
4
- escape: boolean;
5
- selfClosingTags: boolean;
6
- parameters?: XsltParameter[];
7
- };
@@ -1,5 +0,0 @@
1
- export type XsltParameter = {
2
- name: string;
3
- namespaceUri?: string;
4
- value: any;
5
- };