xslt-processor 3.4.0 → 4.1.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 (265) hide show
  1. package/README.md +48 -0
  2. package/index.d.mts +861 -0
  3. package/index.d.ts +861 -4
  4. package/index.js +4570 -12
  5. package/index.js.map +1 -1
  6. package/index.mjs +4534 -0
  7. package/index.mjs.map +1 -0
  8. package/package.json +23 -18
  9. package/umd/xslt-processor.global.js +9 -0
  10. package/umd/xslt-processor.global.js.map +1 -0
  11. package/constants.d.ts +0 -12
  12. package/constants.js +0 -17
  13. package/constants.js.map +0 -1
  14. package/dom/functions.d.ts +0 -14
  15. package/dom/functions.js +0 -57
  16. package/dom/functions.js.map +0 -1
  17. package/dom/index.d.ts +0 -7
  18. package/dom/index.js +0 -24
  19. package/dom/index.js.map +0 -1
  20. package/dom/util.d.ts +0 -7
  21. package/dom/util.js +0 -43
  22. package/dom/util.js.map +0 -1
  23. package/dom/xbrowser-node.d.ts +0 -9
  24. package/dom/xbrowser-node.js +0 -32
  25. package/dom/xbrowser-node.js.map +0 -1
  26. package/dom/xdocument.d.ts +0 -16
  27. package/dom/xdocument.js +0 -74
  28. package/dom/xdocument.js.map +0 -1
  29. package/dom/xml-functions.d.ts +0 -73
  30. package/dom/xml-functions.js +0 -402
  31. package/dom/xml-functions.js.map +0 -1
  32. package/dom/xml-output-options.d.ts +0 -6
  33. package/dom/xml-output-options.js +0 -3
  34. package/dom/xml-output-options.js.map +0 -1
  35. package/dom/xml-parser.d.ts +0 -47
  36. package/dom/xml-parser.js +0 -308
  37. package/dom/xml-parser.js.map +0 -1
  38. package/dom/xmltoken.d.ts +0 -12
  39. package/dom/xmltoken.js +0 -102
  40. package/dom/xmltoken.js.map +0 -1
  41. package/dom/xnode.d.ts +0 -73
  42. package/dom/xnode.js +0 -451
  43. package/dom/xnode.js.map +0 -1
  44. package/test-without-jest.d.ts +0 -1
  45. package/test-without-jest.js +0 -63
  46. package/test-without-jest.js.map +0 -1
  47. package/umd/constants.d.ts +0 -12
  48. package/umd/dom/functions.d.ts +0 -14
  49. package/umd/dom/index.d.ts +0 -7
  50. package/umd/dom/util.d.ts +0 -7
  51. package/umd/dom/xbrowser-node.d.ts +0 -9
  52. package/umd/dom/xdocument.d.ts +0 -16
  53. package/umd/dom/xml-functions.d.ts +0 -73
  54. package/umd/dom/xml-output-options.d.ts +0 -6
  55. package/umd/dom/xml-parser.d.ts +0 -47
  56. package/umd/dom/xmltoken.d.ts +0 -12
  57. package/umd/dom/xnode.d.ts +0 -73
  58. package/umd/index.d.ts +0 -4
  59. package/umd/test-without-jest.d.ts +0 -1
  60. package/umd/xpath/common-function.d.ts +0 -8
  61. package/umd/xpath/expr-context.d.ts +0 -116
  62. package/umd/xpath/expressions/binary-expr.d.ts +0 -11
  63. package/umd/xpath/expressions/expression.d.ts +0 -4
  64. package/umd/xpath/expressions/filter-expr.d.ts +0 -9
  65. package/umd/xpath/expressions/function-call-expr.d.ts +0 -12
  66. package/umd/xpath/expressions/index.d.ts +0 -13
  67. package/umd/xpath/expressions/literal-expr.d.ts +0 -7
  68. package/umd/xpath/expressions/location-expr.d.ts +0 -15
  69. package/umd/xpath/expressions/number-expr.d.ts +0 -7
  70. package/umd/xpath/expressions/path-expr.d.ts +0 -9
  71. package/umd/xpath/expressions/predicate-expr.d.ts +0 -8
  72. package/umd/xpath/expressions/step-expr.d.ts +0 -25
  73. package/umd/xpath/expressions/token-expr.d.ts +0 -7
  74. package/umd/xpath/expressions/unary-minus-expr.d.ts +0 -8
  75. package/umd/xpath/expressions/union-expr.d.ts +0 -9
  76. package/umd/xpath/expressions/variable-expr.d.ts +0 -7
  77. package/umd/xpath/functions/index.d.ts +0 -4
  78. package/umd/xpath/functions/internal-functions.d.ts +0 -2
  79. package/umd/xpath/functions/non-standard.d.ts +0 -12
  80. package/umd/xpath/functions/standard-20.d.ts +0 -5
  81. package/umd/xpath/functions/standard.d.ts +0 -40
  82. package/umd/xpath/functions/xslt-specific.d.ts +0 -3
  83. package/umd/xpath/grammar-rule-candidate.d.ts +0 -8
  84. package/umd/xpath/index.d.ts +0 -3
  85. package/umd/xpath/match-resolver.d.ts +0 -55
  86. package/umd/xpath/node-tests/index.d.ts +0 -8
  87. package/umd/xpath/node-tests/node-test-any.d.ts +0 -6
  88. package/umd/xpath/node-tests/node-test-comment.d.ts +0 -6
  89. package/umd/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
  90. package/umd/xpath/node-tests/node-test-name.d.ts +0 -10
  91. package/umd/xpath/node-tests/node-test-nc.d.ts +0 -9
  92. package/umd/xpath/node-tests/node-test-pi.d.ts +0 -8
  93. package/umd/xpath/node-tests/node-test-text.d.ts +0 -6
  94. package/umd/xpath/node-tests/node-test.d.ts +0 -5
  95. package/umd/xpath/tokens.d.ts +0 -62
  96. package/umd/xpath/values/boolean-value.d.ts +0 -11
  97. package/umd/xpath/values/index.d.ts +0 -5
  98. package/umd/xpath/values/node-set-value.d.ts +0 -11
  99. package/umd/xpath/values/node-value.d.ts +0 -7
  100. package/umd/xpath/values/number-value.d.ts +0 -11
  101. package/umd/xpath/values/string-value.d.ts +0 -11
  102. package/umd/xpath/xpath-grammar-rules.d.ts +0 -68
  103. package/umd/xpath/xpath-token-rule.d.ts +0 -7
  104. package/umd/xpath/xpath.d.ts +0 -174
  105. package/umd/xpathdebug.d.ts +0 -2
  106. package/umd/xslt/index.d.ts +0 -3
  107. package/umd/xslt/xslt-decimal-format-settings.d.ts +0 -28
  108. package/umd/xslt/xslt-options.d.ts +0 -7
  109. package/umd/xslt/xslt-parameter.d.ts +0 -5
  110. package/umd/xslt/xslt.d.ts +0 -275
  111. package/umd/xslt-processor.js +0 -2
  112. package/umd/xslt-processor.js.map +0 -1
  113. package/xpath/common-function.d.ts +0 -8
  114. package/xpath/common-function.js +0 -32
  115. package/xpath/common-function.js.map +0 -1
  116. package/xpath/expr-context.d.ts +0 -116
  117. package/xpath/expr-context.js +0 -191
  118. package/xpath/expr-context.js.map +0 -1
  119. package/xpath/expressions/binary-expr.d.ts +0 -11
  120. package/xpath/expressions/binary-expr.js +0 -166
  121. package/xpath/expressions/binary-expr.js.map +0 -1
  122. package/xpath/expressions/expression.d.ts +0 -4
  123. package/xpath/expressions/expression.js +0 -10
  124. package/xpath/expressions/expression.js.map +0 -1
  125. package/xpath/expressions/filter-expr.d.ts +0 -9
  126. package/xpath/expressions/filter-expr.js +0 -53
  127. package/xpath/expressions/filter-expr.js.map +0 -1
  128. package/xpath/expressions/function-call-expr.d.ts +0 -12
  129. package/xpath/expressions/function-call-expr.js +0 -97
  130. package/xpath/expressions/function-call-expr.js.map +0 -1
  131. package/xpath/expressions/index.d.ts +0 -13
  132. package/xpath/expressions/index.js +0 -30
  133. package/xpath/expressions/index.js.map +0 -1
  134. package/xpath/expressions/literal-expr.d.ts +0 -7
  135. package/xpath/expressions/literal-expr.js +0 -34
  136. package/xpath/expressions/literal-expr.js.map +0 -1
  137. package/xpath/expressions/location-expr.d.ts +0 -15
  138. package/xpath/expressions/location-expr.js +0 -99
  139. package/xpath/expressions/location-expr.js.map +0 -1
  140. package/xpath/expressions/number-expr.d.ts +0 -7
  141. package/xpath/expressions/number-expr.js +0 -34
  142. package/xpath/expressions/number-expr.js.map +0 -1
  143. package/xpath/expressions/path-expr.d.ts +0 -9
  144. package/xpath/expressions/path-expr.js +0 -52
  145. package/xpath/expressions/path-expr.js.map +0 -1
  146. package/xpath/expressions/predicate-expr.d.ts +0 -8
  147. package/xpath/expressions/predicate-expr.js +0 -41
  148. package/xpath/expressions/predicate-expr.js.map +0 -1
  149. package/xpath/expressions/step-expr.d.ts +0 -25
  150. package/xpath/expressions/step-expr.js +0 -281
  151. package/xpath/expressions/step-expr.js.map +0 -1
  152. package/xpath/expressions/token-expr.d.ts +0 -7
  153. package/xpath/expressions/token-expr.js +0 -34
  154. package/xpath/expressions/token-expr.js.map +0 -1
  155. package/xpath/expressions/unary-minus-expr.d.ts +0 -8
  156. package/xpath/expressions/unary-minus-expr.js +0 -34
  157. package/xpath/expressions/unary-minus-expr.js.map +0 -1
  158. package/xpath/expressions/union-expr.d.ts +0 -9
  159. package/xpath/expressions/union-expr.js +0 -51
  160. package/xpath/expressions/union-expr.js.map +0 -1
  161. package/xpath/expressions/variable-expr.d.ts +0 -7
  162. package/xpath/expressions/variable-expr.js +0 -33
  163. package/xpath/expressions/variable-expr.js.map +0 -1
  164. package/xpath/functions/index.d.ts +0 -4
  165. package/xpath/functions/index.js +0 -21
  166. package/xpath/functions/index.js.map +0 -1
  167. package/xpath/functions/internal-functions.d.ts +0 -2
  168. package/xpath/functions/internal-functions.js +0 -22
  169. package/xpath/functions/internal-functions.js.map +0 -1
  170. package/xpath/functions/non-standard.d.ts +0 -12
  171. package/xpath/functions/non-standard.js +0 -45
  172. package/xpath/functions/non-standard.js.map +0 -1
  173. package/xpath/functions/standard-20.d.ts +0 -5
  174. package/xpath/functions/standard-20.js +0 -26
  175. package/xpath/functions/standard-20.js.map +0 -1
  176. package/xpath/functions/standard.d.ts +0 -40
  177. package/xpath/functions/standard.js +0 -442
  178. package/xpath/functions/standard.js.map +0 -1
  179. package/xpath/functions/xslt-specific.d.ts +0 -3
  180. package/xpath/functions/xslt-specific.js +0 -14
  181. package/xpath/functions/xslt-specific.js.map +0 -1
  182. package/xpath/grammar-rule-candidate.d.ts +0 -8
  183. package/xpath/grammar-rule-candidate.js +0 -3
  184. package/xpath/grammar-rule-candidate.js.map +0 -1
  185. package/xpath/index.d.ts +0 -3
  186. package/xpath/index.js +0 -20
  187. package/xpath/index.js.map +0 -1
  188. package/xpath/match-resolver.d.ts +0 -55
  189. package/xpath/match-resolver.js +0 -137
  190. package/xpath/match-resolver.js.map +0 -1
  191. package/xpath/node-tests/index.d.ts +0 -8
  192. package/xpath/node-tests/index.js +0 -18
  193. package/xpath/node-tests/index.js.map +0 -1
  194. package/xpath/node-tests/node-test-any.d.ts +0 -6
  195. package/xpath/node-tests/node-test-any.js +0 -15
  196. package/xpath/node-tests/node-test-any.js.map +0 -1
  197. package/xpath/node-tests/node-test-comment.d.ts +0 -6
  198. package/xpath/node-tests/node-test-comment.js +0 -15
  199. package/xpath/node-tests/node-test-comment.js.map +0 -1
  200. package/xpath/node-tests/node-test-element-or-attribute.d.ts +0 -6
  201. package/xpath/node-tests/node-test-element-or-attribute.js +0 -16
  202. package/xpath/node-tests/node-test-element-or-attribute.js.map +0 -1
  203. package/xpath/node-tests/node-test-name.d.ts +0 -10
  204. package/xpath/node-tests/node-test-name.js +0 -39
  205. package/xpath/node-tests/node-test-name.js.map +0 -1
  206. package/xpath/node-tests/node-test-nc.d.ts +0 -9
  207. package/xpath/node-tests/node-test-nc.js +0 -17
  208. package/xpath/node-tests/node-test-nc.js.map +0 -1
  209. package/xpath/node-tests/node-test-pi.d.ts +0 -8
  210. package/xpath/node-tests/node-test-pi.js +0 -17
  211. package/xpath/node-tests/node-test-pi.js.map +0 -1
  212. package/xpath/node-tests/node-test-text.d.ts +0 -6
  213. package/xpath/node-tests/node-test-text.js +0 -15
  214. package/xpath/node-tests/node-test-text.js.map +0 -1
  215. package/xpath/node-tests/node-test.d.ts +0 -5
  216. package/xpath/node-tests/node-test.js +0 -3
  217. package/xpath/node-tests/node-test.js.map +0 -1
  218. package/xpath/tokens.d.ts +0 -62
  219. package/xpath/tokens.js +0 -301
  220. package/xpath/tokens.js.map +0 -1
  221. package/xpath/values/boolean-value.d.ts +0 -11
  222. package/xpath/values/boolean-value.js +0 -24
  223. package/xpath/values/boolean-value.js.map +0 -1
  224. package/xpath/values/index.d.ts +0 -5
  225. package/xpath/values/index.js +0 -47
  226. package/xpath/values/index.js.map +0 -1
  227. package/xpath/values/node-set-value.d.ts +0 -11
  228. package/xpath/values/node-set-value.js +0 -28
  229. package/xpath/values/node-set-value.js.map +0 -1
  230. package/xpath/values/node-value.d.ts +0 -7
  231. package/xpath/values/node-value.js +0 -3
  232. package/xpath/values/node-value.js.map +0 -1
  233. package/xpath/values/number-value.d.ts +0 -11
  234. package/xpath/values/number-value.js +0 -24
  235. package/xpath/values/number-value.js.map +0 -1
  236. package/xpath/values/string-value.d.ts +0 -11
  237. package/xpath/values/string-value.js +0 -24
  238. package/xpath/values/string-value.js.map +0 -1
  239. package/xpath/xpath-grammar-rules.d.ts +0 -68
  240. package/xpath/xpath-grammar-rules.js +0 -75
  241. package/xpath/xpath-grammar-rules.js.map +0 -1
  242. package/xpath/xpath-token-rule.d.ts +0 -7
  243. package/xpath/xpath-token-rule.js +0 -3
  244. package/xpath/xpath-token-rule.js.map +0 -1
  245. package/xpath/xpath.d.ts +0 -174
  246. package/xpath/xpath.js +0 -912
  247. package/xpath/xpath.js.map +0 -1
  248. package/xpathdebug.d.ts +0 -2
  249. package/xpathdebug.js +0 -188
  250. package/xpathdebug.js.map +0 -1
  251. package/xslt/index.d.ts +0 -3
  252. package/xslt/index.js +0 -20
  253. package/xslt/index.js.map +0 -1
  254. package/xslt/xslt-decimal-format-settings.d.ts +0 -28
  255. package/xslt/xslt-decimal-format-settings.js +0 -3
  256. package/xslt/xslt-decimal-format-settings.js.map +0 -1
  257. package/xslt/xslt-options.d.ts +0 -7
  258. package/xslt/xslt-options.js +0 -3
  259. package/xslt/xslt-options.js.map +0 -1
  260. package/xslt/xslt-parameter.d.ts +0 -5
  261. package/xslt/xslt-parameter.js +0 -3
  262. package/xslt/xslt-parameter.js.map +0 -1
  263. package/xslt/xslt.d.ts +0 -275
  264. package/xslt/xslt.js +0 -1329
  265. package/xslt/xslt.js.map +0 -1
