xslt-processor 1.0.0 → 1.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 (247) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +29 -2
  3. package/constants.js.map +1 -0
  4. package/dom/functions.d.ts +15 -0
  5. package/{src/dom → dom}/functions.js +88 -43
  6. package/dom/functions.js.map +1 -0
  7. package/{src/dom → dom}/index.d.ts +1 -0
  8. package/{src/dom → dom}/index.js +1 -0
  9. package/dom/index.js.map +1 -0
  10. package/{src/dom → dom}/util.d.ts +0 -21
  11. package/dom/util.js +175 -0
  12. package/dom/util.js.map +1 -0
  13. package/{src/dom → dom}/xdocument.d.ts +3 -2
  14. package/dom/xdocument.js +71 -0
  15. package/dom/xdocument.js.map +1 -0
  16. package/dom/xml-functions.d.ts +46 -0
  17. package/dom/xml-functions.js +317 -0
  18. package/dom/xml-functions.js.map +1 -0
  19. package/{src/dom → dom}/xmltoken.js +25 -25
  20. package/dom/xmltoken.js.map +1 -0
  21. package/dom/xnode.d.ts +62 -0
  22. package/{src/dom → dom}/xnode.js +144 -91
  23. package/dom/xnode.js.map +1 -0
  24. package/index.d.ts +4 -4
  25. package/index.js +6 -5
  26. package/index.js.map +1 -1
  27. package/package.json +31 -10
  28. package/umd/constants.d.ts +8 -0
  29. package/umd/dom/functions.d.ts +15 -0
  30. package/umd/dom/index.d.ts +4 -0
  31. package/umd/dom/util.d.ts +26 -0
  32. package/umd/dom/xdocument.d.ts +16 -0
  33. package/umd/dom/xml-functions.d.ts +46 -0
  34. package/umd/dom/xmltoken.d.ts +12 -0
  35. package/umd/dom/xnode.d.ts +62 -0
  36. package/umd/index.d.ts +4 -0
  37. package/{src → umd}/xpath/expr-context.d.ts +6 -7
  38. package/umd/xpath/expressions/function-call-expr.d.ts +49 -0
  39. package/{src → umd}/xpath/expressions/location-expr.d.ts +1 -1
  40. package/{src → umd}/xpath/expressions/step-expr.d.ts +1 -1
  41. package/umd/xpath/node-test-element-or-attribute.d.ts +5 -0
  42. package/{src → umd}/xpath/node-test-name.d.ts +1 -1
  43. package/{src → umd}/xpath/xpath.d.ts +12 -5
  44. package/umd/xslt-processor.js +16 -0
  45. package/umd/xslt-processor.js.map +1 -0
  46. package/umd/xslt.d.ts +133 -0
  47. package/xpath/expr-context.d.ts +26 -0
  48. package/{src/xpath → xpath}/expr-context.js +41 -42
  49. package/xpath/expr-context.js.map +1 -0
  50. package/xpath/expressions/binary-expr.d.ts +10 -0
  51. package/{src/xpath → xpath}/expressions/binary-expr.js +65 -47
  52. package/xpath/expressions/binary-expr.js.map +1 -0
  53. package/xpath/expressions/expression.d.ts +4 -0
  54. package/xpath/expressions/expression.js +10 -0
  55. package/xpath/expressions/expression.js.map +1 -0
  56. package/xpath/expressions/filter-expr.d.ts +9 -0
  57. package/xpath/expressions/filter-expr.js +53 -0
  58. package/xpath/expressions/filter-expr.js.map +1 -0
  59. package/xpath/expressions/function-call-expr.d.ts +49 -0
  60. package/{src/xpath → xpath}/expressions/function-call-expr.js +160 -155
  61. package/xpath/expressions/function-call-expr.js.map +1 -0
  62. package/xpath/expressions/index.d.ts +13 -0
  63. package/xpath/expressions/index.js.map +1 -0
  64. package/xpath/expressions/literal-expr.d.ts +7 -0
  65. package/xpath/expressions/literal-expr.js +34 -0
  66. package/xpath/expressions/literal-expr.js.map +1 -0
  67. package/xpath/expressions/location-expr.d.ts +14 -0
  68. package/xpath/expressions/location-expr.js +94 -0
  69. package/xpath/expressions/location-expr.js.map +1 -0
  70. package/xpath/expressions/number-expr.d.ts +7 -0
  71. package/xpath/expressions/number-expr.js +34 -0
  72. package/xpath/expressions/number-expr.js.map +1 -0
  73. package/xpath/expressions/path-expr.d.ts +9 -0
  74. package/xpath/expressions/path-expr.js +52 -0
  75. package/xpath/expressions/path-expr.js.map +1 -0
  76. package/xpath/expressions/predicate-expr.d.ts +8 -0
  77. package/xpath/expressions/predicate-expr.js +43 -0
  78. package/xpath/expressions/predicate-expr.js.map +1 -0
  79. package/xpath/expressions/step-expr.d.ts +14 -0
  80. package/{src/xpath → xpath}/expressions/step-expr.js +68 -51
  81. package/xpath/expressions/step-expr.js.map +1 -0
  82. package/xpath/expressions/token-expr.d.ts +7 -0
  83. package/xpath/expressions/token-expr.js +34 -0
  84. package/xpath/expressions/token-expr.js.map +1 -0
  85. package/xpath/expressions/unary-minus-expr.d.ts +8 -0
  86. package/xpath/expressions/unary-minus-expr.js +34 -0
  87. package/xpath/expressions/unary-minus-expr.js.map +1 -0
  88. package/xpath/expressions/union-expr.d.ts +9 -0
  89. package/xpath/expressions/union-expr.js +51 -0
  90. package/xpath/expressions/union-expr.js.map +1 -0
  91. package/xpath/expressions/variable-expr.d.ts +7 -0
  92. package/xpath/expressions/variable-expr.js +33 -0
  93. package/xpath/expressions/variable-expr.js.map +1 -0
  94. package/xpath/index.d.ts +9 -0
  95. package/xpath/index.js.map +1 -0
  96. package/xpath/node-test-any.d.ts +5 -0
  97. package/xpath/node-test-any.js +15 -0
  98. package/xpath/node-test-any.js.map +1 -0
  99. package/{src/xpath/node-test-element-or-attribute.d.ts → xpath/node-test-comment.d.ts} +1 -1
  100. package/xpath/node-test-comment.js +15 -0
  101. package/xpath/node-test-comment.js.map +1 -0
  102. package/xpath/node-test-element-or-attribute.d.ts +5 -0
  103. package/xpath/node-test-element-or-attribute.js +16 -0
  104. package/xpath/node-test-element-or-attribute.js.map +1 -0
  105. package/xpath/node-test-name.d.ts +8 -0
  106. package/xpath/node-test-name.js +22 -0
  107. package/xpath/node-test-name.js.map +1 -0
  108. package/xpath/node-test-nc.d.ts +7 -0
  109. package/xpath/node-test-nc.js +17 -0
  110. package/xpath/node-test-nc.js.map +1 -0
  111. package/xpath/node-test-pi.d.ts +6 -0
  112. package/{src/xpath → xpath}/node-test-pi.js +8 -7
  113. package/xpath/node-test-pi.js.map +1 -0
  114. package/xpath/node-test-text.d.ts +4 -0
  115. package/xpath/node-test-text.js +15 -0
  116. package/xpath/node-test-text.js.map +1 -0
  117. package/xpath/tokens.d.ts +231 -0
  118. package/{src/xpath → xpath}/tokens.js +5 -5
  119. package/xpath/tokens.js.map +1 -0
  120. package/xpath/values/boolean-value.d.ts +9 -0
  121. package/xpath/values/boolean-value.js +24 -0
  122. package/xpath/values/boolean-value.js.map +1 -0
  123. package/xpath/values/index.d.ts +4 -0
  124. package/xpath/values/index.js.map +1 -0
  125. package/xpath/values/node-set-value.d.ts +9 -0
  126. package/xpath/values/node-set-value.js +28 -0
  127. package/xpath/values/node-set-value.js.map +1 -0
  128. package/xpath/values/number-value.d.ts +9 -0
  129. package/xpath/values/number-value.js +24 -0
  130. package/xpath/values/number-value.js.map +1 -0
  131. package/xpath/values/string-value.d.ts +9 -0
  132. package/{src/xpath → xpath}/values/string-value.js +12 -11
  133. package/xpath/values/string-value.js.map +1 -0
  134. package/xpath/xpath-grammar-rules.d.ts +68 -0
  135. package/xpath/xpath-grammar-rules.js.map +1 -0
  136. package/xpath/xpath.d.ts +105 -0
  137. package/{src/xpath → xpath}/xpath.js +267 -266
  138. package/xpath/xpath.js.map +1 -0
  139. package/xpathdebug.d.ts +2 -0
  140. package/{src/xpathdebug.js → xpathdebug.js} +48 -48
  141. package/xpathdebug.js.map +1 -0
  142. package/xslt.d.ts +133 -0
  143. package/xslt.js +643 -0
  144. package/xslt.js.map +1 -0
  145. package/src/constants.js.map +0 -1
  146. package/src/dom/functions.d.ts +0 -3
  147. package/src/dom/functions.js.map +0 -1
  148. package/src/dom/index.js.map +0 -1
  149. package/src/dom/util.js +0 -338
  150. package/src/dom/util.js.map +0 -1
  151. package/src/dom/xdocument.js +0 -47
  152. package/src/dom/xdocument.js.map +0 -1
  153. package/src/dom/xmltoken.js.map +0 -1
  154. package/src/dom/xnode.d.ts +0 -38
  155. package/src/dom/xnode.js.map +0 -1
  156. package/src/xpath/expr-context.js.map +0 -1
  157. package/src/xpath/expressions/binary-expr.js.map +0 -1
  158. package/src/xpath/expressions/expression.js +0 -7
  159. package/src/xpath/expressions/expression.js.map +0 -1
  160. package/src/xpath/expressions/filter-expr.js +0 -35
  161. package/src/xpath/expressions/filter-expr.js.map +0 -1
  162. package/src/xpath/expressions/function-call-expr.d.ts +0 -49
  163. package/src/xpath/expressions/function-call-expr.js.map +0 -1
  164. package/src/xpath/expressions/index.js.map +0 -1
  165. package/src/xpath/expressions/literal-expr.js +0 -16
  166. package/src/xpath/expressions/literal-expr.js.map +0 -1
  167. package/src/xpath/expressions/location-expr.js +0 -76
  168. package/src/xpath/expressions/location-expr.js.map +0 -1
  169. package/src/xpath/expressions/number-expr.js +0 -16
  170. package/src/xpath/expressions/number-expr.js.map +0 -1
  171. package/src/xpath/expressions/path-expr.js +0 -36
  172. package/src/xpath/expressions/path-expr.js.map +0 -1
  173. package/src/xpath/expressions/predicate-expr.js +0 -25
  174. package/src/xpath/expressions/predicate-expr.js.map +0 -1
  175. package/src/xpath/expressions/step-expr.js.map +0 -1
  176. package/src/xpath/expressions/token-expr.js +0 -16
  177. package/src/xpath/expressions/token-expr.js.map +0 -1
  178. package/src/xpath/expressions/unary-minus-expr.js +0 -16
  179. package/src/xpath/expressions/unary-minus-expr.js.map +0 -1
  180. package/src/xpath/expressions/union-expr.js +0 -32
  181. package/src/xpath/expressions/union-expr.js.map +0 -1
  182. package/src/xpath/expressions/variable-expr.js +0 -15
  183. package/src/xpath/expressions/variable-expr.js.map +0 -1
  184. package/src/xpath/index.js.map +0 -1
  185. package/src/xpath/node-test-any.js +0 -14
  186. package/src/xpath/node-test-any.js.map +0 -1
  187. package/src/xpath/node-test-comment.js +0 -12
  188. package/src/xpath/node-test-comment.js.map +0 -1
  189. package/src/xpath/node-test-element-or-attribute.js +0 -12
  190. package/src/xpath/node-test-element-or-attribute.js.map +0 -1
  191. package/src/xpath/node-test-name.js +0 -23
  192. package/src/xpath/node-test-name.js.map +0 -1
  193. package/src/xpath/node-test-nc.js +0 -16
  194. package/src/xpath/node-test-nc.js.map +0 -1
  195. package/src/xpath/node-test-pi.js.map +0 -1
  196. package/src/xpath/node-test-text.js +0 -12
  197. package/src/xpath/node-test-text.js.map +0 -1
  198. package/src/xpath/tokens.js.map +0 -1
  199. package/src/xpath/values/boolean-value.js +0 -23
  200. package/src/xpath/values/boolean-value.js.map +0 -1
  201. package/src/xpath/values/index.js.map +0 -1
  202. package/src/xpath/values/node-set-value.js +0 -27
  203. package/src/xpath/values/node-set-value.js.map +0 -1
  204. package/src/xpath/values/number-value.js +0 -23
  205. package/src/xpath/values/number-value.js.map +0 -1
  206. package/src/xpath/values/string-value.js.map +0 -1
  207. package/src/xpath/xpath-grammar-rules.js.map +0 -1
  208. package/src/xpath/xpath.js.map +0 -1
  209. package/src/xpathdebug.js.map +0 -1
  210. package/src/xslt.d.ts +0 -68
  211. package/src/xslt.js +0 -619
  212. package/src/xslt.js.map +0 -1
  213. package/xslt-processor.js +0 -2
  214. package/xslt-processor.js.map +0 -1
  215. /package/{src/constants.d.ts → constants.d.ts} +0 -0
  216. /package/{src/constants.js → constants.js} +0 -0
  217. /package/{src/dom → dom}/xmltoken.d.ts +0 -0
  218. /package/{src → umd}/xpath/expressions/binary-expr.d.ts +0 -0
  219. /package/{src → umd}/xpath/expressions/expression.d.ts +0 -0
  220. /package/{src → umd}/xpath/expressions/filter-expr.d.ts +0 -0
  221. /package/{src → umd}/xpath/expressions/index.d.ts +0 -0
  222. /package/{src → umd}/xpath/expressions/literal-expr.d.ts +0 -0
  223. /package/{src → umd}/xpath/expressions/number-expr.d.ts +0 -0
  224. /package/{src → umd}/xpath/expressions/path-expr.d.ts +0 -0
  225. /package/{src → umd}/xpath/expressions/predicate-expr.d.ts +0 -0
  226. /package/{src → umd}/xpath/expressions/token-expr.d.ts +0 -0
  227. /package/{src → umd}/xpath/expressions/unary-minus-expr.d.ts +0 -0
  228. /package/{src → umd}/xpath/expressions/union-expr.d.ts +0 -0
  229. /package/{src → umd}/xpath/expressions/variable-expr.d.ts +0 -0
  230. /package/{src → umd}/xpath/index.d.ts +0 -0
  231. /package/{src → umd}/xpath/node-test-any.d.ts +0 -0
  232. /package/{src → umd}/xpath/node-test-comment.d.ts +0 -0
  233. /package/{src → umd}/xpath/node-test-nc.d.ts +0 -0
  234. /package/{src → umd}/xpath/node-test-pi.d.ts +0 -0
  235. /package/{src → umd}/xpath/node-test-text.d.ts +0 -0
  236. /package/{src → umd}/xpath/tokens.d.ts +0 -0
  237. /package/{src → umd}/xpath/values/boolean-value.d.ts +0 -0
  238. /package/{src → umd}/xpath/values/index.d.ts +0 -0
  239. /package/{src → umd}/xpath/values/node-set-value.d.ts +0 -0
  240. /package/{src → umd}/xpath/values/number-value.d.ts +0 -0
  241. /package/{src → umd}/xpath/values/string-value.d.ts +0 -0
  242. /package/{src → umd}/xpath/xpath-grammar-rules.d.ts +0 -0
  243. /package/{src → umd}/xpathdebug.d.ts +0 -0
  244. /package/{src/xpath → xpath}/expressions/index.js +0 -0
  245. /package/{src/xpath → xpath}/index.js +0 -0
  246. /package/{src/xpath → xpath}/values/index.js +0 -0
  247. /package/{src/xpath → xpath}/xpath-grammar-rules.js +0 -0
