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.
- package/LICENSE +165 -0
- package/README.md +29 -2
- package/constants.js.map +1 -0
- package/dom/functions.d.ts +15 -0
- package/{src/dom → dom}/functions.js +88 -43
- package/dom/functions.js.map +1 -0
- package/{src/dom → dom}/index.d.ts +1 -0
- package/{src/dom → dom}/index.js +1 -0
- package/dom/index.js.map +1 -0
- package/{src/dom → dom}/util.d.ts +0 -21
- package/dom/util.js +175 -0
- package/dom/util.js.map +1 -0
- package/{src/dom → dom}/xdocument.d.ts +3 -2
- package/dom/xdocument.js +71 -0
- package/dom/xdocument.js.map +1 -0
- package/dom/xml-functions.d.ts +46 -0
- package/dom/xml-functions.js +317 -0
- package/dom/xml-functions.js.map +1 -0
- package/{src/dom → dom}/xmltoken.js +25 -25
- package/dom/xmltoken.js.map +1 -0
- package/dom/xnode.d.ts +62 -0
- package/{src/dom → dom}/xnode.js +144 -91
- package/dom/xnode.js.map +1 -0
- package/index.d.ts +4 -4
- package/index.js +6 -5
- package/index.js.map +1 -1
- package/package.json +31 -10
- package/umd/constants.d.ts +8 -0
- package/umd/dom/functions.d.ts +15 -0
- package/umd/dom/index.d.ts +4 -0
- package/umd/dom/util.d.ts +26 -0
- package/umd/dom/xdocument.d.ts +16 -0
- package/umd/dom/xml-functions.d.ts +46 -0
- package/umd/dom/xmltoken.d.ts +12 -0
- package/umd/dom/xnode.d.ts +62 -0
- package/umd/index.d.ts +4 -0
- package/{src → umd}/xpath/expr-context.d.ts +6 -7
- package/umd/xpath/expressions/function-call-expr.d.ts +49 -0
- package/{src → umd}/xpath/expressions/location-expr.d.ts +1 -1
- package/{src → umd}/xpath/expressions/step-expr.d.ts +1 -1
- package/umd/xpath/node-test-element-or-attribute.d.ts +5 -0
- package/{src → umd}/xpath/node-test-name.d.ts +1 -1
- package/{src → umd}/xpath/xpath.d.ts +12 -5
- package/umd/xslt-processor.js +16 -0
- package/umd/xslt-processor.js.map +1 -0
- package/umd/xslt.d.ts +133 -0
- package/xpath/expr-context.d.ts +26 -0
- package/{src/xpath → xpath}/expr-context.js +41 -42
- package/xpath/expr-context.js.map +1 -0
- package/xpath/expressions/binary-expr.d.ts +10 -0
- package/{src/xpath → xpath}/expressions/binary-expr.js +65 -47
- package/xpath/expressions/binary-expr.js.map +1 -0
- package/xpath/expressions/expression.d.ts +4 -0
- package/xpath/expressions/expression.js +10 -0
- package/xpath/expressions/expression.js.map +1 -0
- package/xpath/expressions/filter-expr.d.ts +9 -0
- package/xpath/expressions/filter-expr.js +53 -0
- package/xpath/expressions/filter-expr.js.map +1 -0
- package/xpath/expressions/function-call-expr.d.ts +49 -0
- package/{src/xpath → xpath}/expressions/function-call-expr.js +160 -155
- package/xpath/expressions/function-call-expr.js.map +1 -0
- package/xpath/expressions/index.d.ts +13 -0
- package/xpath/expressions/index.js.map +1 -0
- package/xpath/expressions/literal-expr.d.ts +7 -0
- package/xpath/expressions/literal-expr.js +34 -0
- package/xpath/expressions/literal-expr.js.map +1 -0
- package/xpath/expressions/location-expr.d.ts +14 -0
- package/xpath/expressions/location-expr.js +94 -0
- package/xpath/expressions/location-expr.js.map +1 -0
- package/xpath/expressions/number-expr.d.ts +7 -0
- package/xpath/expressions/number-expr.js +34 -0
- package/xpath/expressions/number-expr.js.map +1 -0
- package/xpath/expressions/path-expr.d.ts +9 -0
- package/xpath/expressions/path-expr.js +52 -0
- package/xpath/expressions/path-expr.js.map +1 -0
- package/xpath/expressions/predicate-expr.d.ts +8 -0
- package/xpath/expressions/predicate-expr.js +43 -0
- package/xpath/expressions/predicate-expr.js.map +1 -0
- package/xpath/expressions/step-expr.d.ts +14 -0
- package/{src/xpath → xpath}/expressions/step-expr.js +68 -51
- package/xpath/expressions/step-expr.js.map +1 -0
- package/xpath/expressions/token-expr.d.ts +7 -0
- package/xpath/expressions/token-expr.js +34 -0
- package/xpath/expressions/token-expr.js.map +1 -0
- package/xpath/expressions/unary-minus-expr.d.ts +8 -0
- package/xpath/expressions/unary-minus-expr.js +34 -0
- package/xpath/expressions/unary-minus-expr.js.map +1 -0
- package/xpath/expressions/union-expr.d.ts +9 -0
- package/xpath/expressions/union-expr.js +51 -0
- package/xpath/expressions/union-expr.js.map +1 -0
- package/xpath/expressions/variable-expr.d.ts +7 -0
- package/xpath/expressions/variable-expr.js +33 -0
- package/xpath/expressions/variable-expr.js.map +1 -0
- package/xpath/index.d.ts +9 -0
- package/xpath/index.js.map +1 -0
- package/xpath/node-test-any.d.ts +5 -0
- package/xpath/node-test-any.js +15 -0
- package/xpath/node-test-any.js.map +1 -0
- package/{src/xpath/node-test-element-or-attribute.d.ts → xpath/node-test-comment.d.ts} +1 -1
- package/xpath/node-test-comment.js +15 -0
- package/xpath/node-test-comment.js.map +1 -0
- package/xpath/node-test-element-or-attribute.d.ts +5 -0
- package/xpath/node-test-element-or-attribute.js +16 -0
- package/xpath/node-test-element-or-attribute.js.map +1 -0
- package/xpath/node-test-name.d.ts +8 -0
- package/xpath/node-test-name.js +22 -0
- package/xpath/node-test-name.js.map +1 -0
- package/xpath/node-test-nc.d.ts +7 -0
- package/xpath/node-test-nc.js +17 -0
- package/xpath/node-test-nc.js.map +1 -0
- package/xpath/node-test-pi.d.ts +6 -0
- package/{src/xpath → xpath}/node-test-pi.js +8 -7
- package/xpath/node-test-pi.js.map +1 -0
- package/xpath/node-test-text.d.ts +4 -0
- package/xpath/node-test-text.js +15 -0
- package/xpath/node-test-text.js.map +1 -0
- package/xpath/tokens.d.ts +231 -0
- package/{src/xpath → xpath}/tokens.js +5 -5
- package/xpath/tokens.js.map +1 -0
- package/xpath/values/boolean-value.d.ts +9 -0
- package/xpath/values/boolean-value.js +24 -0
- package/xpath/values/boolean-value.js.map +1 -0
- package/xpath/values/index.d.ts +4 -0
- package/xpath/values/index.js.map +1 -0
- package/xpath/values/node-set-value.d.ts +9 -0
- package/xpath/values/node-set-value.js +28 -0
- package/xpath/values/node-set-value.js.map +1 -0
- package/xpath/values/number-value.d.ts +9 -0
- package/xpath/values/number-value.js +24 -0
- package/xpath/values/number-value.js.map +1 -0
- package/xpath/values/string-value.d.ts +9 -0
- package/{src/xpath → xpath}/values/string-value.js +12 -11
- package/xpath/values/string-value.js.map +1 -0
- package/xpath/xpath-grammar-rules.d.ts +68 -0
- package/xpath/xpath-grammar-rules.js.map +1 -0
- package/xpath/xpath.d.ts +105 -0
- package/{src/xpath → xpath}/xpath.js +267 -266
- package/xpath/xpath.js.map +1 -0
- package/xpathdebug.d.ts +2 -0
- package/{src/xpathdebug.js → xpathdebug.js} +48 -48
- package/xpathdebug.js.map +1 -0
- package/xslt.d.ts +133 -0
- package/xslt.js +643 -0
- package/xslt.js.map +1 -0
- package/src/constants.js.map +0 -1
- package/src/dom/functions.d.ts +0 -3
- package/src/dom/functions.js.map +0 -1
- package/src/dom/index.js.map +0 -1
- package/src/dom/util.js +0 -338
- package/src/dom/util.js.map +0 -1
- package/src/dom/xdocument.js +0 -47
- package/src/dom/xdocument.js.map +0 -1
- package/src/dom/xmltoken.js.map +0 -1
- package/src/dom/xnode.d.ts +0 -38
- package/src/dom/xnode.js.map +0 -1
- package/src/xpath/expr-context.js.map +0 -1
- package/src/xpath/expressions/binary-expr.js.map +0 -1
- package/src/xpath/expressions/expression.js +0 -7
- package/src/xpath/expressions/expression.js.map +0 -1
- package/src/xpath/expressions/filter-expr.js +0 -35
- package/src/xpath/expressions/filter-expr.js.map +0 -1
- package/src/xpath/expressions/function-call-expr.d.ts +0 -49
- package/src/xpath/expressions/function-call-expr.js.map +0 -1
- package/src/xpath/expressions/index.js.map +0 -1
- package/src/xpath/expressions/literal-expr.js +0 -16
- package/src/xpath/expressions/literal-expr.js.map +0 -1
- package/src/xpath/expressions/location-expr.js +0 -76
- package/src/xpath/expressions/location-expr.js.map +0 -1
- package/src/xpath/expressions/number-expr.js +0 -16
- package/src/xpath/expressions/number-expr.js.map +0 -1
- package/src/xpath/expressions/path-expr.js +0 -36
- package/src/xpath/expressions/path-expr.js.map +0 -1
- package/src/xpath/expressions/predicate-expr.js +0 -25
- package/src/xpath/expressions/predicate-expr.js.map +0 -1
- package/src/xpath/expressions/step-expr.js.map +0 -1
- package/src/xpath/expressions/token-expr.js +0 -16
- package/src/xpath/expressions/token-expr.js.map +0 -1
- package/src/xpath/expressions/unary-minus-expr.js +0 -16
- package/src/xpath/expressions/unary-minus-expr.js.map +0 -1
- package/src/xpath/expressions/union-expr.js +0 -32
- package/src/xpath/expressions/union-expr.js.map +0 -1
- package/src/xpath/expressions/variable-expr.js +0 -15
- package/src/xpath/expressions/variable-expr.js.map +0 -1
- package/src/xpath/index.js.map +0 -1
- package/src/xpath/node-test-any.js +0 -14
- package/src/xpath/node-test-any.js.map +0 -1
- package/src/xpath/node-test-comment.js +0 -12
- package/src/xpath/node-test-comment.js.map +0 -1
- package/src/xpath/node-test-element-or-attribute.js +0 -12
- package/src/xpath/node-test-element-or-attribute.js.map +0 -1
- package/src/xpath/node-test-name.js +0 -23
- package/src/xpath/node-test-name.js.map +0 -1
- package/src/xpath/node-test-nc.js +0 -16
- package/src/xpath/node-test-nc.js.map +0 -1
- package/src/xpath/node-test-pi.js.map +0 -1
- package/src/xpath/node-test-text.js +0 -12
- package/src/xpath/node-test-text.js.map +0 -1
- package/src/xpath/tokens.js.map +0 -1
- package/src/xpath/values/boolean-value.js +0 -23
- package/src/xpath/values/boolean-value.js.map +0 -1
- package/src/xpath/values/index.js.map +0 -1
- package/src/xpath/values/node-set-value.js +0 -27
- package/src/xpath/values/node-set-value.js.map +0 -1
- package/src/xpath/values/number-value.js +0 -23
- package/src/xpath/values/number-value.js.map +0 -1
- package/src/xpath/values/string-value.js.map +0 -1
- package/src/xpath/xpath-grammar-rules.js.map +0 -1
- package/src/xpath/xpath.js.map +0 -1
- package/src/xpathdebug.js.map +0 -1
- package/src/xslt.d.ts +0 -68
- package/src/xslt.js +0 -619
- package/src/xslt.js.map +0 -1
- package/xslt-processor.js +0 -2
- package/xslt-processor.js.map +0 -1
- /package/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/{src/constants.js → constants.js} +0 -0
- /package/{src/dom → dom}/xmltoken.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/binary-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/expression.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/filter-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/index.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/literal-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/number-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/path-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/predicate-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/token-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/unary-minus-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/union-expr.d.ts +0 -0
- /package/{src → umd}/xpath/expressions/variable-expr.d.ts +0 -0
- /package/{src → umd}/xpath/index.d.ts +0 -0
- /package/{src → umd}/xpath/node-test-any.d.ts +0 -0
- /package/{src → umd}/xpath/node-test-comment.d.ts +0 -0
- /package/{src → umd}/xpath/node-test-nc.d.ts +0 -0
- /package/{src → umd}/xpath/node-test-pi.d.ts +0 -0
- /package/{src → umd}/xpath/node-test-text.d.ts +0 -0
- /package/{src → umd}/xpath/tokens.d.ts +0 -0
- /package/{src → umd}/xpath/values/boolean-value.d.ts +0 -0
- /package/{src → umd}/xpath/values/index.d.ts +0 -0
- /package/{src → umd}/xpath/values/node-set-value.d.ts +0 -0
- /package/{src → umd}/xpath/values/number-value.d.ts +0 -0
- /package/{src → umd}/xpath/values/string-value.d.ts +0 -0
- /package/{src → umd}/xpath/xpath-grammar-rules.d.ts +0 -0
- /package/{src → umd}/xpathdebug.d.ts +0 -0
- /package/{src/xpath → xpath}/expressions/index.js +0 -0
- /package/{src/xpath → xpath}/index.js +0 -0
- /package/{src/xpath → xpath}/values/index.js +0 -0
- /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:
|
package/constants.js.map
ADDED
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
129
|
+
var xmldoc = new xdocument_1.XDocument();
|
|
130
|
+
var root = xmldoc;
|
|
131
|
+
var stack = [];
|
|
132
|
+
var parent = root;
|
|
88
133
|
stack.push(parent);
|
|
89
|
-
|
|
90
|
-
for (
|
|
91
|
-
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
117
|
-
|
|
161
|
+
var val = he_1.default.decode(att[5] || att[7] || '');
|
|
162
|
+
domSetAttribute(node, att[1], val);
|
|
118
163
|
}
|
|
119
|
-
|
|
164
|
+
domAppendChild(parent, node);
|
|
120
165
|
if (!empty) {
|
|
121
166
|
parent = node;
|
|
122
167
|
stack.push(node);
|
|
123
168
|
}
|
|
124
|
-
|
|
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 (
|
|
135
|
-
if (node.attributes[
|
|
136
|
-
if (node.attributes[
|
|
137
|
-
node.attributes[
|
|
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
|
-
|
|
195
|
+
var text = xml.slice(start, i);
|
|
151
196
|
if (text && parent != root) {
|
|
152
|
-
|
|
197
|
+
domAppendChild(parent, domCreateTextNode(xmldoc, text));
|
|
153
198
|
}
|
|
154
199
|
if (xml.slice(i + 1, i + 4) === '!--') {
|
|
155
|
-
|
|
200
|
+
var endTagIndex = xml.slice(i + 4).indexOf('-->');
|
|
156
201
|
if (endTagIndex) {
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
208
|
+
var endTagIndex = xml.slice(i + 9).indexOf(']]>');
|
|
164
209
|
if (endTagIndex) {
|
|
165
|
-
|
|
166
|
-
|
|
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":";;;;;;AAAA,gCAAgC;AAChC,+BAA+B;AAC/B,6BAA6B;AAC7B,sBAAsB;AACtB,EAAE;AACF,uDAAuD;AACvD,EAAE;AACF,mEAAmE;AACnE,qEAAqE;AACrE,0CAAoB;AAEpB,0CAAgD;AAEhD,+BAEgB;AAChB,yCAAwC;AACxC,uCAOoB;AAGpB,IAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,YAAK,qBAAU,MAAG,CAAC,CAAC;AAC5D,IAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,0BAAe,EAAE,GAAG,CAAC,CAAC;AAEhE,IAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,YAAK,qBAAU,MAAG,CAAC,CAAC;AAC5D,IAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,0BAAe,EAAE,GAAG,CAAC,CAAC;AAEhE,mEAAmE;AACnE,SAAgB,oBAAoB,CAAC,IAAS,EAAE,IAAS;IACrD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAFD,oDAEC;AAED,SAAgB,eAAe,CAAC,IAAW,EAAE,IAAS,EAAE,KAAU;IAC9D,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AAFD,0CAEC;AAED,SAAgB,0BAA0B,CAAC,IAAW,EAAE,IAAS,EAAE,KAAU;IACzE,OAAO,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACrD,CAAC;AAFD,gEAEC;AAED,SAAgB,cAAc,CAAC,IAAW,EAAE,KAAU;IAClD,OAAO,IAAI,CAAC,WAAW,CAAC,KAA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AM,EAAE,IAAI,CAAC,CAAC;oBAC7B,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC;iBACxB;aACJ;iBAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,UAAU,EAAE;gBAC/C,IAAI,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"}
|
package/{src/dom → dom}/index.js
RENAMED
|
@@ -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
|
package/dom/index.js.map
ADDED
|
@@ -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".
|