@@ -1,275 +0,0 @@
1
- import { XDocument, XNode, XmlParser } from '../dom';
2
- import { ExprContext, XPath } from '../xpath';
3
- import { XsltOptions } from './xslt-options';
4
- import { XsltDecimalFormatSettings } from './xslt-decimal-format-settings';
5
- import { MatchResolver } from '../xpath/match-resolver';
6
- /**
7
- * The main class for XSL-T processing. The implementation is NOT
8
- * complete; some xsl element are left out.
9
- *
10
- * References:
11
- *
12
- * [XSLT] XSL-T Specification
13
- * <http://www.w3.org/TR/1999/REC-xslt-19991116>.
14
- *
15
- * [ECMA] ECMAScript Language Specification
16
- * <http://www.ecma-international.org/publications/standards/Ecma-262.htm>.
17
- *
18
- * The XSL processor API has one entry point, the function
19
- * `xsltProcess()`. It receives as arguments the starting point in the
20
- * input document as an XPath expression context, the DOM root node of
21
- * the XSL-T stylesheet, and a DOM node that receives the output.
22
- *
23
- * NOTE: Actually, XSL-T processing according to the specification is
24
- * defined as operation on text documents, not as operation on DOM
25
- * trees. So, strictly speaking, this implementation is not an XSL-T
26
- * processor, but the processing engine that needs to be complemented
27
- * by an XML parser and serializer in order to be complete. Those two
28
- * are found in the `dom` folder.
29
- */
30
- export declare class Xslt {
31
- xPath: XPath;
32
- xmlParser: XmlParser;
33
- matchResolver: MatchResolver;
34
- options: XsltOptions;
35
- decimalFormatSettings: XsltDecimalFormatSettings;
36
- outputDocument: XDocument;
37
- outputMethod: 'xml' | 'html' | 'text' | 'name' | 'xhtml';
38
- outputOmitXmlDeclaration: string;
39
- version: string;
40
- firstTemplateRan: boolean;
41
- constructor(options?: Partial<XsltOptions>);
42
- /**
43
- * The exported entry point of the XSL-T processor.
44
- * @param xmlDoc The input document root, as DOM node.
45
- * @param stylesheet The stylesheet document root, as DOM node.
46
- * @returns the processed document, as XML text in a string.
47
- */
48
- xsltProcess(xmlDoc: XDocument, stylesheet: XDocument): Promise<string>;
49
- /**
50
- * The main entry point of the XSL-T processor, as explained on the top of the file.
51
- * @param context The input document root, as XPath `ExprContext`.
52
- * @param template The stylesheet document root, as DOM node.
53
- * @param output If set, the output where the transformation should occur.
54
- */
55
- protected xsltProcessContext(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
56
- /**
57
- * Implements `xsl:apply-templates`.
58
- * @param context The Expression Context.
59
- * @param template The template.
60
- * @param output The output. Only used if there's no corresponding output node already defined.
61
- * @protected
62
- */
63
- protected xsltApplyTemplates(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
64
- /**
65
- * Implements `xsl:attribute`.
66
- * @param context The Expression Context.
67
- * @param template The template.
68
- * @param output The output. Only used if there's no corresponding output node already defined.
69
- * @protected
70
- */
71
- protected xsltAttribute(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
72
- /**
73
- * Implements `xsl:call-template`.
74
- * @param context The Expression Context.
75
- * @param template The template.
76
- * @param output The output, used when a fragment is passed by a previous step.
77
- */
78
- protected xsltCallTemplate(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
79
- /**
80
- * Implements `xsl:choose`, its child nodes `xsl:when`, and
81
- * `xsl:otherwise`.
82
- * @param context The Expression Context.
83
- * @param template The template.
84
- * @param output The output. Only used if there's no corresponding output node already defined.
85
- */
86
- protected xsltChoose(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
87
- /**
88
- * Implements `xsl:copy` for all node types.
89
- * @param {XNode} destination the node being copied to, part of output document.
90
- * @param {XNode} source the node being copied, part in input document.
91
- * @returns {XNode|null} If an element node was created, the element node. Otherwise, null.
92
- */
93
- protected xsltCopy(destination: XNode, source: XNode): XNode;
94
- /**
95
- * Implements `xsl:comment`.
96
- * @param context The Expression Context.
97
- * @param template The template.
98
- * @param output The output. Only used if there's no corresponding output node already defined.
99
- */
100
- protected xsltComment(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
101
- /**
102
- * Implements `xsl:copy-of` for node-set values of the select
103
- * expression. Recurses down the source node tree, which is part of
104
- * the input document.
105
- * @param {XNode} destination the node being copied to, part of output document.
106
- * @param {XNode} source the node being copied, part in input document.
107
- */
108
- protected xsltCopyOf(destination: XNode, source: XNode): void;
109
- /**
110
- * Implements `xsl:decimal-format`, registering the settings in this instance
111
- * and the current context.
112
- * @param context The Expression Context.
113
- * @param template The template.
114
- */
115
- protected xsltDecimalFormat(context: ExprContext, template: XNode): void;
116
- /**
117
- * Implements `xsl:element`.
118
- * @param context The Expression Context.
119
- * @param template The template.
120
- */
121
- protected xsltElement(context: ExprContext, template: XNode): Promise<void>;
122
- /**
123
- * Implements `xsl:for-each`.
124
- * @param context The Expression Context.
125
- * @param template The template.
126
- * @param output The output.
127
- */
128
- protected xsltForEach(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
129
- /**
130
- * Implements `xsl:if`.
131
- * @param context The Expression Context.
132
- * @param template The template.
133
- * @param output The output.
134
- */
135
- protected xsltIf(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
136
- /**
137
- * Implements `<xsl:import>`. For now the code is nearly identical to `<xsl:include>`, but there's
138
- * no precedence evaluation implemented yet.
139
- * @param context The Expression Context.
140
- * @param template The template.
141
- * @param output The output.
142
- */
143
- protected xsltImport(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
144
- /**
145
- * Implements `xsl:include`.
146
- * @param context The Expression Context.
147
- * @param template The template.
148
- * @param output The output.
149
- */
150
- protected xsltInclude(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
151
- /**
152
- * Implements `xsl:key`.
153
- * @param context The Expression Context.
154
- * @param template The template.
155
- */
156
- protected xsltKey(context: ExprContext, template: XNode): void;
157
- /**
158
- * Orders the current node list in the input context according to the
159
- * sort order specified by xsl:sort child nodes of the current
160
- * template node. This happens before the operation specified by the
161
- * current template node is executed.
162
- * @param context The expression context.
163
- * @param template The template node.
164
- * @todo case-order is not implemented.
165
- */
166
- protected xsltSort(context: ExprContext, template: XNode): void;
167
- /**
168
- * Implements `xsl:template`.
169
- * @param context The Expression Context.
170
- * @param template The `<xsl:template>` node.
171
- * @param output The output. In general, a fragment that will be used by
172
- * the caller.
173
- */
174
- protected xsltTemplate(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
175
- protected xsltText(context: ExprContext, template: XNode, output?: XNode): void;
176
- /**
177
- * Implements `<xsl:stylesheet>` and `<xsl:transform>`, and its corresponding
178
- * validations.
179
- * @param context The Expression Context.
180
- * @param template The `<xsl:stylesheet>` or `<xsl:transform>` node.
181
- * @param output The output. In general, a fragment that will be used by
182
- * the caller.
183
- */
184
- protected xsltTransformOrStylesheet(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
185
- protected xsltValueOf(context: ExprContext, template: XNode, output?: XNode): void;
186
- /**
187
- * Evaluates a variable or parameter and set it in the current input
188
- * context. Implements `xsl:variable`, `xsl:param`, and `xsl:with-param`.
189
- *
190
- * @param context The expression context.
191
- * @param template The template node.
192
- * @param override flag that defines if the value computed here
193
- * overrides the one already in the input context if that is the
194
- * case. I.e. decides if this is a default value or a local
195
- * value. `xsl:variable` and `xsl:with-param` override; `xsl:param` doesn't.
196
- */
197
- protected xsltVariable(context: ExprContext, template: XNode, override: boolean): Promise<void>;
198
- /**
199
- * Traverses the template node tree. Calls the main processing
200
- * function with the current input context for every child node of the
201
- * current template node.
202
- * @param context Normally the Expression Context.
203
- * @param template The XSL-T definition.
204
- * @param output If set, the output where the transformation should occur.
205
- */
206
- protected xsltChildNodes(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
207
- /**
208
- * This logic is used in two different places:
209
- * - `xsltPassThrough`, if the template asks this library to write a text node;
210
- * - `xsltProcessContext`, `apply-templates` operation, when the current node is text.
211
- *
212
- * Text nodes always require a parent, and they never have children.
213
- * @param context The Expression Context.
214
- * @param template The template, that contains the node value to be written.
215
- * @param output The output.
216
- */
217
- private commonLogicTextNode;
218
- /**
219
- * Passes template text to the output. The current template node does
220
- * not specify an XSL-T operation and therefore is appended to the
221
- * output with all its attributes. Then continues traversing the
222
- * template node tree.
223
- * @param context The Expression Context.
224
- * @param template The XSLT stylesheet or transformation.
225
- * @param output The output.
226
- */
227
- protected xsltPassThrough(context: ExprContext, template: XNode, output: XNode): Promise<void>;
228
- /**
229
- * Determines if a text node in the XSLT template document is to be
230
- * stripped according to XSLT whitespace stripping rules.
231
- * @see [XSLT], section 3.4.
232
- * @param template The XSLT template.
233
- * @returns TODO
234
- * @todo Whitespace stripping on the input document is
235
- * currently not implemented.
236
- */
237
- protected xsltPassText(template: XNode): boolean;
238
- protected findAttributeInContext(attributeName: string, context: ExprContext): XNode;
239
- /**
240
- * Evaluates an XSL-T attribute value template. Attribute value
241
- * templates are attributes on XSL-T elements that contain XPath
242
- * expressions in braces {}. The XSL-T expressions are evaluated in
243
- * the current input context.
244
- * @param value TODO
245
- * @param context TODO
246
- * @returns TODO
247
- */
248
- protected xsltAttributeValue(value: any, context: ExprContext): any;
249
- /**
250
- * Evaluates an XPath expression in the current input context as a
251
- * match.
252
- * @see [XSLT] section 5.2, paragraph 1
253
- * @param match TODO
254
- * @param context The Expression Context.
255
- * @param axis The XPath axis. Used when the match does not start with the parent.
256
- * @returns {XNode[]} A list of the found nodes.
257
- */
258
- protected xsltMatch(match: string, context: ExprContext, axis?: string): XNode[];
259
- /**
260
- * Sets parameters defined by xsl:with-param child nodes of the
261
- * current template node, in the current input context. This happens
262
- * before the operation specified by the current template node is
263
- * executed.
264
- * @param context The Expression Context.
265
- * @param template The template node.
266
- */
267
- protected xsltWithParam(context: ExprContext, template: XNode): Promise<void>;
268
- /**
269
- * Test if the given element is an XSLT element, optionally the one with the given name.
270
- * @param {XNode} element The element.
271
- * @param {string} opt_wantedName The name for comparison.
272
- * @returns True, if element is an XSL node. False otherwise.
273
- */
274
- protected isXsltElement(element: XNode, opt_wantedName?: string): boolean;
275
- }