package/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/README.md CHANGED
@@ -2,14 +2,31 @@
2
2
 
3
3
  _A JavaScript XSLT processor without native library dependencies._
4
4
 
5
+ <p align="center">
6
+ <a href="https://github.com/DesignLiquido/xslt-processor/issues" target="_blank">
7
+ <img src="https://img.shields.io/github/issues/Designliquido/xslt-processor" />
8
+ </a>
9
+ <img src="https://img.shields.io/github/stars/Designliquido/xslt-processor" />
10
+ <img src="https://img.shields.io/github/forks/Designliquido/xslt-processor" />
11
+ <a href="https://www.npmjs.com/package/xslt-processor" target="_blank">
12
+ <img src="https://img.shields.io/npm/v/xslt-processor" />
13
+ </a>
14
+ <img src="https://img.shields.io/npm/dw/xslt-processor" />
15
+ <img src="https://img.shields.io/github/license/DesignLiquido/xslt-processor" />
16
+ </p>
17
+
5
18
  ## How to
6
19
 
7
- Install xslt-processor using npm:
20
+ Install xslt-processor using npm or yarn:
8
21
 
9
- ```
22
+ ```sh
10
23
  npm install xslt-processor
11
24
  ```
12
25
 
26
+ ```sh
27
+ yarn add xslt-processor
28
+ ```
29
+
13
30
  Within your ES2015+ code, import the `Xslt` class, the `xmlParse` function and use this way:
14
31
 
15
32
  ```js
@@ -42,6 +59,16 @@ const xPath = new XPath();
42
59
 
43
60
  If you write pre-2015 JS code, make adjustments as needed.
44
61
 
62
+ ### Direct use in browsers
63
+
64
+ You can simply add a tag like this:
65
+
66
+ ```html
67
+ <script type="application/javascript" src="https://www.unpkg.com/xslt-processor@1.0.1/umd/xslt-processor.js"></script>
68
+ ```
69
+
70
+ All the exports will live under `globalThis.XsltProcessor`.
71
+
45
72
  ### Breaking Changes
46
73
 
47
74
  Until version 0.11.7, use like the example below:
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,2BAA2B;AACd,QAAA,gBAAgB,GAAG,CAAC,CAAC;AACrB,QAAA,kBAAkB,GAAG,CAAC,CAAC;AACvB,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,sBAAsB,GAAG,CAAC,CAAC;AACxC,uCAAuC;AACvC,6BAA6B;AAChB,QAAA,+BAA+B,GAAG,CAAC,CAAC;AACpC,QAAA,gBAAgB,GAAG,CAAC,CAAC;AACrB,QAAA,iBAAiB,GAAG,CAAC,CAAC;AACnC,qCAAqC;AACxB,QAAA,0BAA0B,GAAG,EAAE,CAAC;AAC7C,gCAAgC"}
@@ -0,0 +1,15 @@
1
+ import { XDocument } from "./xdocument";
2
+ import { XNode } from './xnode';
3
+ export declare function domGetAttributeValue(node: any, name: any): any;
4
+ export declare function domSetAttribute(node: XNode, name: any, value: any): void;
5
+ export declare function domSetTransformedAttribute(node: XNode, name: any, value: any): void;
6
+ export declare function domAppendChild(node: XNode, child: any): void;
7
+ export declare function domAppendTransformedChild(node: XNode, child: any): void;
8
+ export declare function domCreateTextNode(node: XDocument, text: string): any;
9
+ export declare function domCreateTransformedTextNode(node: XDocument, text: string): any;
10
+ export declare function domCreateElement(doc: any, name: any): any;
11
+ export declare function domCreateCDATASection(doc: any, data: any): any;
12
+ export declare function domCreateComment(doc: any, text: any): any;
13
+ export declare function domCreateDocumentFragment(doc: XDocument): XNode;
14
+ export declare function domTraverseElements(node: any, opt_pre: any, opt_post: any): boolean;
15
+ export declare function xmlParse(xml: any): XDocument;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.xmlParse = exports.domTraverseElements = void 0;
6
+ exports.xmlParse = exports.domTraverseElements = exports.domCreateDocumentFragment = exports.domCreateComment = exports.domCreateCDATASection = exports.domCreateElement = exports.domCreateTransformedTextNode = exports.domCreateTextNode = exports.domAppendTransformedChild = exports.domAppendChild = exports.domSetTransformedAttribute = exports.domSetAttribute = exports.domGetAttributeValue = void 0;
7
7
  // Copyright 2023 Design Liquido
8
8
  // Copyright 2018 Johannes Wilm
9
9
  // Copyright 2005 Google Inc.
@@ -13,15 +13,60 @@ exports.xmlParse = exports.domTraverseElements = void 0;
13
13
  //
14
14
  // An XML parse and a minimal DOM implementation that just supports
15
15
  // the subset of the W3C DOM that is used in the XSLT implementation.
16
- const he_1 = __importDefault(require("he"));
17
- const constants_1 = require("../constants");
18
- const util_1 = require("./util");
19
- const xdocument_1 = require("./xdocument");
20
- const xmltoken_1 = require("./xmltoken");
21
- const XML10_TAGNAME_REGEXP = new RegExp(`^(${xmltoken_1.XML10_NAME})`);
22
- const XML10_ATTRIBUTE_REGEXP = new RegExp(xmltoken_1.XML10_ATTRIBUTE, 'g');
23
- const XML11_TAGNAME_REGEXP = new RegExp(`^(${xmltoken_1.XML11_NAME})`);
24
- const XML11_ATTRIBUTE_REGEXP = new RegExp(xmltoken_1.XML11_ATTRIBUTE, 'g');
16
+ var he_1 = __importDefault(require("he"));
17
+ var constants_1 = require("../constants");
18
+ var util_1 = require("./util");
19
+ var xdocument_1 = require("./xdocument");
20
+ var xmltoken_1 = require("./xmltoken");
21
+ var XML10_TAGNAME_REGEXP = new RegExp("^(".concat(xmltoken_1.XML10_NAME, ")"));
22
+ var XML10_ATTRIBUTE_REGEXP = new RegExp(xmltoken_1.XML10_ATTRIBUTE, 'g');
23
+ var XML11_TAGNAME_REGEXP = new RegExp("^(".concat(xmltoken_1.XML11_NAME, ")"));
24
+ var XML11_ATTRIBUTE_REGEXP = new RegExp(xmltoken_1.XML11_ATTRIBUTE, 'g');
25
+ // Wrapper around DOM methods so we can condense their invocations.
26
+ function domGetAttributeValue(node, name) {
27
+ return node.getAttributeValue(name);
28
+ }
29
+ exports.domGetAttributeValue = domGetAttributeValue;
30
+ function domSetAttribute(node, name, value) {
31
+ return node.setAttribute(name, value);
32
+ }
33
+ exports.domSetAttribute = domSetAttribute;
34
+ function domSetTransformedAttribute(node, name, value) {
35
+ return node.setTransformedAttribute(name, value);
36
+ }
37
+ exports.domSetTransformedAttribute = domSetTransformedAttribute;
38
+ function domAppendChild(node, child) {
39
+ return node.appendChild(child);
40
+ }
41
+ exports.domAppendChild = domAppendChild;
42
+ function domAppendTransformedChild(node, child) {
43
+ return node.appendTransformedChild(child);
44
+ }
45
+ exports.domAppendTransformedChild = domAppendTransformedChild;
46
+ function domCreateTextNode(node, text) {
47
+ return node.createTextNode(text);
48
+ }
49
+ exports.domCreateTextNode = domCreateTextNode;
50
+ function domCreateTransformedTextNode(node, text) {
51
+ return node.createTransformedTextNode(text);
52
+ }
53
+ exports.domCreateTransformedTextNode = domCreateTransformedTextNode;
54
+ function domCreateElement(doc, name) {
55
+ return doc.createElement(name);
56
+ }
57
+ exports.domCreateElement = domCreateElement;
58
+ function domCreateCDATASection(doc, data) {
59
+ return doc.createCDATASection(data);
60
+ }
61
+ exports.domCreateCDATASection = domCreateCDATASection;
62
+ function domCreateComment(doc, text) {
63
+ return doc.createComment(text);
64
+ }
65
+ exports.domCreateComment = domCreateComment;
66
+ function domCreateDocumentFragment(doc) {
67
+ return doc.createDocumentFragment();
68
+ }
69
+ exports.domCreateDocumentFragment = domCreateDocumentFragment;
25
70
  // Traverses the element nodes in the DOM section underneath the given
26
71
  // node and invokes the given callbacks as methods on every element
27
72
  // node encountered. Function opt_pre is invoked before a node's
@@ -30,14 +75,14 @@ const XML11_ATTRIBUTE_REGEXP = new RegExp(xmltoken_1.XML11_ATTRIBUTE, 'g');
30
75
  // returns boolean false. NOTE(mesch): copied from
31
76
  // <//google3/maps/webmaps/javascript/dom.js>.
32
77
  function domTraverseElements(node, opt_pre, opt_post) {
33
- let ret;
78
+ var ret;
34
79
  if (opt_pre) {
35
80
  ret = opt_pre.call(null, node);
36
81
  if (typeof ret == 'boolean' && !ret) {
37
82
  return false;
38
83
  }
39
84
  }
40
- for (let c = node.firstChild; c; c = c.nextSibling) {
85
+ for (var c = node.firstChild; c; c = c.nextSibling) {
41
86
  if (c.nodeType == constants_1.DOM_ELEMENT_NODE) {
42
87
  ret = domTraverseElements.call(this, c, opt_pre, opt_post);
43
88
  if (typeof ret == 'boolean' && !ret) {
@@ -56,9 +101,9 @@ exports.domTraverseElements = domTraverseElements;
56
101
  // Parses the given XML string with our custom, JavaScript XML parser. Written
57
102
  // by Steffen Meschkat (mesch@google.com).
58
103
  function xmlParse(xml) {
59
- const regex_empty = /\/$/;
60
- let regex_tagname;
61
- let regex_attribute;
104
+ var regex_empty = /\/$/;
105
+ var regex_tagname;
106
+ var regex_attribute;
62
107
  if (xml.match(/^<\?xml/)) {
63
108
  // When an XML document begins with an XML declaration
64
109
  // VersionInfo must appear.
@@ -81,14 +126,14 @@ function xmlParse(xml) {
81
126
  regex_tagname = XML10_TAGNAME_REGEXP;
82
127
  regex_attribute = XML10_ATTRIBUTE_REGEXP;
83
128
  }
84
- const xmldoc = new xdocument_1.XDocument();
85
- const root = xmldoc;
86
- const stack = [];
87
- let parent = root;
129
+ var xmldoc = new xdocument_1.XDocument();
130
+ var root = xmldoc;
131
+ var stack = [];
132
+ var parent = root;
88
133
  stack.push(parent);
89
- let tag = false, quotes = false, doublequotes = false, start = 0;
90
- for (let i = 0; i < xml.length; ++i) {
91
- let char = xml.charAt(i);
134
+ var tag = false, quotes = false, doublequotes = false, start = 0;
135
+ for (var i = 0; i < xml.length; ++i) {
136
+ var char = xml.charAt(i);
92
137
  if (tag && !doublequotes && char === "'") {
93
138
  quotes = !quotes;
94
139
  }
@@ -96,7 +141,7 @@ function xmlParse(xml) {
96
141
  doublequotes = !doublequotes;
97
142
  }
98
143
  else if (tag && char === '>' && !quotes && !doublequotes) {
99
- let text = xml.slice(start, i);
144
+ var text = xml.slice(start, i);
100
145
  if (text.charAt(0) == '/') {
101
146
  stack.pop();
102
147
  parent = stack[stack.length - 1];
@@ -108,20 +153,20 @@ function xmlParse(xml) {
108
153
  // Ignore malformed notation and comments
109
154
  }
110
155
  else {
111
- const empty = text.match(regex_empty);
112
- const tagname = regex_tagname.exec(text)[1];
113
- let node = (0, util_1.domCreateElement)(xmldoc, tagname);
114
- let att;
156
+ var empty = text.match(regex_empty);
157
+ var tagname = regex_tagname.exec(text)[1];
158
+ var node = domCreateElement(xmldoc, tagname);
159
+ var att = void 0;
115
160
  while ((att = regex_attribute.exec(text))) {
116
- const val = he_1.default.decode(att[5] || att[7] || '');
117
- (0, util_1.domSetAttribute)(node, att[1], val);
161
+ var val = he_1.default.decode(att[5] || att[7] || '');
162
+ domSetAttribute(node, att[1], val);
118
163
  }
119
- (0, util_1.domAppendChild)(parent, node);
164
+ domAppendChild(parent, node);
120
165
  if (!empty) {
121
166
  parent = node;
122
167
  stack.push(node);
123
168
  }
124
- const namespaceMap = (0, util_1.namespaceMapAt)(node);
169
+ var namespaceMap = (0, util_1.namespaceMapAt)(node);
125
170
  if (node.prefix !== null) {
126
171
  if (node.prefix in namespaceMap)
127
172
  node.namespaceURI = namespaceMap[node.prefix];
@@ -131,10 +176,10 @@ function xmlParse(xml) {
131
176
  if ('' in namespaceMap)
132
177
  node.namespaceURI = namespaceMap[''];
133
178
  }
134
- for (let i = 0; i < node.attributes.length; ++i) {
135
- if (node.attributes[i].prefix !== null) {
136
- if (node.attributes[i].prefix in namespaceMap) {
137
- node.attributes[i].namespaceURI = namespaceMap[node.attributes[i].prefix];
179
+ for (var i_1 = 0; i_1 < node.attributes.length; ++i_1) {
180
+ if (node.attributes[i_1].prefix !== null) {
181
+ if (node.attributes[i_1].prefix in namespaceMap) {
182
+ node.attributes[i_1].namespaceURI = namespaceMap[node.attributes[i_1].prefix];
138
183
  }
139
184
  // else, prefix undefined.
140
185
  }
@@ -147,23 +192,23 @@ function xmlParse(xml) {
147
192
  doublequotes = false;
148
193
  }
149
194
  else if (!tag && char === '<') {
150
- let text = xml.slice(start, i);
195
+ var text = xml.slice(start, i);
151
196
  if (text && parent != root) {
152
- (0, util_1.domAppendChild)(parent, (0, util_1.domCreateTextNode)(xmldoc, text));
197
+ domAppendChild(parent, domCreateTextNode(xmldoc, text));
153
198
  }
154
199
  if (xml.slice(i + 1, i + 4) === '!--') {
155
- let endTagIndex = xml.slice(i + 4).indexOf('-->');
200
+ var endTagIndex = xml.slice(i + 4).indexOf('-->');
156
201
  if (endTagIndex) {
157
- let node = (0, util_1.domCreateComment)(xmldoc, xml.slice(i + 4, i + endTagIndex + 4));
158
- (0, util_1.domAppendChild)(parent, node);
202
+ var node = domCreateComment(xmldoc, xml.slice(i + 4, i + endTagIndex + 4));
203
+ domAppendChild(parent, node);
159
204
  i += endTagIndex + 6;
160
205
  }
161
206
  }
162
207
  else if (xml.slice(i + 1, i + 9) === '![CDATA[') {
163
- let endTagIndex = xml.slice(i + 9).indexOf(']]>');
208
+ var endTagIndex = xml.slice(i + 9).indexOf(']]>');
164
209
  if (endTagIndex) {
165
- let node = (0, util_1.domCreateCDATASection)(xmldoc, xml.slice(i + 9, i + endTagIndex + 9));
166
- (0, util_1.domAppendChild)(parent, node);
210
+ var node = domCreateCDATASection(xmldoc, xml.slice(i + 9, i + endTagIndex + 9));
211
+ domAppendChild(parent, node);
167
212
  i += endTagIndex + 11;
168
213
  }
169
214
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/dom/functions.ts"],"names":[],"mappings":";;;;;;A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,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAClD,IAAI,WAAW,EAAE;oBACb,IAAI,IAAI,GAAG,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;oBAChF,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;oBAC7B,CAAC,IAAI,WAAW,GAAG,EAAE,CAAC;iBACzB;aACJ;iBAAM;gBACH,GAAG,GAAG,IAAI,CAAC;aACd;YACD,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;SACjB;KACJ;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AApHD,4BAoHC;AAED,kEAAkE"}
@@ -1,3 +1,4 @@
1
1
  export * from './functions';
2
2
  export * from './xdocument';
3
+ export * from './xml-functions';
3
4
  export * from './xnode';
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./functions"), exports);
18
18
  __exportStar(require("./xdocument"), exports);
19
+ __exportStar(require("./xml-functions"), exports);
19
20
  __exportStar(require("./xnode"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,8CAA4B;AAC5B,kDAAgC;AAChC,0CAAwB"}
@@ -1,4 +1,3 @@
1
- import { XDocument } from './xdocument';
2
1
  export declare function assert(b: any): void;
3
2
  export declare function mapExec(array: any, func: any): void;
4
3
  export declare function mapExpr(array: any, func: any): any[];
@@ -11,26 +10,6 @@ export declare function copyArray(dst: any, src: any): void;
11
10
  * function, we ignore any such attributes that has an empty string value.
12
11
  */
13
12
  export declare function copyArrayIgnoringAttributesWithoutValue(dst: any, src: any): void;
14
- export declare function xmlValue(node: any, disallowBrowserSpecificOptimization?: boolean): any;
15
- export declare function xmlText(node: any, opt_cdata?: boolean): string;
16
- export declare function xmlEscapeText(s: any): string;
17
- /**
18
- * Wrapper function to access the owner document uniformly for document
19
- * and other nodes: for the document node, the owner document is the
20
- * node itself, for all others it's the ownerDocument property.
21
- *
22
- * @param {Node} node
23
- * @return {Document}
24
- */
25
- export declare function xmlOwnerDocument(node: any): any;
26
- export declare function domGetAttribute(node: any, name: any): any;
27
- export declare function domSetAttribute(node: any, name: any, value: any): any;
28
- export declare function domAppendChild(node: any, child: any): any;
29
- export declare function domCreateTextNode(doc: any, text: any): any;
30
- export declare function domCreateElement(doc: any, name: any): any;
31
- export declare function domCreateCDATASection(doc: any, data: any): any;
32
- export declare function domCreateComment(doc: any, text: any): any;
33
- export declare function domCreateDocumentFragment(doc: XDocument): any;
34
13
  export declare function regExpEscape(text: string): string;
35
14
  /**
36
15
  * Determines whether a predicate expression contains a "positional selector".