tDOM

Check-in [6a48682b06]
Login

Check-in [6a48682b06]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merged from trunk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | domvalidation
Files: files | file ages | folders
SHA3-256: 6a48682b06b058e70536691cd6a3a2c4f3a66fc7e7ed3921094eb13db7a652a5
User & Date: rolf 2018-12-14 09:54:21.016
Context
2019-06-06
23:23
Merged from trunk. check-in: 672fc9ca28 user: rolf tags: domvalidation
2018-12-14
09:54
Merged from trunk. check-in: 6a48682b06 user: rolf tags: domvalidation
2018-11-22
00:13
Removed unnecessary code. The handler pair for start and end tag is enough for bookkeeping about nesting. check-in: 22bb3a056f user: rolf tags: trunk
2018-07-25
23:12
Merged from trunk. check-in: d554f9574e user: rolf tags: domvalidation
Changes
Unified Diff Ignore Whitespace Patch
Changes to CHANGES.










1
2
3
4
5
6
7










2018-07-16  Rolf Ade  <[email protected]>

        The package name is tDOM, but it always has been requested by
        [package require tdom] and now the scripted helper commands in
        tdom.tcl are also in the namespace tdom (not anymore in tDOM).
        The new pullparser command is now also in this namespace.
        There are aliases from the old command names to the new one,
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2018-10-12  Rolf Ade  <[email protected]>

        Updated to expat 2.2.6.

2018-08-08  Rolf Ade  <[email protected]>

        Changed the license to MPL 2.0.

--- Release 0.9.1, 24. Jul. 2018 --- 

2018-07-16  Rolf Ade  <[email protected]>

        The package name is tDOM, but it always has been requested by
        [package require tdom] and now the scripted helper commands in
        tdom.tcl are also in the namespace tdom (not anymore in tDOM).
        The new pullparser command is now also in this namespace.
        There are aliases from the old command names to the new one,
Changes to LICENSE.
1
2
3
4
5
6
7
8
9
10


The tDOM specific source files come with the Mozilla Public License 
Version 1.1.
If you want to distribute/use tDOM under a different license please 
feel free to contact the author ([email protected]).


For Expat XML parser package license look into the directory expat.




|
<
<
<



1
2
3
4



5
6
7


The tDOM specific source files come with the Mozilla Public License 
Version 2.0.




For Expat XML parser package license look into the directory expat.

Added MPL_2.0.html.
































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <title>Mozilla Public License, version 2.0</title>
  <!--[if lt IE 9]>
    <script src="/media/js/libs/html5shiv.42594ff91377.js"></script>
  <![endif]-->

  
    <link href="/media/css/BUNDLES/mpl-2-0.e529fc4408b6.css" rel="stylesheet" type="text/css" />
  
</head>
<body>
<h1 id="mozilla-public-license-version-2.0">Mozilla Public License<br>Version 2.0</h1>
<h2 id="definitions">1. Definitions</h2>
<dl>
<dt>1.1. “Contributor”</dt>
<dd><p>means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.</p>
</dd>
<dt>1.2. “Contributor Version”</dt>
<dd><p>means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.</p>
</dd>
<dt>1.3. “Contribution”</dt>
<dd><p>means Covered Software of a particular Contributor.</p>
</dd>
<dt>1.4. “Covered Software”</dt>
<dd><p>means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.</p>
</dd>
<dt>1.5. “Incompatible With Secondary Licenses”</dt>
<dd><p>means</p>
<ol type="a">
<li><p>that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or</p></li>
<li><p>that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.</p></li>
</ol>
</dd>
<dt>1.6. “Executable Form”</dt>
<dd><p>means any form of the work other than Source Code Form.</p>
</dd>
<dt>1.7. “Larger Work”</dt>
<dd><p>means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.</p>
</dd>
<dt>1.8. “License”</dt>
<dd><p>means this document.</p>
</dd>
<dt>1.9. “Licensable”</dt>
<dd><p>means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.</p>
</dd>
<dt>1.10. “Modifications”</dt>
<dd><p>means any of the following:</p>
<ol type="a">
<li><p>any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or</p></li>
<li><p>any new file in Source Code Form that contains any Covered Software.</p></li>
</ol>
</dd>
<dt>1.11. “Patent Claims” of a Contributor</dt>
<dd><p>means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.</p>
</dd>
<dt>1.12. “Secondary License”</dt>
<dd><p>means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.</p>
</dd>
<dt>1.13. “Source Code Form”</dt>
<dd><p>means the form of the work preferred for making modifications.</p>
</dd>
<dt>1.14. “You” (or “Your”)</dt>
<dd><p>means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.</p>
</dd>
</dl>
<h2 id="license-grants-and-conditions">2. License Grants and Conditions</h2>
<h3 id="grants">2.1. Grants</h3>
<p>Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:</p>
<ol type="a">
<li><p>under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and</p></li>
<li><p>under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.</p></li>
</ol>
<h3 id="effective-date">2.2. Effective Date</h3>
<p>The licenses granted in Section&nbsp;2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.</p>
<h3 id="limitations-on-grant-scope">2.3. Limitations on Grant Scope</h3>
<p>The licenses granted in this Section&nbsp;2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section&nbsp;2.1(b) above, no patent license is granted by a Contributor:</p>
<ol type="a">
<li><p>for any code that a Contributor has removed from Covered Software; or</p></li>
<li><p>for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or</p></li>
<li><p>under Patent Claims infringed by Covered Software in the absence of its Contributions.</p></li>
</ol>
<p>This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section&nbsp;3.4).</p>
<h3 id="subsequent-licenses">2.4. Subsequent Licenses</h3>
<p>No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section&nbsp;10.2) or under the terms of a Secondary License (if permitted under the terms of Section&nbsp;3.3).</p>
<h3 id="representation">2.5. Representation</h3>
<p>Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.</p>
<h3 id="fair-use">2.6. Fair Use</h3>
<p>This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.</p>
<h3 id="conditions">2.7. Conditions</h3>
<p>Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section&nbsp;2.1.</p>
<h2 id="responsibilities">3. Responsibilities</h2>
<h3 id="distribution-of-source-form">3.1. Distribution of Source Form</h3>
<p>All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.</p>
<h3 id="distribution-of-executable-form">3.2. Distribution of Executable Form</h3>
<p>If You distribute Covered Software in Executable Form then:</p>
<ol type="a">
<li><p>such Covered Software must also be made available in Source Code Form, as described in Section&nbsp;3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and</p></li>
<li><p>You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.</p></li>
</ol>
<h3 id="distribution-of-a-larger-work">3.3. Distribution of a Larger Work</h3>
<p>You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).</p>
<h3 id="notices">3.4. Notices</h3>
<p>You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.</p>
<h3 id="application-of-additional-terms">3.5. Application of Additional Terms</h3>
<p>You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.</p>
<h2 id="inability-to-comply-due-to-statute-or-regulation">4. Inability to Comply Due to Statute or Regulation</h2>
<p>If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.</p>
<h2 id="termination">5. Termination</h2>
<p>5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.</p>
<p>5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section&nbsp;2.1 of this License shall terminate.</p>
<p>5.3. In the event of termination under Sections&nbsp;5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.</p>
<h2 id="disclaimer-of-warranty">6. Disclaimer of Warranty</h2>
<p><em>Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.</em></p>
<h2 id="limitation-of-liability">7. Limitation of Liability</h2>
<p><em>Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.</em></p>
<h2 id="litigation">8. Litigation</h2>
<p>Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.</p>
<h2 id="miscellaneous">9. Miscellaneous</h2>
<p>This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.</p>
<h2 id="versions-of-the-license">10. Versions of the License</h2>
<h3 id="new-versions">10.1. New Versions</h3>
<p>Mozilla Foundation is the license steward. Except as provided in Section&nbsp;10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.</p>
<h3 id="effect-of-new-versions">10.2. Effect of New Versions</h3>
<p>You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.</p>
<h3 id="modified-versions">10.3. Modified Versions</h3>
<p>If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).</p>
<h3 id="distributing-source-code-form-that-is-incompatible-with-secondary-licenses">10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses</h3>
<p>If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.</p>
<h2 id="exhibit-a---source-code-form-license-notice">Exhibit A - Source Code Form License Notice</h2>
<blockquote>
<p>This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.</p>
</blockquote>
<p>If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.</p>
<p>You may add additional accurate notices of copyright ownership.</p>
<h2 id="exhibit-b---incompatible-with-secondary-licenses-notice">Exhibit B - “Incompatible With Secondary Licenses” Notice</h2>
<blockquote>
<p>This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.</p>
</blockquote>
</body>
</html>
Changes to Makefile.in.
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

all: binaries libraries doc

#========================================================================
# TDOM enabled shell is build as an extra directive, since non TEA. 
#========================================================================

$(TDOMSHELL): $(PKG_OBJECTS) $(srcdir)/unix/tclAppInit.c
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/unix/tclAppInit.c`
	$(CC) @LDFLAGS@ -o $@ tclAppInit.$(OBJEXT) $(PKG_OBJECTS) \
	  $(TCL_LIB_SPEC) $(TDOMSHELL_LIBS) $(TDOM_LD_SEARCH_FLAGS)

#========================================================================
# The binaries target builds executable programs, Windows .dll's, unix
# shared/static libraries, and any other platform-dependent files.
# The list of targets to build for "binaries:" is specified at the top
# of the Makefile, in the "BINARIES" variable.
#========================================================================

binaries: versionhash.h $(BINARIES)

libraries:

#========================================================================
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.







|











|







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

all: binaries libraries doc

#========================================================================
# TDOM enabled shell is build as an extra directive, since non TEA. 
#========================================================================

$(TDOMSHELL): binaries $(srcdir)/unix/tclAppInit.c
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/unix/tclAppInit.c`
	$(CC) @LDFLAGS@ -o $@ tclAppInit.$(OBJEXT) $(PKG_OBJECTS) \
	  $(TCL_LIB_SPEC) $(TDOMSHELL_LIBS) $(TDOM_LD_SEARCH_FLAGS)

#========================================================================
# The binaries target builds executable programs, Windows .dll's, unix
# shared/static libraries, and any other platform-dependent files.
# The list of targets to build for "binaries:" is specified at the top
# of the Makefile, in the "BINARIES" variable.
#========================================================================

binaries: $(top_builddir)/versionhash.h $(BINARIES)

libraries:

#========================================================================
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
genstubs: $(srcdir)/generic/tdom.decls
	$(TCLSH_PROG) $(TCL_SRC_DIR)/tools/genStubs.tcl $(srcdir)/generic \
               $(srcdir)/generic/tdom.decls

#========================================================================
# Create a include file that #define the current fossil hash
#========================================================================
versionhash.h: $(srcdir)/manifest.uuid
	@echo "#define FOSSIL_HASH \"" | tr -d '\n\r' > $(top_builddir)/versionhash.h
	@cat $(srcdir)/manifest.uuid | tr -d '\n\r' >> $(top_builddir)/versionhash.h
	@echo "\"" >> $(top_builddir)/versionhash.h

tcldom.o: $(srcdir)/generic/tcldom.c $(top_builddir)/versionhash.h

#========================================================================







|







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
genstubs: $(srcdir)/generic/tdom.decls
	$(TCLSH_PROG) $(TCL_SRC_DIR)/tools/genStubs.tcl $(srcdir)/generic \
               $(srcdir)/generic/tdom.decls

#========================================================================
# Create a include file that #define the current fossil hash
#========================================================================
$(top_builddir)/versionhash.h: $(srcdir)/manifest.uuid
	@echo "#define FOSSIL_HASH \"" | tr -d '\n\r' > $(top_builddir)/versionhash.h
	@cat $(srcdir)/manifest.uuid | tr -d '\n\r' >> $(top_builddir)/versionhash.h
	@echo "\"" >> $(top_builddir)/versionhash.h

tcldom.o: $(srcdir)/generic/tcldom.c $(top_builddir)/versionhash.h

#========================================================================
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
	    $(DIST_DIR)/tclconfig/

	# Extension files
	$(DIST_INSTALL_DATA) \
	    $(srcdir)/CHANGES \
	    $(srcdir)/ChangeLog \
	    $(srcdir)/LICENSE \
	    $(srcdir)/NPL-1_1Final.html \
	    $(srcdir)/README \
	    $(srcdir)/README.AOL \
	    $(srcdir)/manifest \
	    $(srcdir)/manifest.uuid \
	    $(srcdir)/tdomConfig.sh.in \
	    $(srcdir)/tdom.m4 \
	    $(srcdir)/pkgIndex.tcl.in \







|







387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
	    $(DIST_DIR)/tclconfig/

	# Extension files
	$(DIST_INSTALL_DATA) \
	    $(srcdir)/CHANGES \
	    $(srcdir)/ChangeLog \
	    $(srcdir)/LICENSE \
	    $(srcdir)/MPL_2.0.html \
	    $(srcdir)/README \
	    $(srcdir)/README.AOL \
	    $(srcdir)/manifest \
	    $(srcdir)/manifest.uuid \
	    $(srcdir)/tdomConfig.sh.in \
	    $(srcdir)/tdom.m4 \
	    $(srcdir)/pkgIndex.tcl.in \
Deleted NPL-1_1Final.html.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
<HTML>
<HEAD>
<TITLE>Netscape Public License version 1.1</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">






   

   








<center><b><font size=+2>MOZILLA PUBLIC LICENSE</font></b>

<br><b>Version 1.1</b>

<p>

<hr WIDTH="20%"></center>



<p><b>1. Definitions.</b>

<ul><b>1.0.1. "Commercial Use" </b>means distribution or otherwise making

the Covered Code available to a third party.

<p><b>1.1. ''Contributor''</b> means each entity that creates or contributes

to the creation of Modifications.

<p><b>1.2. ''Contributor Version''</b> means the combination of the Original

Code, prior Modifications used by a Contributor, and the Modifications

made by that particular Contributor.

<p><b>1.3. ''Covered Code''</b> means the Original Code or Modifications

or the combination of the Original Code and Modifications, in each case

including portions thereof<b>.</b>

<p><b>1.4. ''Electronic Distribution Mechanism''</b> means a mechanism

generally accepted in the software development community for the electronic

transfer of data.

<p><b>1.5. ''Executable''</b> means Covered Code in any form other than

Source Code.

<p><b>1.6. ''Initial Developer''</b> means the individual or entity identified

as the Initial Developer in the Source Code notice required by <b>Exhibit

A</b>.

<p><b>1.7. ''Larger Work''</b> means a work which combines Covered Code

or portions thereof with code not governed by the terms of this License.

<p><b>1.8. ''License''</b> means this document.

<p><b>1.8.1. "Licensable"</b> means having the right to grant, to the maximum

extent possible, whether at the time of the initial grant or subsequently

acquired, any and all of the rights conveyed herein.

<p><b>1.9. ''Modifications''</b> means any addition to or deletion from

the substance or structure of either the Original Code or any previous

Modifications. When Covered Code is released as a series of files, a Modification

is:

<ul><b>A.</b> Any addition to or deletion from the contents of a file containing

Original Code or previous Modifications.

<p><b>B.</b> Any new file that contains any part of the Original Code or

previous Modifications.

<br>&nbsp;</ul>

<b>1.10. ''Original Code''</b> means Source Code of computer software code

which is described in the Source Code notice required by <b>Exhibit A</b>

as Original Code, and which, at the time of its release under this License

is not already Covered Code governed by this License.

<p><b>1.10.1. "Patent Claims"</b> means any patent claim(s), now owned

or hereafter acquired, including without limitation,&nbsp; method, process,

and apparatus claims, in any patent Licensable by grantor.

<p><b>1.11. ''Source Code''</b> means the preferred form of the Covered

Code for making modifications to it, including all modules it contains,

plus any associated interface definition files, scripts used to control

compilation and installation of an Executable, or source code differential

comparisons against either the Original Code or another well known, available

Covered Code of the Contributor's choice. The Source Code can be in a compressed

or archival form, provided the appropriate decompression or de-archiving

software is widely available for no charge.

<p><b>1.12. "You'' (or "Your")&nbsp;</b> means an individual or a legal

entity exercising rights under, and complying with all of the terms of,

this License or a future version of this License issued under Section 6.1.

For legal entities, "You'' includes any entity which controls, is controlled

by, or is under common control with You. For purposes of this definition,

"control'' means (a) the power, direct or indirect, to cause the direction

or management of such entity, whether by contract or otherwise, or (b)

ownership of more than fifty percent (50%) of the outstanding shares or

beneficial ownership of such entity.</ul>

<b>2. Source Code License.</b>

<ul><b>2.1. The Initial Developer Grant.</b>

<br>The Initial Developer hereby grants You a world-wide, royalty-free,

non-exclusive license, subject to third party intellectual property claims:

<ul><b>(a)</b>&nbsp;<b> </b>under intellectual property rights (other than

patent or trademark) Licensable by Initial Developer to use, reproduce,

modify, display, perform, sublicense and distribute the Original Code (or

portions thereof) with or without Modifications, and/or as part of a Larger

Work; and

<p><b>(b)</b> under Patents Claims infringed by the making, using or selling

of Original Code, to make, have made, use, practice, sell, and offer for

sale, and/or otherwise dispose of the Original Code (or portions thereof).

<ul>

<ul>&nbsp;</ul>

</ul>

<b>(c) </b>the licenses granted in this Section 2.1(a) and (b) are effective

on the date Initial Developer first distributes Original Code under the

terms of this License.

<p><b>(d) </b>Notwithstanding Section 2.1(b) above, no patent license is

granted: 1) for code that You delete from the Original Code; 2) separate

from the Original Code;&nbsp; or 3) for infringements caused by: i) the

modification of the Original Code or ii) the combination of the Original

Code with other software or devices.

<br>&nbsp;</ul>

<b>2.2. Contributor Grant.</b>

<br>Subject to third party intellectual property claims, each Contributor

hereby grants You a world-wide, royalty-free, non-exclusive license

<ul>&nbsp;

<br><b>(a)</b>&nbsp;<b> </b>under intellectual property rights (other than

patent or trademark) Licensable by Contributor, to use, reproduce, modify,

display, perform, sublicense and distribute the Modifications created by

such Contributor (or portions thereof) either on an unmodified basis, with

other Modifications, as Covered Code and/or as part of a Larger Work; and

<p><b>(b)</b> under Patent Claims infringed by the making, using, or selling

of&nbsp; Modifications made by that Contributor either alone and/or in<font color="#000000">

combination with its Contributor Version (or portions of such combination),

to make, use, sell, offer for sale, have made, and/or otherwise dispose

of: 1) Modifications made by that Contributor (or portions thereof); and

2) the combination of&nbsp; Modifications made by that Contributor with

its Contributor Version (or portions of such combination).</font>

<p><b>(c) </b>the licenses granted in Sections 2.2(a) and 2.2(b) are effective

on the date Contributor first makes Commercial Use of the Covered Code.

<p><b>(d)&nbsp;</b>&nbsp;&nbsp; Notwithstanding Section 2.2(b) above, no

patent license is granted: 1) for any code that Contributor has deleted

from the Contributor Version; 2)&nbsp; separate from the Contributor Version;&nbsp;

3)&nbsp; for infringements caused by: i) third party modifications of Contributor

Version or ii)&nbsp; the combination of Modifications made by that Contributor

with other software&nbsp; (except as part of the Contributor Version) or

other devices; or 4) under Patent Claims infringed by Covered Code in the

absence of Modifications made by that Contributor.</ul>

</ul>



<p><br><b>3. Distribution Obligations.</b>

<ul><b>3.1. Application of License.</b>

<br>The Modifications which You create or to which You contribute are governed

by the terms of this License, including without limitation Section <b>2.2</b>.

The Source Code version of Covered Code may be distributed only under the

terms of this License or a future version of this License released under

Section <b>6.1</b>, and You must include a copy of this License with every

copy of the Source Code You distribute. You may not offer or impose any

terms on any Source Code version that alters or restricts the applicable

version of this License or the recipients' rights hereunder. However, You

may include an additional document offering the additional rights described

in Section <b>3.5</b>.

<p><b>3.2. Availability of Source Code.</b>

<br>Any Modification which You create or to which You contribute must be

made available in Source Code form under the terms of this License either

on the same media as an Executable version or via an accepted Electronic

Distribution Mechanism to anyone to whom you made an Executable version

available; and if made available via Electronic Distribution Mechanism,

must remain available for at least twelve (12) months after the date it

initially became available, or at least six (6) months after a subsequent

version of that particular Modification has been made available to such

recipients. You are responsible for ensuring that the Source Code version

remains available even if the Electronic Distribution Mechanism is maintained

by a third party.

<p><b>3.3. Description of Modifications.</b>

<br>You must cause all Covered Code to which You contribute to contain

a file documenting the changes You made to create that Covered Code and

the date of any change. You must include a prominent statement that the

Modification is derived, directly or indirectly, from Original Code provided

by the Initial Developer and including the name of the Initial Developer

in (a) the Source Code, and (b) in any notice in an Executable version

or related documentation in which You describe the origin or ownership

of the Covered Code.

<p><b>3.4. Intellectual Property Matters</b>

<ul><b>(a) Third Party Claims</b>.

<br>If Contributor has knowledge that a license under a third party's intellectual

property rights is required to exercise the rights granted by such Contributor

under Sections 2.1 or 2.2, Contributor must include a text file with the

Source Code distribution titled "LEGAL'' which describes the claim and

the party making the claim in sufficient detail that a recipient will know

whom to contact. If Contributor obtains such knowledge after the Modification

is made available as described in Section 3.2, Contributor shall promptly

modify the LEGAL file in all copies Contributor makes available thereafter

and shall take other steps (such as notifying appropriate mailing lists

or newsgroups) reasonably calculated to inform those who received the Covered

Code that new knowledge has been obtained.

<p><b>(b) Contributor APIs</b>.

<br>If Contributor's Modifications include an application programming interface

and Contributor has knowledge of patent licenses which are reasonably necessary

to implement that API, Contributor must also include this information in

the LEGAL file.

<br>&nbsp;</ul>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>(c)&nbsp;&nbsp;&nbsp;

Representations.</b>

<ul>Contributor represents that, except as disclosed pursuant to Section

3.4(a) above, Contributor believes that Contributor's Modifications are

Contributor's original creation(s) and/or Contributor has sufficient rights

to grant the rights conveyed by this License.</ul>



<p><br><b>3.5. Required Notices.</b>

<br>You must duplicate the notice in <b>Exhibit A</b> in each file of the

Source Code.&nbsp; If it is not possible to put such notice in a particular

Source Code file due to its structure, then You must include such notice

in a location (such as a relevant directory) where a user would be likely

to look for such a notice.&nbsp; If You created one or more Modification(s)

You may add your name as a Contributor to the notice described in <b>Exhibit

A</b>.&nbsp; You must also duplicate this License in any documentation

for the Source Code where You describe recipients' rights or ownership

rights relating to Covered Code.&nbsp; You may choose to offer, and to

charge a fee for, warranty, support, indemnity or liability obligations

to one or more recipients of Covered Code. However, You may do so only

on Your own behalf, and not on behalf of the Initial Developer or any Contributor.

You must make it absolutely clear than any such warranty, support, indemnity

or liability obligation is offered by You alone, and You hereby agree to

indemnify the Initial Developer and every Contributor for any liability

incurred by the Initial Developer or such Contributor as a result of warranty,

support, indemnity or liability terms You offer.

<p><b>3.6. Distribution of Executable Versions.</b>

<br>You may distribute Covered Code in Executable form only if the requirements

of Section <b>3.1-3.5</b> have been met for that Covered Code, and if You

include a notice stating that the Source Code version of the Covered Code

is available under the terms of this License, including a description of

how and where You have fulfilled the obligations of Section <b>3.2</b>.

The notice must be conspicuously included in any notice in an Executable

version, related documentation or collateral in which You describe recipients'

rights relating to the Covered Code. You may distribute the Executable

version of Covered Code or ownership rights under a license of Your choice,

which may contain terms different from this License, provided that You

are in compliance with the terms of this License and that the license for

the Executable version does not attempt to limit or alter the recipient's

rights in the Source Code version from the rights set forth in this License.

If You distribute the Executable version under a different license You

must make it absolutely clear that any terms which differ from this License

are offered by You alone, not by the Initial Developer or any Contributor.

You hereby agree to indemnify the Initial Developer and every Contributor

for any liability incurred by the Initial Developer or such Contributor

as a result of any such terms You offer.

<p><b>3.7. Larger Works.</b>

<br>You may create a Larger Work by combining Covered Code with other code

not governed by the terms of this License and distribute the Larger Work

as a single product. In such a case, You must make sure the requirements

of this License are fulfilled for the Covered Code.</ul>

<b>4. Inability to Comply Due to Statute or Regulation.</b>

<ul>If it is impossible for You to comply with any of the terms of this

License with respect to some or all of the Covered Code due to statute,

judicial order, or regulation then You must: (a) comply with the terms

of this License to the maximum extent possible; and (b) describe the limitations

and the code they affect. Such description must be included in the LEGAL

file described in Section <b>3.4</b> and must be included with all distributions

of the Source Code. Except to the extent prohibited by statute or regulation,

such description must be sufficiently detailed for a recipient of ordinary

skill to be able to understand it.</ul>

<b>5. Application of this License.</b>

<ul>This License applies to code to which the Initial Developer has attached

the notice in <b>Exhibit A</b> and to related Covered Code.</ul>

<b>6. Versions of the License.</b>

<ul><b>6.1. New Versions</b>.

<br>Netscape Communications Corporation (''Netscape'') may publish revised

and/or new versions of the License from time to time. Each version will

be given a distinguishing version number.

<p><b>6.2. Effect of New Versions</b>.

<br>Once Covered Code has been published under a particular version of

the License, You may always continue to use it under the terms of that

version. You may also choose to use such Covered Code under the terms of

any subsequent version of the License published by Netscape. No one other

than Netscape has the right to modify the terms applicable to Covered Code

created under this License.

<p><b>6.3. Derivative Works</b>.

<br>If You create or use a modified version of this License (which you

may only do in order to apply it to code which is not already Covered Code

governed by this License), You must (a) rename Your license so that the

phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL''

or any confusingly similar phrase do not appear in your license (except

to note that your license differs from this License) and (b) otherwise

make it clear that Your version of the license contains terms which differ

from the Mozilla Public License and Netscape Public License. (Filling in

the name of the Initial Developer, Original Code or Contributor in the

notice described in <b>Exhibit A</b> shall not of themselves be deemed

to be modifications of this License.)</ul>

<b>7. DISCLAIMER OF WARRANTY.</b>

<ul>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT

WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,

WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT

FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY

AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE

PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER

CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION.

THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.

NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.</ul>

<b>8. TERMINATION.</b>

<ul><b>8.1.&nbsp; </b>This License and the rights granted hereunder will

terminate automatically if You fail to comply with terms herein and fail

to cure such breach within 30 days of becoming aware of the breach. All

sublicenses to the Covered Code which are properly granted shall survive

any termination of this License. Provisions which, by their nature, must

remain in effect beyond the termination of this License shall survive.

<p><b>8.2.&nbsp; </b>If You initiate litigation by asserting a patent infringement

claim (excluding declatory judgment actions) against Initial Developer

or a Contributor (the Initial Developer or Contributor against whom You

file such action is referred to as "Participant")&nbsp; alleging that:

<p><b>(a)&nbsp; </b>such Participant's Contributor Version directly or

indirectly infringes any patent, then any and all rights granted by such

Participant to You under Sections 2.1 and/or 2.2 of this License shall,

upon 60 days notice from Participant terminate prospectively, unless if

within 60 days after receipt of notice You either: (i)&nbsp; agree in writing

to pay Participant a mutually agreeable reasonable royalty for Your past

and future use of Modifications made by such Participant, or (ii) withdraw

Your litigation claim with respect to the Contributor Version against such

Participant.&nbsp; If within 60 days of notice, a reasonable royalty and

payment arrangement are not mutually agreed upon in writing by the parties

or the litigation claim is not withdrawn, the rights granted by Participant

to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration

of the 60 day notice period specified above.

<p><b>(b)</b>&nbsp; any software, hardware, or device, other than such

Participant's Contributor Version, directly or indirectly infringes any

patent, then any rights granted to You by such Participant under Sections

2.1(b) and 2.2(b) are revoked effective as of the date You first made,

used, sold, distributed, or had made, Modifications made by that Participant.

<p><b>8.3.&nbsp; </b>If You assert a patent infringement claim against

Participant alleging that such Participant's Contributor Version directly

or indirectly infringes any patent where such claim is resolved (such as

by license or settlement) prior to the initiation of patent infringement

litigation, then the reasonable value of the licenses granted by such Participant

under Sections 2.1 or 2.2 shall be taken into account in determining the

amount or value of any payment or license.

<p><b>8.4.</b>&nbsp; In the event of termination under Sections 8.1 or

8.2 above,&nbsp; all end user license agreements (excluding distributors

and resellers) which have been validly granted by You or any distributor

hereunder prior to termination shall survive termination.</ul>

<b>9. LIMITATION OF LIABILITY.</b>

<ul>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING

NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER,

ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER

OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,

INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT

LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE

OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN

IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES.

THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR

PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE

LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION

OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION

AND LIMITATION MAY NOT APPLY TO YOU.</ul>

<b>10. U.S. GOVERNMENT END USERS.</b>

<ul>The Covered Code is a ''commercial item,'' as that term is defined

in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software''

and ''commercial computer software documentation,'' as such terms are used

in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and

48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government

End Users acquire Covered Code with only those rights set forth herein.</ul>

<b>11. MISCELLANEOUS.</b>

<ul>This License represents the complete agreement concerning subject matter

hereof. If any provision of this License is held to be unenforceable, such

provision shall be reformed only to the extent necessary to make it enforceable.

This License shall be governed by California law provisions (except to

the extent applicable law, if any, provides otherwise), excluding its conflict-of-law

provisions. With respect to disputes in which at least one party is a citizen

of, or an entity chartered or registered to do business in the United States

of America, any litigation relating to this License shall be subject to

the jurisdiction of the Federal Courts of the Northern District of California,

with venue lying in Santa Clara County, California, with the losing party

responsible for costs, including without limitation, court costs and reasonable

attorneys' fees and expenses. The application of the United Nations Convention

on Contracts for the International Sale of Goods is expressly excluded.

Any law or regulation which provides that the language of a contract shall

be construed against the drafter shall not apply to this License.</ul>

<b>12. RESPONSIBILITY FOR CLAIMS.</b>

<ul>As between Initial Developer and the Contributors, each party is responsible

for claims and damages arising, directly or indirectly, out of its utilization

of rights under this License and You agree to work with Initial Developer

and Contributors to distribute such responsibility on an equitable basis.

Nothing herein is intended or shall be deemed to constitute any admission

of liability.</ul>

<b>13. MULTIPLE-LICENSED CODE.</b>

<ul>Initial Developer may designate portions of the Covered Code as �Multiple-Licensed�.&nbsp;

�Multiple-Licensed� means that the Initial Developer permits you to utilize

portions of the Covered Code under Your choice of the NPL or the alternative

licenses, if any, specified by the Initial Developer in the file described

in Exhibit A.</ul>



<p><br><b>EXHIBIT A -Mozilla Public License.</b>

<ul>``The contents of this file are subject to the Mozilla Public License

Version 1.1 (the "License"); you may not use this file except in compliance

with the License. You may obtain a copy of the License at

<br>http://www.mozilla.org/MPL/

<p>Software distributed under the License is distributed on an "AS IS"

basis, WITHOUT WARRANTY OF

<br>ANY KIND, either express or implied. See the License for the specific

language governing rights and

<br>limitations under the License.

<p>The Original Code is ______________________________________.

<p>The Initial Developer of the Original Code is ________________________.

Portions created by

<br>&nbsp;______________________ are Copyright (C) ______ _______________________.

All Rights

<br>Reserved.

<p>Contributor(s): ______________________________________.

<p>Alternatively, the contents of this file may be used under the terms

of the _____ license (the&nbsp; �[___] License�), in which case the provisions

of [______] License are applicable&nbsp; instead of those above.&nbsp;

If you wish to allow use of your version of this file only under the terms

of the [____] License and not to allow others to use your version of this

file under the MPL, indicate your decision by deleting&nbsp; the provisions

above and replace&nbsp; them with the notice and other provisions required

by the [___] License.&nbsp; If you do not delete the provisions above,

a recipient may use your version of this file under either the MPL or the

[___] License."

<p>[NOTE: The text of this Exhibit A may differ slightly from the text

of the notices in the Source Code files of the Original Code. You should

use the text of this Exhibit A rather than the text found in the Original

Code Source Code for Your Modifications.]

<p>

<hr WIDTH="100%">

<br><b>AMENDMENTS</b>

<p><b>The Netscape Public License Version 1.1 ("NPL") consists of the Mozilla

Public License Version 1.1 with the following Amendments, including Exhibit

A-Netscape Public License.&nbsp; Files identified with "Exhibit A-Netscape

Public License" are governed by the Netscape Public License Version 1.1.</b>

<p><b>Additional Terms applicable to the Netscape Public License.</b>

<ul><b>I. Effect.</b>

<br>These additional terms described in this Netscape Public <nobr>License

--</nobr> Amendments shall apply to the Mozilla Communicator client code

and to all Covered Code under this License.

<p><b>II. </b>''<b>Netscape's Branded Code''</b> means Covered Code that

Netscape distributes and/or permits others to distribute under one or more

trademark(s) which are controlled by Netscape but which are not licensed

for use under this License.

<p><b>III. Netscape and logo.</b>

<br>This License does not grant any rights to use the trademarks "Netscape'',

the "Netscape N and horizon'' logo or the "Netscape lighthouse" logo, "Netcenter",

"Gecko", "Java" or "JavaScript", "Smart Browsing" even if such marks are

included in the Original Code or Modifications.

<p><b>IV. Inability to Comply Due to Contractual Obligation.</b>

<br>Prior to licensing the Original Code under this License, Netscape has

licensed third party code for use in Netscape's Branded Code. To the extent

that Netscape is limited contractually from making such third party code

available under this License, Netscape may choose to reintegrate such code

into Covered Code without being required to distribute such code in Source

Code form, even if such code would otherwise be considered ''Modifications''

under this License.

<p><b>V. Use of Modifications and Covered Code by Initial Developer.</b>

<ul><b>V.1. In General.</b>

<br>The obligations of Section <b>3</b> apply to Netscape, except to the

extent specified in this Amendment, Section <b>V.2</b> and <b>V.3</b>.

<p><b>V.2. Other Products.</b>

<br>Netscape may include Covered Code in products other than the Netscape's

Branded Code which are released by Netscape during the two (2) years following

the release date of the Original Code, without such additional products

becoming subject to the terms of this License, and may license such additional

products on different terms from those contained in this License.

<p><b>V.3. Alternative Licensing.</b>

<br>Netscape may license the Source Code of Netscape's Branded Code, including

Modifications incorporated therein, without such Netscape Branded Code

becoming subject to the terms of this License, and may license such Netscape

Branded Code on different terms from those contained in this License.

<br>&nbsp;</ul>

<b>VI. Litigation.</b>

<br>Notwithstanding the limitations of Section 11 above, the provisions

regarding litigation in Section 11(a), (b) and (c) of the License shall

apply to all disputes relating to this License.</ul>



<p><br><b>EXHIBIT A-Netscape Public License.</b>

<ul>&nbsp;

<br>''The contents of this file are subject to the Netscape Public License

Version 1.1 (the "License"); you may not use this file except in compliance

with the License. You may obtain a copy of the License at http://www.mozilla.org/NPL/

<p>Software distributed under the License is distributed on an "AS IS"

basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the

License for the specific language governing rights and limitations under

the License.

<p>The Original Code is Mozilla Communicator client code, released March

31, 1998.

<p>The Initial Developer of the Original Code is Netscape Communications

Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape

Communications Corporation. All Rights Reserved.

<p>Contributor(s): ______________________________________.</ul>



<ul>&nbsp;

<br>Alternatively, the contents of this file may be used under the terms

of the _____ license (the&nbsp; �[___] License�), in which case the provisions

of [______] License are applicable&nbsp; instead of those above.&nbsp;

If you wish to allow use of your version of this file only under the terms

of the [____] License and not to allow others to use your version of this

file under the NPL, indicate your decision by deleting&nbsp; the provisions

above and replace&nbsp; them with the notice and other provisions required

by the [___] License.&nbsp; If you do not delete the provisions above,

a recipient may use your version of this file under either the NPL or the

[___] License."</ul>

</ul>



</BODY>
</HTML>
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Changes to README.
1
2
3
4
5
6
7
8
9
10
11


    tDOM - a XML/DOM/XPath/XSLT/HTML/JSON implementation for Tcl
                          (Version 0.9.1)


This directory contains a freely distributable thread-safe extension
to Tcl/Tk called tDOM.

tDOM contains:




|







1
2
3
4
5
6
7
8
9
10
11


    tDOM - a XML/DOM/XPath/XSLT/HTML/JSON implementation for Tcl
                          (Version 0.9.2)


This directory contains a freely distributable thread-safe extension
to Tcl/Tk called tDOM.

tDOM contains:

Changes to README.AOL.
1
2
3
4
5
6
7
8
9
10
11


              tDOM - a XML/DOM/XPath/XSLT implementation for Tcl
                          (Version 0.9.1)

		    Jochen Loewer ([email protected])
                       Rolf Ade ([email protected])

                       with some contributions by:

                 Zoran Vasiljevic ([email protected])



|







1
2
3
4
5
6
7
8
9
10
11


              tDOM - a XML/DOM/XPath/XSLT implementation for Tcl
                          (Version 0.9.2)

		    Jochen Loewer ([email protected])
                       Rolf Ade ([email protected])

                       with some contributions by:

                 Zoran Vasiljevic ([email protected])
Changes to apps/xslt.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#----------------------------------------------------------------------------
#   Copyright (c) 1999-2001 Jochen Loewer ([email protected])   
#----------------------------------------------------------------------------
#
#   $Id$
#
#
#   A simple command line XSLT processor using tDOMs XSLT engine.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 1.1 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#----------------------------------------------------------------------------
#   Copyright (c) 1999-2001 Jochen Loewer ([email protected])   
#----------------------------------------------------------------------------
#
#   $Id$
#
#
#   A simple command line XSLT processor using tDOMs XSLT engine.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 2.0 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.
Changes to configure.
1
2
3
4
5
6
7
8
9
10
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for tdom 0.9.1.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.


|







1
2
3
4
5
6
7
8
9
10
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for tdom 0.9.2.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='tdom'
PACKAGE_TARNAME='tdom'
PACKAGE_VERSION='0.9.1'
PACKAGE_STRING='tdom 0.9.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H







|
|







573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='tdom'
PACKAGE_TARNAME='tdom'
PACKAGE_VERSION='0.9.2'
PACKAGE_STRING='tdom 0.9.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # Omit some internal or obsolete options to make the list less imposing.
  # This message is too long to be a string in the A/UX 3.1 sh.
  cat <<_ACEOF
\`configure' configures tdom 0.9.1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.







|







1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # Omit some internal or obsolete options to make the list less imposing.
  # This message is too long to be a string in the A/UX 3.1 sh.
  cat <<_ACEOF
\`configure' configures tdom 0.9.2 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380

  cat <<\_ACEOF
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of tdom 0.9.1:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]







|







1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380

  cat <<\_ACEOF
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of tdom 0.9.2:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
tdom configure 0.9.1
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit







|







1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
tdom configure 0.9.2
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_func
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by tdom $as_me 0.9.1, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{







|







1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_func
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by tdom $as_me 0.9.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tdom $as_me 0.9.1, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@







|







9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tdom $as_me 0.9.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427

Report bugs to the package provider."

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
tdom config.status 0.9.1
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."








|







9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427

Report bugs to the package provider."

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
tdom config.status 0.9.2
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

Changes to configure.ac.
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
# set as provided.  These will also be added as -D defs in your Makefile
# so you can encode the package version directly into the source files.
# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
# so that we create the export library with the dll.
#-----------------------------------------------------------------------

AC_INIT([tdom], [0.9.1])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------








|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
# set as provided.  These will also be added as -D defs in your Makefile
# so you can encode the package version directly into the source files.
# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
# so that we create the export library with the dll.
#-----------------------------------------------------------------------

AC_INIT([tdom], [0.9.2])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------

Changes to doc/dom.html.
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
                    <dd>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is what the expat API
                    function XML_ExpatVersion() returns.</dd>
                
                
                    <dt><b>expatmajorversion</b></dt>
                    <dd>Returns the major version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>expatminorversion</b></dt>
                    <dd>Returns the minor version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>expatmicroversion</b></dt>
                    <dd>Returns the micro version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>dtd</b></dt>
                    <dd>Returns as boolean if build with
                    <i class="m">--enable-dtd</i>.</dd>
                
                







|
|



|
|



|
|







586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
                    <dd>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is what the expat API
                    function XML_ExpatVersion() returns.</dd>
                
                
                    <dt><b>expatmajorversion</b></dt>
                    <dd>Returns the major version of the at build time
                    used expat version as integer.</dd>
                
                
                    <dt><b>expatminorversion</b></dt>
                    <dd>Returns the minor version of the at build time
                    used expat version as integer.</dd>
                
                
                    <dt><b>expatmicroversion</b></dt>
                    <dd>Returns the micro version of the at build time
                    used expat version as integer.</dd>
                
                
                    <dt><b>dtd</b></dt>
                    <dd>Returns as boolean if build with
                    <i class="m">--enable-dtd</i>.</dd>
                
                
Changes to doc/dom.n.
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
.RS
.IP "\fBexpatversion\fR"
Returns the version of the underlyling expat
version as string, something like
"exapt_2.1.0". This is what the expat API
function XML_ExpatVersion() returns.
.IP "\fBexpatmajorversion\fR"
Returns the major version of the underlyling
expat version as integer.
.IP "\fBexpatminorversion\fR"
Returns the minor version of the underlyling
expat version as integer.
.IP "\fBexpatmicroversion\fR"
Returns the micro version of the underlyling
expat version as integer.
.IP "\fBdtd\fR"
Returns as boolean if build with
\&\fI--enable-dtd\fR.
.IP "\fBns\fR"
Returns as boolean if build with
\&\fI--enable-ns\fR.
.IP "\fBunknown\fR"







|
|

|
|

|
|







622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
.RS
.IP "\fBexpatversion\fR"
Returns the version of the underlyling expat
version as string, something like
"exapt_2.1.0". This is what the expat API
function XML_ExpatVersion() returns.
.IP "\fBexpatmajorversion\fR"
Returns the major version of the at build
time used version as integer.
.IP "\fBexpatminorversion\fR"
Returns the minor version of the at build
time used expat version as integer.
.IP "\fBexpatmicroversion\fR"
Returns the micro version of the at build
time used expat version as integer.
.IP "\fBdtd\fR"
Returns as boolean if build with
\&\fI--enable-dtd\fR.
.IP "\fBns\fR"
Returns as boolean if build with
\&\fI--enable-ns\fR.
.IP "\fBunknown\fR"
Changes to doc/dom.xml.
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
                    <desc>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is what the expat API
                    function XML_ExpatVersion() returns.</desc>
                </optdef>
                <optdef>
                    <optname>expatmajorversion</optname>
                    <desc>Returns the major version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatminorversion</optname>
                    <desc>Returns the minor version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatmicroversion</optname>
                    <desc>Returns the micro version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>dtd</optname>
                    <desc>Returns as boolean if build with
                    <m>--enable-dtd</m>.</desc>
                </optdef>
                <optdef>







|
|



|
|



|
|







551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
                    <desc>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is what the expat API
                    function XML_ExpatVersion() returns.</desc>
                </optdef>
                <optdef>
                    <optname>expatmajorversion</optname>
                    <desc>Returns the major version of the at build
                    time used expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatminorversion</optname>
                    <desc>Returns the minor version of the at build
                    time used expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatmicroversion</optname>
                    <desc>Returns the micro version of the at build
                    time used expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>dtd</optname>
                    <desc>Returns as boolean if build with
                    <m>--enable-dtd</m>.</desc>
                </optdef>
                <optdef>
Changes to doc/pullparser.html.
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
        <dt><b class="method">line</b></dt>
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the line number of the parsing
        position.</dd>
      

      
        <dt><b class="method">line</b></dt>
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position.</dd>
      
    </dl>

  <h2><a name="SECTid0x11e0cb0">KEYWORDS</a></h2><p class="keywords">







|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
        <dt><b class="method">line</b></dt>
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the line number of the parsing
        position.</dd>
      

      
        <dt><b class="method">column</b></dt>
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position.</dd>
      
    </dl>

  <h2><a name="SECTid0x11e0cb0">KEYWORDS</a></h2><p class="keywords">
Changes to doc/pullparser.n.
295
296
297
298
299
300
301
302
303
304
305
306
307
Miscellaneous methods:
.TP
\&\fB\fBline\fP
\&\fRThis method is valid in all parser states except READY
and TEXT. It returns the line number of the parsing
position.
.TP
\&\fB\fBline\fP
\&\fRThis method is valid in all parser states except READY
and TEXT. It returns the offset, from the beginning of the
current line, of the parsing position.
.SH KEYWORDS
XML, pull, parsing







|





295
296
297
298
299
300
301
302
303
304
305
306
307
Miscellaneous methods:
.TP
\&\fB\fBline\fP
\&\fRThis method is valid in all parser states except READY
and TEXT. It returns the line number of the parsing
position.
.TP
\&\fB\fBcolumn\fP
\&\fRThis method is valid in all parser states except READY
and TEXT. It returns the offset, from the beginning of the
current line, of the parsing position.
.SH KEYWORDS
XML, pull, parsing
Changes to doc/pullparser.xml.
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
        <command><method>line</method></command>
        <desc>This method is valid in all parser states except READY
        and TEXT. It returns the line number of the parsing
        position.</desc>
      </commanddef>

      <commanddef>
        <command><method>line</method></command>
        <desc>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position.</desc>
      </commanddef>
    </commandlist>
  </section>








|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
        <command><method>line</method></command>
        <desc>This method is valid in all parser states except READY
        and TEXT. It returns the line number of the parsing
        position.</desc>
      </commanddef>

      <commanddef>
        <command><method>column</method></command>
        <desc>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position.</desc>
      </commanddef>
    </commandlist>
  </section>

Changes to expat/expat.h.
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085


/* Expat follows the semantic versioning convention.
   See http://semver.org.
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 2
#define XML_MICRO_VERSION 5

#ifdef __cplusplus
}
#endif

#endif /* not Expat_INCLUDED */







|






1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085


/* Expat follows the semantic versioning convention.
   See http://semver.org.
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 2
#define XML_MICRO_VERSION 6

#ifdef __cplusplus
}
#endif

#endif /* not Expat_INCLUDED */
Deleted expat/macconfig.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*================================================================
** Copyright 2000, Clark Cooper
** All rights reserved.
**
** This is free software. You are permitted to copy, distribute, or modify
** it under the terms of the MIT/X license (contained in the COPYING file
** with this distribution.)
**
*/

#ifndef MACCONFIG_H
#define MACCONFIG_H


/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#define BYTEORDER  4321

/* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY

/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE

/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP

/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* whether byteorder is bigendian */
#define WORDS_BIGENDIAN

/* Define to specify how much context to retain around the current parse
   point. */
#undef XML_CONTEXT_BYTES

/* Define to make parameter entity parsing functionality available. */
#define XML_DTD

/* Define to make XML Namespaces functionality available. */
#define XML_NS

/* Define to empty if `const' does not conform to ANSI C. */
#undef const

/* Define to `long' if <sys/types.h> does not define. */
#define off_t  long

/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t


#endif /* ifndef MACCONFIG_H */
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































Changes to expat/siphash.h.
1
2
3
4
5
6
7
8
9
10
11
12
13






14
15
16
17
18
19
20
/* ==========================================================================
 * siphash.h - SipHash-2-4 in a single header file
 * --------------------------------------------------------------------------
 * Derived by William Ahern from the reference implementation[1] published[2]
 * by Jean-Philippe Aumasson and Daniel J. Berstein.
 * Minimal changes by Sebastian Pipping and Victor Stinner on top, see below.
 * Licensed under the CC0 Public Domain Dedication license.
 *
 * 1. https://www.131002.net/siphash/siphash24.c
 * 2. https://www.131002.net/siphash/
 * --------------------------------------------------------------------------
 * HISTORY:
 *






 * 2017-07-25  (Vadim Zeitlin)
 *   - Fix use of SIPHASH_MAIN macro
 *
 * 2017-07-05  (Sebastian Pipping)
 *   - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++
 *   - Add const qualifiers at two places
 *   - Ensure <=80 characters line length (assuming tab width 4)













>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ==========================================================================
 * siphash.h - SipHash-2-4 in a single header file
 * --------------------------------------------------------------------------
 * Derived by William Ahern from the reference implementation[1] published[2]
 * by Jean-Philippe Aumasson and Daniel J. Berstein.
 * Minimal changes by Sebastian Pipping and Victor Stinner on top, see below.
 * Licensed under the CC0 Public Domain Dedication license.
 *
 * 1. https://www.131002.net/siphash/siphash24.c
 * 2. https://www.131002.net/siphash/
 * --------------------------------------------------------------------------
 * HISTORY:
 *
 * 2018-07-08  (Anton Maklakov)
 *   - Add "fall through" markers for GCC's -Wimplicit-fallthrough
 *
 * 2017-11-03  (Sebastian Pipping)
 *   - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined
 *
 * 2017-07-25  (Vadim Zeitlin)
 *   - Fix use of SIPHASH_MAIN macro
 *
 * 2017-07-05  (Sebastian Pipping)
 *   - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++
 *   - Add const qualifiers at two places
 *   - Ensure <=80 characters line length (assuming tab width 4)
146
147
148
149
150
151
152


153
154
155
156
157
158
159


160
161
162
163
164
165
166

static struct sipkey *sip_tokey(struct sipkey *key, const void *src) {
	key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
	key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
	return key;
} /* sip_tokey() */




#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v))

static void *sip_tobin(void *dst, uint64_t u64) {
	SIP_U64TO8_LE((unsigned char *)dst, u64);
	return dst;
} /* sip_tobin() */




static void sip_round(struct siphash *H, const int rounds) {
	int i;

	for (i = 0; i < rounds; i++) {
		H->v0 += H->v1;







>
>







>
>







152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

static struct sipkey *sip_tokey(struct sipkey *key, const void *src) {
	key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
	key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
	return key;
} /* sip_tokey() */


#ifdef SIPHASH_TOBIN

#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v))

static void *sip_tobin(void *dst, uint64_t u64) {
	SIP_U64TO8_LE((unsigned char *)dst, u64);
	return dst;
} /* sip_tobin() */

#endif  /* SIPHASH_TOBIN */


static void sip_round(struct siphash *H, const int rounds) {
	int i;

	for (i = 0; i < rounds; i++) {
		H->v0 += H->v1;
227
228
229
230
231
232
233

234

235

236

237

238

239

240
241
242
243
244
245
246

static uint64_t sip24_final(struct siphash *H) {
	const char left = (char)(H->p - H->buf);
	uint64_t b = (H->c + left) << 56;

	switch (left) {
	case 7: b |= (uint64_t)H->buf[6] << 48;

	case 6: b |= (uint64_t)H->buf[5] << 40;

	case 5: b |= (uint64_t)H->buf[4] << 32;

	case 4: b |= (uint64_t)H->buf[3] << 24;

	case 3: b |= (uint64_t)H->buf[2] << 16;

	case 2: b |= (uint64_t)H->buf[1] << 8;

	case 1: b |= (uint64_t)H->buf[0] << 0;

	case 0: break;
	}

	H->v3 ^= b;
	sip_round(H, 2);
	H->v0 ^= b;
	H->v2 ^= 0xff;







>

>

>

>

>

>

>







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263

static uint64_t sip24_final(struct siphash *H) {
	const char left = (char)(H->p - H->buf);
	uint64_t b = (H->c + left) << 56;

	switch (left) {
	case 7: b |= (uint64_t)H->buf[6] << 48;
		/* fall through */
	case 6: b |= (uint64_t)H->buf[5] << 40;
		/* fall through */
	case 5: b |= (uint64_t)H->buf[4] << 32;
		/* fall through */
	case 4: b |= (uint64_t)H->buf[3] << 24;
		/* fall through */
	case 3: b |= (uint64_t)H->buf[2] << 16;
		/* fall through */
	case 2: b |= (uint64_t)H->buf[1] << 8;
		/* fall through */
	case 1: b |= (uint64_t)H->buf[0] << 0;
		/* fall through */
	case 0: break;
	}

	H->v3 ^= b;
	sip_round(H, 2);
	H->v0 ^= b;
	H->v2 ^= 0xff;
Changes to expat/xmlparse.c.
1
2
3
4
5
6
7
8
/* 4b74aa710b4ed5ce464b0ce544852cb47bf905c85a49c7bae2749f5885cb966d (2.2.5+)
                            __  __            _
                         ___\ \/ /_ __   __ _| |_
                        / _ \\  /| '_ \ / _` | __|
                       |  __//  \| |_) | (_| | |_
                        \___/_/\_\ .__/ \__,_|\__|
                                 |_| XML parser

|







1
2
3
4
5
6
7
8
/* 19ac4776051591216f1874e34ee99b6a43a3784c8bd7d70efeb9258dd22b906a (2.2.6+)
                            __  __            _
                         ___\ \/ /_ __   __ _| |_
                        / _ \\  /| '_ \ / _` | __|
                       |  __//  \| |_) | (_| | |_
                        \___/_/\_\ .__/ \__,_|\__|
                                 |_| XML parser

157
158
159
160
161
162
163



164
165
166
167
168
169
170
#define XML_L(x) x

#endif

/* Round up n to be a multiple of sz, where sz is a power of 2. */
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))




/* Handle the case where memmove() doesn't exist. */
#ifndef HAVE_MEMMOVE
#ifdef HAVE_BCOPY
#define memmove(d,s,l) bcopy((s),(d),(l))
#else
#error memmove does not exist on this platform, nor is a substitute available
#endif /* HAVE_BCOPY */







>
>
>







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#define XML_L(x) x

#endif

/* Round up n to be a multiple of sz, where sz is a power of 2. */
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))

/* Do safe (NULL-aware) pointer arithmetic */
#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)

/* Handle the case where memmove() doesn't exist. */
#ifndef HAVE_MEMMOVE
#ifdef HAVE_BCOPY
#define memmove(d,s,l) bcopy((s),(d),(l))
#else
#error memmove does not exist on this platform, nor is a substitute available
#endif /* HAVE_BCOPY */
1816
1817
1818
1819
1820
1821
1822

1823
1824
1825
1826
1827
1828
1829
    parser->m_errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  case XML_INITIALIZED:
    if (parser->m_parentParser == NULL && !startParsing(parser)) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return XML_STATUS_ERROR;
    }

  default:
    parser->m_parsingStatus.parsing = XML_PARSING;
  }

  if (len == 0) {
    parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
    if (!isFinal)







>







1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
    parser->m_errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  case XML_INITIALIZED:
    if (parser->m_parentParser == NULL && !startParsing(parser)) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return XML_STATUS_ERROR;
    }
    /* fall through */
  default:
    parser->m_parsingStatus.parsing = XML_PARSING;
  }

  if (len == 0) {
    parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
    if (!isFinal)
1965
1966
1967
1968
1969
1970
1971

1972
1973
1974
1975
1976
1977
1978
    parser->m_errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  case XML_INITIALIZED:
    if (parser->m_parentParser == NULL && !startParsing(parser)) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return XML_STATUS_ERROR;
    }

  default:
    parser->m_parsingStatus.parsing = XML_PARSING;
  }

  start = parser->m_bufferPtr;
  parser->m_positionPtr = start;
  parser->m_bufferEnd += len;







>







1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
    parser->m_errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  case XML_INITIALIZED:
    if (parser->m_parentParser == NULL && !startParsing(parser)) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return XML_STATUS_ERROR;
    }
    /* fall through */
  default:
    parser->m_parsingStatus.parsing = XML_PARSING;
  }

  start = parser->m_bufferPtr;
  parser->m_positionPtr = start;
  parser->m_bufferEnd += len;
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034


2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048

2049
2050
2051
2052
2053

2054

2055

2056

2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083

2084
2085
2086

2087
2088
2089

2090
2091
2092
2093
2094
2095

2096


2097


2098

2099
2100
2101
2102
2103
2104
2105
    return NULL;
  case XML_FINISHED:
    parser->m_errorCode = XML_ERROR_FINISHED;
    return NULL;
  default: ;
  }

  if (len > parser->m_bufferLim - parser->m_bufferEnd) {
#ifdef XML_CONTEXT_BYTES
    int keep;
#endif  /* defined XML_CONTEXT_BYTES */
    /* Do not invoke signed arithmetic overflow: */
    int neededSize = (int) ((unsigned)len + (unsigned)(parser->m_bufferEnd - parser->m_bufferPtr));


    if (neededSize < 0) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return NULL;
    }
#ifdef XML_CONTEXT_BYTES
    keep = (int)(parser->m_bufferPtr - parser->m_buffer);
    if (keep > XML_CONTEXT_BYTES)
      keep = XML_CONTEXT_BYTES;
    neededSize += keep;
#endif  /* defined XML_CONTEXT_BYTES */
    if (neededSize  <= parser->m_bufferLim - parser->m_buffer) {
#ifdef XML_CONTEXT_BYTES
      if (keep < parser->m_bufferPtr - parser->m_buffer) {
        int offset = (int)(parser->m_bufferPtr - parser->m_buffer) - keep;

        memmove(parser->m_buffer, &parser->m_buffer[offset], parser->m_bufferEnd - parser->m_bufferPtr + keep);
        parser->m_bufferEnd -= offset;
        parser->m_bufferPtr -= offset;
      }
#else

      memmove(parser->m_buffer, parser->m_bufferPtr, parser->m_bufferEnd - parser->m_bufferPtr);

      parser->m_bufferEnd = parser->m_buffer + (parser->m_bufferEnd - parser->m_bufferPtr);

      parser->m_bufferPtr = parser->m_buffer;

#endif  /* not defined XML_CONTEXT_BYTES */
    }
    else {
      char *newBuf;
      int bufferSize = (int)(parser->m_bufferLim - parser->m_bufferPtr);
      if (bufferSize == 0)
        bufferSize = INIT_BUFFER_SIZE;
      do {
        /* Do not invoke signed arithmetic overflow: */
        bufferSize = (int) (2U * (unsigned) bufferSize);
      } while (bufferSize < neededSize && bufferSize > 0);
      if (bufferSize <= 0) {
        parser->m_errorCode = XML_ERROR_NO_MEMORY;
        return NULL;
      }
      newBuf = (char *)MALLOC(parser, bufferSize);
      if (newBuf == 0) {
        parser->m_errorCode = XML_ERROR_NO_MEMORY;
        return NULL;
      }
      parser->m_bufferLim = newBuf + bufferSize;
#ifdef XML_CONTEXT_BYTES
      if (parser->m_bufferPtr) {
        int keep = (int)(parser->m_bufferPtr - parser->m_buffer);
        if (keep > XML_CONTEXT_BYTES)
          keep = XML_CONTEXT_BYTES;
        memcpy(newBuf, &parser->m_bufferPtr[-keep], parser->m_bufferEnd - parser->m_bufferPtr + keep);

        FREE(parser, parser->m_buffer);
        parser->m_buffer = newBuf;
        parser->m_bufferEnd = parser->m_buffer + (parser->m_bufferEnd - parser->m_bufferPtr) + keep;

        parser->m_bufferPtr = parser->m_buffer + keep;
      }
      else {

        parser->m_bufferEnd = newBuf + (parser->m_bufferEnd - parser->m_bufferPtr);
        parser->m_bufferPtr = parser->m_buffer = newBuf;
      }
#else
      if (parser->m_bufferPtr) {
        memcpy(newBuf, parser->m_bufferPtr, parser->m_bufferEnd - parser->m_bufferPtr);

        FREE(parser, parser->m_buffer);


      }


      parser->m_bufferEnd = newBuf + (parser->m_bufferEnd - parser->m_bufferPtr);

      parser->m_bufferPtr = parser->m_buffer = newBuf;
#endif  /* not defined XML_CONTEXT_BYTES */
    }
    parser->m_eventPtr = parser->m_eventEndPtr = NULL;
    parser->m_positionPtr = NULL;
  }
  return parser->m_bufferEnd;







|




|
>
>





|




|

|
|
>





>
|
>
|
>
|
>




|


















|


|
>


|
>



>
|




|
>

>
>

>
>
|
>







2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
    return NULL;
  case XML_FINISHED:
    parser->m_errorCode = XML_ERROR_FINISHED;
    return NULL;
  default: ;
  }

  if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)) {
#ifdef XML_CONTEXT_BYTES
    int keep;
#endif  /* defined XML_CONTEXT_BYTES */
    /* Do not invoke signed arithmetic overflow: */
    int neededSize = (int) ((unsigned)len +
                            (unsigned)EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd,
                                                          parser->m_bufferPtr));
    if (neededSize < 0) {
      parser->m_errorCode = XML_ERROR_NO_MEMORY;
      return NULL;
    }
#ifdef XML_CONTEXT_BYTES
    keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
    if (keep > XML_CONTEXT_BYTES)
      keep = XML_CONTEXT_BYTES;
    neededSize += keep;
#endif  /* defined XML_CONTEXT_BYTES */
    if (neededSize <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
#ifdef XML_CONTEXT_BYTES
      if (keep < EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)) {
          int offset = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer) - keep;
        /* The buffer pointers cannot be NULL here; we have at least some bytes in the buffer */
        memmove(parser->m_buffer, &parser->m_buffer[offset], parser->m_bufferEnd - parser->m_bufferPtr + keep);
        parser->m_bufferEnd -= offset;
        parser->m_bufferPtr -= offset;
      }
#else
      if (parser->m_buffer && parser->m_bufferPtr) {
        memmove(parser->m_buffer, parser->m_bufferPtr,
                EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
        parser->m_bufferEnd = parser->m_buffer +
            EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
        parser->m_bufferPtr = parser->m_buffer;
      }
#endif  /* not defined XML_CONTEXT_BYTES */
    }
    else {
      char *newBuf;
      int bufferSize = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferPtr);
      if (bufferSize == 0)
        bufferSize = INIT_BUFFER_SIZE;
      do {
        /* Do not invoke signed arithmetic overflow: */
        bufferSize = (int) (2U * (unsigned) bufferSize);
      } while (bufferSize < neededSize && bufferSize > 0);
      if (bufferSize <= 0) {
        parser->m_errorCode = XML_ERROR_NO_MEMORY;
        return NULL;
      }
      newBuf = (char *)MALLOC(parser, bufferSize);
      if (newBuf == 0) {
        parser->m_errorCode = XML_ERROR_NO_MEMORY;
        return NULL;
      }
      parser->m_bufferLim = newBuf + bufferSize;
#ifdef XML_CONTEXT_BYTES
      if (parser->m_bufferPtr) {
        int keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
        if (keep > XML_CONTEXT_BYTES)
          keep = XML_CONTEXT_BYTES;
        memcpy(newBuf, &parser->m_bufferPtr[-keep],
               EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep);
        FREE(parser, parser->m_buffer);
        parser->m_buffer = newBuf;
        parser->m_bufferEnd = parser->m_buffer +
            EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep;
        parser->m_bufferPtr = parser->m_buffer + keep;
      }
      else {
        /* This must be a brand new buffer with no data in it yet */
        parser->m_bufferEnd = newBuf;
        parser->m_bufferPtr = parser->m_buffer = newBuf;
      }
#else
      if (parser->m_bufferPtr) {
        memcpy(newBuf, parser->m_bufferPtr,
               EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
        FREE(parser, parser->m_buffer);
        parser->m_bufferEnd = newBuf +
            EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
      }
      else {
        /* This must be a brand new buffer with no data in it yet */
        parser->m_bufferEnd = newBuf;
      }
      parser->m_bufferPtr = parser->m_buffer = newBuf;
#endif  /* not defined XML_CONTEXT_BYTES */
    }
    parser->m_eventPtr = parser->m_eventEndPtr = NULL;
    parser->m_positionPtr = NULL;
  }
  return parser->m_bufferEnd;
2904
2905
2906
2907
2908
2909
2910
2911
2912


2913
2914
2915
2916
2917
2918
2919
2920
          noElmHandlers = XML_FALSE;
        }
        if (noElmHandlers && parser->m_defaultHandler)
          reportDefault(parser, enc, s, next);
        poolClear(&parser->m_tempPool);
        freeBindings(parser, bindings);
      }
      if ((parser->m_tagLevel == 0) &&
          !((parser->m_parsingStatus.parsing == XML_FINISHED) || (parser->m_parsingStatus.parsing == XML_SUSPENDED))) {


        return epilogProcessor(parser, next, end, nextPtr);
      }
      break;
    case XML_TOK_END_TAG:
      if (parser->m_tagLevel == startTagLevel)
        return XML_ERROR_ASYNC_ENTITY;
      else {
        int len;







|
|
>
>
|







2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
          noElmHandlers = XML_FALSE;
        }
        if (noElmHandlers && parser->m_defaultHandler)
          reportDefault(parser, enc, s, next);
        poolClear(&parser->m_tempPool);
        freeBindings(parser, bindings);
      }
      if ((parser->m_tagLevel == 0) && (parser->m_parsingStatus.parsing != XML_FINISHED)) {
        if (parser->m_parsingStatus.parsing == XML_SUSPENDED)
          parser->m_processor = epilogProcessor;
        else
          return epilogProcessor(parser, next, end, nextPtr);
      }
      break;
    case XML_TOK_END_TAG:
      if (parser->m_tagLevel == startTagLevel)
        return XML_ERROR_ASYNC_ENTITY;
      else {
        int len;
4742
4743
4744
4745
4746
4747
4748
4749
4750

4751
4752
4753
4754
4755
4756
4757
                                      &dtd->paramEntities,
                                      externalSubsetName,
                                      sizeof(ENTITY));
        if (!parser->m_declEntity)
          return XML_ERROR_NO_MEMORY;
        parser->m_declEntity->publicId = NULL;
      }
      /* fall through */
#endif /* XML_DTD */

    case XML_ROLE_ENTITY_SYSTEM_ID:
      if (dtd->keepProcessing && parser->m_declEntity) {
        parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc,
                                               s + enc->minBytesPerChar,
                                               next - enc->minBytesPerChar);
        if (!parser->m_declEntity->systemId)
          return XML_ERROR_NO_MEMORY;







<

>







4765
4766
4767
4768
4769
4770
4771

4772
4773
4774
4775
4776
4777
4778
4779
4780
                                      &dtd->paramEntities,
                                      externalSubsetName,
                                      sizeof(ENTITY));
        if (!parser->m_declEntity)
          return XML_ERROR_NO_MEMORY;
        parser->m_declEntity->publicId = NULL;
      }

#endif /* XML_DTD */
      /* fall through */
    case XML_ROLE_ENTITY_SYSTEM_ID:
      if (dtd->keepProcessing && parser->m_declEntity) {
        parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc,
                                               s + enc->minBytesPerChar,
                                               next - enc->minBytesPerChar);
        if (!parser->m_declEntity->systemId)
          return XML_ERROR_NO_MEMORY;
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
}

static unsigned long FASTCALL
hash(XML_Parser parser, KEY s)
{
  struct siphash state;
  struct sipkey key;
  (void)sip_tobin;
  (void)sip24_valid;
  copy_salt_to_sipkey(parser, &key);
  sip24_init(&state, &key);
  sip24_update(&state, s, keylen(s) * sizeof(XML_Char));
  return (unsigned long)sip24_final(&state);
}








<







6662
6663
6664
6665
6666
6667
6668

6669
6670
6671
6672
6673
6674
6675
}

static unsigned long FASTCALL
hash(XML_Parser parser, KEY s)
{
  struct siphash state;
  struct sipkey key;

  (void)sip24_valid;
  copy_salt_to_sipkey(parser, &key);
  sip24_init(&state, &key);
  sip24_update(&state, s, keylen(s) * sizeof(XML_Char));
  return (unsigned long)sip24_final(&state);
}

Changes to expat/xmltok_impl.c.
70
71
72
73
74
75
76

77
78
79
80
81
82
83

#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \
  case BT_NONASCII: \
    if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \
      *nextTokPtr = ptr; \
      return XML_TOK_INVALID; \
    } \

  case BT_NMSTRT: \
  case BT_HEX: \
  case BT_DIGIT: \
  case BT_NAME: \
  case BT_MINUS: \
    ptr += MINBPC(enc); \
    break; \







>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \
  case BT_NONASCII: \
    if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \
      *nextTokPtr = ptr; \
      return XML_TOK_INVALID; \
    } \
    /* fall through */ \
  case BT_NMSTRT: \
  case BT_HEX: \
  case BT_DIGIT: \
  case BT_NAME: \
  case BT_MINUS: \
    ptr += MINBPC(enc); \
    break; \
98
99
100
101
102
103
104

105
106
107
108
109
110
111

#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \
  case BT_NONASCII: \
    if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \
      *nextTokPtr = ptr; \
      return XML_TOK_INVALID; \
    } \

  case BT_NMSTRT: \
  case BT_HEX: \
    ptr += MINBPC(enc); \
    break; \
  CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \
  CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \
  CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr)







>







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \
  case BT_NONASCII: \
    if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \
      *nextTokPtr = ptr; \
      return XML_TOK_INVALID; \
    } \
    /* fall through */ \
  case BT_NMSTRT: \
  case BT_HEX: \
    ptr += MINBPC(enc); \
    break; \
  CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \
  CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \
  CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr)
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
        case BT_CR:
          break;
        default:
          *nextTokPtr = ptr;
          return XML_TOK_INVALID;
        }
      }
    /* fall through */
    case BT_EQUALS:
      {
        int open;
#ifdef XML_NS
        hadColon = 0;
#endif
        for (;;) {







|







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
        case BT_CR:
          break;
        default:
          *nextTokPtr = ptr;
          return XML_TOK_INVALID;
        }
      }
      /* fall through */
    case BT_EQUALS:
      {
        int open;
#ifdef XML_NS
        hadColon = 0;
#endif
        for (;;) {
1438
1439
1440
1441
1442
1443
1444

1445
1446
1447
1448
1449
1450
1451
        return 0;
      }
      break;
    case BT_NAME:
    case BT_NMSTRT:
      if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
        break;

    default:
      switch (BYTE_TO_ASCII(enc, ptr)) {
      case 0x24: /* $ */
      case 0x40: /* @ */
        break;
      default:
        *badPtr = ptr;







>







1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
        return 0;
      }
      break;
    case BT_NAME:
    case BT_NMSTRT:
      if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
        break;
      /* fall through */
    default:
      switch (BYTE_TO_ASCII(enc, ptr)) {
      case 0x24: /* $ */
      case 0x40: /* @ */
        break;
      default:
        *badPtr = ptr;
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670

static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
                         const char *end1, const char *ptr2)
{
  for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
    if (end1 - ptr1 < MINBPC(enc)) {
      /* This line cannot be executed.  THe incoming data has already
       * been tokenized once, so imcomplete characters like this have
       * already been eliminated from the input.  Retaining the
       * paranoia check is still valuable, however.
       */
      return 0; /* LCOV_EXCL_LINE */
    }
    if (!CHAR_MATCHES(enc, ptr1, *ptr2))
      return 0;







|
|







1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673

static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
                         const char *end1, const char *ptr2)
{
  for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
    if (end1 - ptr1 < MINBPC(enc)) {
      /* This line cannot be executed.  The incoming data has already
       * been tokenized once, so incomplete characters like this have
       * already been eliminated from the input.  Retaining the
       * paranoia check is still valuable, however.
       */
      return 0; /* LCOV_EXCL_LINE */
    }
    if (!CHAR_MATCHES(enc, ptr1, *ptr2))
      return 0;
Changes to extensions/tdomhtml/tdomhtml.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#----------------------------------------------------------------------------
#   Copyright (c) 1999,2000 Jochen Loewer ([email protected]) et al.   
#----------------------------------------------------------------------------
#
#   Rcsid: @(#)$Id$
#
#   Implements simple HTML layer on top of core DOM Level-1 specification,
#   as implemented in tDOM package.
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 1.1 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#----------------------------------------------------------------------------
#   Copyright (c) 1999,2000 Jochen Loewer ([email protected]) et al.   
#----------------------------------------------------------------------------
#
#   Rcsid: @(#)$Id$
#
#   Implements simple HTML layer on top of core DOM Level-1 specification,
#   as implemented in tDOM package.
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 2.0 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

#
# This package requires the loaded tdom
# so bark early if we can't find it.
#

package require tdom

#
# Caller (usually our pkgIndex.tcl loader) will supply the package
# version by defining the _V_ variable before sourcing this file.
# For all other cases, we just provide the no-version package.
#

if {[info exists _V_] == 0} {
    package provide tdomhtml
} else {
    package provide tdomhtml $_V_
}

#
# Declare HTML generating commands
#

namespace eval ::dom::domHTML {
    







<
<
<
<
<
<
<
<
<
<
|
<







47
48
49
50
51
52
53










54

55
56
57
58
59
60
61

#
# This package requires the loaded tdom
# so bark early if we can't find it.
#

package require tdom










package provide tdomhtml 0.1.0


#
# Declare HTML generating commands
#

namespace eval ::dom::domHTML {
    
Changes to extensions/tnc/tests/loadtnc.tcl.
1
2
3
4
5
6
7
8
9
10
catch {load ../../../unix/libtdom0.9.1.so}
catch {load ../libtnc0.3.0.so}
catch {load ../../unix/libtdom0.9.1.so}
catch {load libtnc0.3.0.so}
# loadtnc.tcl --
#
# This file is [source]d by all.tcl and all test files, to ensure, that
# the tcltest package and the lastest tnc build is present.

if {[lsearch [namespace children] ::tcltest] == -1} {
|

|







1
2
3
4
5
6
7
8
9
10
catch {load ../../../unix/libtdom0.9.2.so}
catch {load ../libtnc0.3.0.so}
catch {load ../../unix/libtdom0.9.2.so}
catch {load libtnc0.3.0.so}
# loadtnc.tcl --
#
# This file is [source]d by all.tcl and all test files, to ensure, that
# the tcltest package and the lastest tnc build is present.

if {[lsearch [namespace children] ::tcltest] == -1} {
Changes to generic/dom.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*---------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM interface upon the expat XML parser for the C language
|   according to the W3C recommendation REC-DOM-Level-1-19981001
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*---------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM interface upon the expat XML parser for the C language
|   according to the W3C recommendation REC-DOM-Level-1-19981001
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
        node = (domNode*) domAlloc(sizeof(domNode)
                                    + sizeof(domLineColumn));
    } else {
        node = (domNode*) domAlloc(sizeof(domNode));
    }
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;
    node->nodeFlags     = 0;
    node->namespace     = 0;
    node->nodeName      = (char *)&(h->key);
    node->nodeNumber    = NODE_NO(info->document);
    node->ownerDocument = info->document;

    if (info->baseURIstack[info->baseURIstackPos].baseURI 
        != XML_GetBase (info->parser)) {
        h = Tcl_CreateHashEntry (info->document->baseURIs,







<
<







2401
2402
2403
2404
2405
2406
2407


2408
2409
2410
2411
2412
2413
2414
        node = (domNode*) domAlloc(sizeof(domNode)
                                    + sizeof(domLineColumn));
    } else {
        node = (domNode*) domAlloc(sizeof(domNode));
    }
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;


    node->nodeName      = (char *)&(h->key);
    node->nodeNumber    = NODE_NO(info->document);
    node->ownerDocument = info->document;

    if (info->baseURIstack[info->baseURIstackPos].baseURI 
        != XML_GetBase (info->parser)) {
        h = Tcl_CreateHashEntry (info->document->baseURIs,
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
        h = Tcl_CreateHashEntry(&HASHTAB(info->document, tdom_attrNames),
                                atPtr[0], &hnew);
        attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
        memset(attrnode, 0, sizeof(domAttrNode));
        attrnode->nodeType = ATTRIBUTE_NODE;
        if (atPtr == idAttPtr) {
            attrnode->nodeFlags |= IS_ID_ATTRIBUTE;
        } else {
            attrnode->nodeFlags = 0;
        }
        attrnode->namespace   = 0;
        attrnode->nodeName    = (char *)&(h->key);
        attrnode->parentNode  = node;
        len = strlen(atPtr[1]);
        attrnode->valueLength = len;
        attrnode->nodeValue   = (char*)MALLOC(len+1);
        strcpy(attrnode->nodeValue, (char *)atPtr[1]);








<
<

<







2603
2604
2605
2606
2607
2608
2609


2610

2611
2612
2613
2614
2615
2616
2617
        h = Tcl_CreateHashEntry(&HASHTAB(info->document, tdom_attrNames),
                                atPtr[0], &hnew);
        attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
        memset(attrnode, 0, sizeof(domAttrNode));
        attrnode->nodeType = ATTRIBUTE_NODE;
        if (atPtr == idAttPtr) {
            attrnode->nodeFlags |= IS_ID_ATTRIBUTE;


        }

        attrnode->nodeName    = (char *)&(h->key);
        attrnode->parentNode  = node;
        len = strlen(atPtr[1]);
        attrnode->valueLength = len;
        attrnode->nodeValue   = (char*)MALLOC(len+1);
        strcpy(attrnode->nodeValue, (char *)atPtr[1]);

2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
            node = (domTextNode*) domAlloc(sizeof(domTextNode));
        }
        memset(node, 0, sizeof(domTextNode));
        if (info->cdataSection)
            node->nodeType    = CDATA_SECTION_NODE;
        else 
            node->nodeType    = TEXT_NODE;
        node->nodeFlags   = 0;
        node->nodeNumber  = NODE_NO(info->document);
        node->valueLength = len;
        node->nodeValue   = (char*)MALLOC(len);
        memmove(node->nodeValue, s, len);

        node->ownerDocument = info->document;
        node->parentNode = parentNode;







<







2895
2896
2897
2898
2899
2900
2901

2902
2903
2904
2905
2906
2907
2908
            node = (domTextNode*) domAlloc(sizeof(domTextNode));
        }
        memset(node, 0, sizeof(domTextNode));
        if (info->cdataSection)
            node->nodeType    = CDATA_SECTION_NODE;
        else 
            node->nodeType    = TEXT_NODE;

        node->nodeNumber  = NODE_NO(info->document);
        node->valueLength = len;
        node->nodeValue   = (char*)MALLOC(len);
        memmove(node->nodeValue, s, len);

        node->ownerDocument = info->document;
        node->parentNode = parentNode;
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
        node = (domTextNode*) domAlloc(sizeof(domTextNode)
                                        + sizeof(domLineColumn));
    } else {
        node = (domTextNode*) domAlloc(sizeof(domTextNode));
    }
    memset(node, 0, sizeof(domTextNode));
    node->nodeType    = COMMENT_NODE;
    node->nodeFlags   = 0;
    node->nodeNumber  = NODE_NO(info->document);
    node->valueLength = len;
    node->nodeValue   = (char*)MALLOC(len);
    memmove(node->nodeValue, s, len);

    node->ownerDocument = info->document;
    node->parentNode = parentNode;







<







2967
2968
2969
2970
2971
2972
2973

2974
2975
2976
2977
2978
2979
2980
        node = (domTextNode*) domAlloc(sizeof(domTextNode)
                                        + sizeof(domLineColumn));
    } else {
        node = (domTextNode*) domAlloc(sizeof(domTextNode));
    }
    memset(node, 0, sizeof(domTextNode));
    node->nodeType    = COMMENT_NODE;

    node->nodeNumber  = NODE_NO(info->document);
    node->valueLength = len;
    node->nodeValue   = (char*)MALLOC(len);
    memmove(node->nodeValue, s, len);

    node->ownerDocument = info->document;
    node->parentNode = parentNode;
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
                         + sizeof(domLineColumn));
    } else {
        node = (domProcessingInstructionNode*)
               domAlloc(sizeof(domProcessingInstructionNode));
    }
    memset(node, 0, sizeof(domProcessingInstructionNode));
    node->nodeType    = PROCESSING_INSTRUCTION_NODE;
    node->nodeFlags   = 0;
    node->namespace   = 0;
    node->nodeNumber  = NODE_NO(info->document);

    if (info->baseURIstack[info->baseURIstackPos].baseURI 
        != XML_GetBase (info->parser)) {
        h = Tcl_CreateHashEntry (info->document->baseURIs,
                                 (char*) node,
                                 &hnew);







<
<







3048
3049
3050
3051
3052
3053
3054


3055
3056
3057
3058
3059
3060
3061
                         + sizeof(domLineColumn));
    } else {
        node = (domProcessingInstructionNode*)
               domAlloc(sizeof(domProcessingInstructionNode));
    }
    memset(node, 0, sizeof(domProcessingInstructionNode));
    node->nodeType    = PROCESSING_INSTRUCTION_NODE;


    node->nodeNumber  = NODE_NO(info->document);

    if (info->baseURIstack[info->baseURIstackPos].baseURI 
        != XML_GetBase (info->parser)) {
        h = Tcl_CreateHashEntry (info->document->baseURIs,
                                 (char*) node,
                                 &hnew);
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
    }
    memset(rootNode, 0, sizeof(domNode));
    rootNode->nodeType      = ELEMENT_NODE;
    if (baseURI) {
        h = Tcl_CreateHashEntry (doc->baseURIs, (char*)rootNode, &hnew);
        Tcl_SetHashValue (h, tdomstrdup (baseURI));
        rootNode->nodeFlags |= HAS_BASEURI;
    } else {
        rootNode->nodeFlags = 0;
    }
    rootNode->namespace     = 0;
    h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), "", &hnew);
    rootNode->nodeName      = (char *)&(h->key);
    rootNode->nodeNumber    = NODE_NO(doc);
    rootNode->ownerDocument = doc;
    rootNode->parentNode    = NULL;







<
<







4388
4389
4390
4391
4392
4393
4394


4395
4396
4397
4398
4399
4400
4401
    }
    memset(rootNode, 0, sizeof(domNode));
    rootNode->nodeType      = ELEMENT_NODE;
    if (baseURI) {
        h = Tcl_CreateHashEntry (doc->baseURIs, (char*)rootNode, &hnew);
        Tcl_SetHashValue (h, tdomstrdup (baseURI));
        rootNode->nodeFlags |= HAS_BASEURI;


    }
    rootNode->namespace     = 0;
    h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), "", &hnew);
    rootNode->nodeName      = (char *)&(h->key);
    rootNode->nodeNumber    = NODE_NO(doc);
    rootNode->ownerDocument = doc;
    rootNode->parentNode    = NULL;
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
    doc = domCreateDoc (NULL, 0);

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames),
                            documentElementTagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType        = ELEMENT_NODE;
    node->nodeFlags       = 0;
    node->nodeNumber      = NODE_NO(doc);
    node->ownerDocument   = doc;
    node->nodeName        = (char *)&(h->key);
    doc->documentElement  = node;
    if (uri) {
        ns = domNewNamespace (doc, prefix, uri);
        node->namespace   = ns->index;







<







4439
4440
4441
4442
4443
4444
4445

4446
4447
4448
4449
4450
4451
4452
    doc = domCreateDoc (NULL, 0);

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames),
                            documentElementTagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType        = ELEMENT_NODE;

    node->nodeNumber      = NODE_NO(doc);
    node->ownerDocument   = doc;
    node->nodeName        = (char *)&(h->key);
    doc->documentElement  = node;
    if (uri) {
        ns = domNewNamespace (doc, prefix, uri);
        node->namespace   = ns->index;
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
)
{
    domTextNode   *node;

    node = (domTextNode*) domAlloc(sizeof(domTextNode));
    memset(node, 0, sizeof(domTextNode));
    node->nodeType      = nodeType;
    node->nodeFlags     = 0;
    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->valueLength   = length;
    node->nodeValue     = (char*)MALLOC(length);
    memmove(node->nodeValue, value, length);

    if (doc->fragments) {







<







5876
5877
5878
5879
5880
5881
5882

5883
5884
5885
5886
5887
5888
5889
)
{
    domTextNode   *node;

    node = (domTextNode*) domAlloc(sizeof(domTextNode));
    memset(node, 0, sizeof(domTextNode));
    node->nodeType      = nodeType;

    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->valueLength   = length;
    node->nodeValue     = (char*)MALLOC(length);
    memmove(node->nodeValue, value, length);

    if (doc->fragments) {
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
        pc++;
    }
    if (start) {
        Tcl_DStringAppend (escapedData, &value[start], length - start);
    }
}


/*---------------------------------------------------------------------------
|   domAppendNewTextNode
|
\--------------------------------------------------------------------------*/
domTextNode *
domAppendNewTextNode(
    domNode     *parent,
    char        *value,
    int          length,
    domNodeType  nodeType,
    int          disableOutputEscaping
)
{
    domTextNode   *node;

    if (!length) {
        return NULL;
    }

    if (parent->lastChild
         && parent->lastChild->nodeType == TEXT_NODE
         && nodeType == TEXT_NODE
    ) {
        /*------------------------------------------------------------------
        |    append to already existing text node
        \-----------------------------------------------------------------*/
        domAppendData ((domTextNode *) (parent->lastChild), value, length,
                       disableOutputEscaping);
        MutationEvent();
        return (domTextNode*)parent->lastChild;
    }
    node = (domTextNode*) domAlloc(sizeof(domTextNode));
    memset(node, 0, sizeof(domTextNode));
    node->nodeType      = nodeType;
    node->nodeFlags     = 0;
    if (disableOutputEscaping) {
        node->nodeFlags |= DISABLE_OUTPUT_ESCAPING;
    }
    node->nodeNumber    = NODE_NO(parent->ownerDocument);
    node->ownerDocument = parent->ownerDocument;
    node->valueLength   = length;
    node->nodeValue     = (char*)MALLOC(length);







<















|


















<







5930
5931
5932
5933
5934
5935
5936

5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970

5971
5972
5973
5974
5975
5976
5977
        pc++;
    }
    if (start) {
        Tcl_DStringAppend (escapedData, &value[start], length - start);
    }
}


/*---------------------------------------------------------------------------
|   domAppendNewTextNode
|
\--------------------------------------------------------------------------*/
domTextNode *
domAppendNewTextNode(
    domNode     *parent,
    char        *value,
    int          length,
    domNodeType  nodeType,
    int          disableOutputEscaping
)
{
    domTextNode   *node;

    if (!length && (nodeType == TEXT_NODE)) {
        return NULL;
    }

    if (parent->lastChild
         && parent->lastChild->nodeType == TEXT_NODE
         && nodeType == TEXT_NODE
    ) {
        /*------------------------------------------------------------------
        |    append to already existing text node
        \-----------------------------------------------------------------*/
        domAppendData ((domTextNode *) (parent->lastChild), value, length,
                       disableOutputEscaping);
        MutationEvent();
        return (domTextNode*)parent->lastChild;
    }
    node = (domTextNode*) domAlloc(sizeof(domTextNode));
    memset(node, 0, sizeof(domTextNode));
    node->nodeType      = nodeType;

    if (disableOutputEscaping) {
        node->nodeFlags |= DISABLE_OUTPUT_ESCAPING;
    }
    node->nodeNumber    = NODE_NO(parent->ownerDocument);
    node->ownerDocument = parent->ownerDocument;
    node->valueLength   = length;
    node->nodeValue     = (char*)MALLOC(length);
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
)
{
    domProcessingInstructionNode   *node;

    node = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode));
    memset(node, 0, sizeof(domProcessingInstructionNode));
    node->nodeType      = PROCESSING_INSTRUCTION_NODE;
    node->nodeFlags     = 0;
    node->namespace     = 0;
    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->targetLength  = targetLength;
    node->targetValue   = (char*)MALLOC(targetLength);
    memmove(node->targetValue, targetValue, targetLength);

    node->dataLength    = dataLength;







<
<







6392
6393
6394
6395
6396
6397
6398


6399
6400
6401
6402
6403
6404
6405
)
{
    domProcessingInstructionNode   *node;

    node = (domProcessingInstructionNode*) domAlloc(sizeof(domProcessingInstructionNode));
    memset(node, 0, sizeof(domProcessingInstructionNode));
    node->nodeType      = PROCESSING_INSTRUCTION_NODE;


    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->targetLength  = targetLength;
    node->targetValue   = (char*)MALLOC(targetLength);
    memmove(node->targetValue, targetValue, targetLength);

    node->dataLength    = dataLength;
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
    Tcl_HashEntry *h;
    int           hnew;

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;
    node->nodeFlags     = 0;
    node->namespace     = 0;
    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->nodeName      = (char *)&(h->key);

    if (doc->fragments) {
        node->nextSibling = doc->fragments;
        doc->fragments->previousSibling = node;







<
<







6433
6434
6435
6436
6437
6438
6439


6440
6441
6442
6443
6444
6445
6446
    Tcl_HashEntry *h;
    int           hnew;

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;


    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->nodeName      = (char *)&(h->key);

    if (doc->fragments) {
        node->nextSibling = doc->fragments;
        doc->fragments->previousSibling = node;
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
        return NULL;
    }

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;
    node->nodeFlags     = 0;
    node->namespace     = 0;
    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->nodeName      = (char *)&(h->key);

    ns = domNewNamespace(doc, prefix, uri);
    node->namespace = ns->index;








<
<







6476
6477
6478
6479
6480
6481
6482


6483
6484
6485
6486
6487
6488
6489
        return NULL;
    }

    h = Tcl_CreateHashEntry(&HASHTAB(doc, tdom_tagNames), tagName, &hnew);
    node = (domNode*) domAlloc(sizeof(domNode));
    memset(node, 0, sizeof(domNode));
    node->nodeType      = ELEMENT_NODE;


    node->nodeNumber    = NODE_NO(doc);
    node->ownerDocument = doc;
    node->nodeName      = (char *)&(h->key);

    ns = domNewNamespace(doc, prefix, uri);
    node->namespace = ns->index;

Changes to generic/dom.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*---------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM interface upon the expat XML parser for the C language
|   according to the W3C recommendation REC-DOM-Level-1-19981001
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*---------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM interface upon the expat XML parser for the C language
|   according to the W3C recommendation REC-DOM-Level-1-19981001
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domalloc.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*---------------------------------------------------------------------------
|   Copyright (C) 1999-2000  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A special memory allocator, which uses pre-allocated / bit masked
|   based administration of memory blocks with fixed sizes, like
|   DOM nodes. This will hopefully save some memory.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*---------------------------------------------------------------------------
|   Copyright (C) 1999-2000  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A special memory allocator, which uses pre-allocated / bit masked
|   based administration of memory blocks with fixed sizes, like
|   DOM nodes. This will hopefully save some memory.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domalloc.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*---------------------------------------------------------------------------
|   Copyright (C) 1999-2000  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A special memory allocator, which uses pre-allocated / bit masked
|   based administration of memory block with fixed sizes, like
|   DOM nodes. This will hopefully save some memory.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*---------------------------------------------------------------------------
|   Copyright (C) 1999-2000  Jochen C. Loewer ([email protected])
+----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A special memory allocator, which uses pre-allocated / bit masked
|   based administration of memory block with fixed sizes, like
|   DOM nodes. This will hopefully save some memory.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domhtml.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000  Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|
| !! EXPERIMENTAL / pre alpha !!
|   A simple (hopefully fast) HTML parser to build up a DOM structure
|   in memory.
|   Based on xmlsimple.c.
| !! EXPERIMENTAL / pre alpha !!
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000  Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|
| !! EXPERIMENTAL / pre alpha !!
|   A simple (hopefully fast) HTML parser to build up a DOM structure
|   in memory.
|   Based on xmlsimple.c.
| !! EXPERIMENTAL / pre alpha !!
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
                    z[to++] = (char) ((value | 0x80) & 0xBF);
                } else {
                    /* error */
                }
		    from = i+1;
		}
            } else {
                while (z[i] && isalpha((unsigned char)z[i])) {
                   i++;
                }
                c = z[i];
                z[i] = 0;
                h = ErHash(&z[from+1]);
                p = apErHash[h];
                while (p && strcmp(p->zName,&z[from+1])!=0 ) {







|







551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
                    z[to++] = (char) ((value | 0x80) & 0xBF);
                } else {
                    /* error */
                }
		    from = i+1;
		}
            } else {
                while (z[i] && isalnum((unsigned char)z[i])) {
                   i++;
                }
                c = z[i];
                z[i] = 0;
                h = ErHash(&z[from+1]);
                p = apErHash[h];
                while (p && strcmp(p->zName,&z[from+1])!=0 ) {
654
655
656
657
658
659
660

661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
            only_whites = 1;
            if (c=='<') x++;
            while ( (c=*x)!=0 && c!='<' ) {
                if (c=='&') ampersandSeen = 1;
                if ( !SPACE(c) ) only_whites = 0;
                x++;
            }

            if (!(only_whites && ignoreWhiteSpaces) && parent_node) {
                /*--------------------------------------------------------
                |   allocate new TEXT node
                \-------------------------------------------------------*/
                tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                memset(tnode, 0, sizeof(domTextNode));
                tnode->nodeType    = TEXT_NODE;
                tnode->nodeFlags   = 0;
                tnode->ownerDocument = doc;
                tnode->nodeNumber  = NODE_NO(doc);
                tnode->valueLength = (x - start);
                tnode->nodeValue   = (char*)MALLOC((x - start)+1);
                memmove(tnode->nodeValue, start, (x - start));
                *(tnode->nodeValue + (x - start)) = 0;
                DBG(fprintf(stderr, "New text node: '%s'\n", tnode->nodeValue);)







>







<







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668

669
670
671
672
673
674
675
            only_whites = 1;
            if (c=='<') x++;
            while ( (c=*x)!=0 && c!='<' ) {
                if (c=='&') ampersandSeen = 1;
                if ( !SPACE(c) ) only_whites = 0;
                x++;
            }
                
            if (!(only_whites && ignoreWhiteSpaces) && parent_node) {
                /*--------------------------------------------------------
                |   allocate new TEXT node
                \-------------------------------------------------------*/
                tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                memset(tnode, 0, sizeof(domTextNode));
                tnode->nodeType    = TEXT_NODE;

                tnode->ownerDocument = doc;
                tnode->nodeNumber  = NODE_NO(doc);
                tnode->valueLength = (x - start);
                tnode->nodeValue   = (char*)MALLOC((x - start)+1);
                memmove(tnode->nodeValue, start, (x - start));
                *(tnode->nodeValue + (x - start)) = 0;
                DBG(fprintf(stderr, "New text node: '%s'\n", tnode->nodeValue);)
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
                    if (*x) {
                        /*----------------------------------------------------
                        |   allocate new COMMENT node for comments
                        \---------------------------------------------------*/
                        tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                        memset(tnode, 0, sizeof(domTextNode));
                        tnode->nodeType      = COMMENT_NODE;
                        tnode->nodeFlags     = 0;
                        tnode->ownerDocument = doc;
                        tnode->nodeNumber    = NODE_NO(doc);
                        tnode->parentNode    = parent_node;
                        tnode->valueLength   = x - start - 4;
                        tnode->nodeValue     = (char*)MALLOC(tnode->valueLength+1);
                        memmove(tnode->nodeValue, start+4, tnode->valueLength);
                        *(tnode->nodeValue + tnode->valueLength) = 0;







<







868
869
870
871
872
873
874

875
876
877
878
879
880
881
                    if (*x) {
                        /*----------------------------------------------------
                        |   allocate new COMMENT node for comments
                        \---------------------------------------------------*/
                        tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                        memset(tnode, 0, sizeof(domTextNode));
                        tnode->nodeType      = COMMENT_NODE;

                        tnode->ownerDocument = doc;
                        tnode->nodeNumber    = NODE_NO(doc);
                        tnode->parentNode    = parent_node;
                        tnode->valueLength   = x - start - 4;
                        tnode->nodeValue     = (char*)MALLOC(tnode->valueLength+1);
                        memmove(tnode->nodeValue, start+4, tnode->valueLength);
                        *(tnode->nodeValue + tnode->valueLength) = 0;
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
                        if (parent_node) {
                            /*----------------------------------------------------
                            |   allocate new TEXT node for CDATA section data
                            \---------------------------------------------------*/
                            tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                            memset(tnode, 0, sizeof(domTextNode));
                            tnode->nodeType      = TEXT_NODE;
                            tnode->nodeFlags     = 0;
                            tnode->ownerDocument = doc;
                            tnode->nodeNumber    = NODE_NO(doc);
                            tnode->parentNode    = parent_node;
                            tnode->valueLength   = (x - start);
                            tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                            memmove(tnode->nodeValue, start, (x - start));
                            *(tnode->nodeValue + (x - start)) = 0;







<







946
947
948
949
950
951
952

953
954
955
956
957
958
959
                        if (parent_node) {
                            /*----------------------------------------------------
                            |   allocate new TEXT node for CDATA section data
                            \---------------------------------------------------*/
                            tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                            memset(tnode, 0, sizeof(domTextNode));
                            tnode->nodeType      = TEXT_NODE;

                            tnode->ownerDocument = doc;
                            tnode->nodeNumber    = NODE_NO(doc);
                            tnode->parentNode    = parent_node;
                            tnode->valueLength   = (x - start);
                            tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                            memmove(tnode->nodeValue, start, (x - start));
                            *(tnode->nodeValue + (x - start)) = 0;
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
                    /*------------------------------------------------------------
                    |   allocate new PI node for processing instruction section
                    \-----------------------------------------------------------*/
                    pinode = (domProcessingInstructionNode*)
                            MALLOC(sizeof(domProcessingInstructionNode));
                    memset(pinode, 0, sizeof(domProcessingInstructionNode));
                    pinode->nodeType      = PROCESSING_INSTRUCTION_NODE;
                    pinode->nodeFlags     = 0;
                    pinode->namespace     = 0;
                    pinode->ownerDocument = doc;
                    pinode->nodeNumber    = NODE_NO(doc);
                    pinode->parentNode    = parent_node;

                    /*-------------------------------------------------
                    |   extract PI target
                    \------------------------------------------------*/







<
<







988
989
990
991
992
993
994


995
996
997
998
999
1000
1001
                    /*------------------------------------------------------------
                    |   allocate new PI node for processing instruction section
                    \-----------------------------------------------------------*/
                    pinode = (domProcessingInstructionNode*)
                            MALLOC(sizeof(domProcessingInstructionNode));
                    memset(pinode, 0, sizeof(domProcessingInstructionNode));
                    pinode->nodeType      = PROCESSING_INSTRUCTION_NODE;


                    pinode->ownerDocument = doc;
                    pinode->nodeNumber    = NODE_NO(doc);
                    pinode->parentNode    = parent_node;

                    /*-------------------------------------------------
                    |   extract PI target
                    \------------------------------------------------*/
1094
1095
1096
1097
1098
1099
1100


1101











1102





1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
                node = parent_node;
                parent_node = node->parentNode;
            }

            /*-----------------------------------------------------------
            |   create new DOM element node
            \----------------------------------------------------------*/


            h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), e, &hnew);

















            node = (domNode*) domAlloc(sizeof(domNode));
            memset(node, 0, sizeof(domNode));
            node->nodeType      = ELEMENT_NODE;
            node->nodeFlags     = 0;
            node->namespace     = 0;
            node->nodeName      = (char *)&(h->key);
            node->ownerDocument = doc;
            node->nodeNumber    = NODE_NO(doc);

            if (parent_node == NULL) {
                if (doc->rootNode->lastChild) {
                    node->previousSibling = doc->rootNode->lastChild;







>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>



<
<







1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119


1120
1121
1122
1123
1124
1125
1126
                node = parent_node;
                parent_node = node->parentNode;
            }

            /*-----------------------------------------------------------
            |   create new DOM element node
            \----------------------------------------------------------*/
            if (!parent_node && (strcmp(e,"html")!=0)) {
                // Insert missing html tag
                h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), "html", &hnew);
                node = (domNode*) domAlloc(sizeof(domNode));
                memset(node, 0, sizeof(domNode));
                node->nodeType      = ELEMENT_NODE;
                node->nodeName      = (char *)&(h->key);
                node->ownerDocument = doc;
                node->nodeNumber    = NODE_NO(doc);
                if (doc->rootNode->lastChild) {
                    node->previousSibling = doc->rootNode->lastChild;
                    doc->rootNode->lastChild->nextSibling = node;
                } else {
                    doc->rootNode->firstChild = node;
                }
                doc->rootNode->lastChild = node;
                parent_node = node;
                DBG(fprintf(stderr, "%d: Inserted missing tag '%s' hasContent=%d nodeNumber=%d\n", getDeep(node), node->nodeName, hasContent, node->nodeNumber);)
            }
            h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), e, &hnew);
            node = (domNode*) domAlloc(sizeof(domNode));
            memset(node, 0, sizeof(domNode));
            node->nodeType      = ELEMENT_NODE;


            node->nodeName      = (char *)&(h->key);
            node->ownerDocument = doc;
            node->nodeNumber    = NODE_NO(doc);

            if (parent_node == NULL) {
                if (doc->rootNode->lastChild) {
                    node->previousSibling = doc->rootNode->lastChild;
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
                h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames),
                                        ArgName, &hnew);
                attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
                memset(attrnode, 0, sizeof(domAttrNode));
                attrnode->parentNode  = node;
                attrnode->nodeName    = (char *)&(h->key);
                attrnode->nodeType    = ATTRIBUTE_NODE;
                attrnode->nodeFlags   = 0;
                attrnode->nodeValue   = (char*)MALLOC(nArgVal+1);
                attrnode->valueLength = nArgVal;
                memmove(attrnode->nodeValue, ArgVal, nArgVal);
                *(attrnode->nodeValue + nArgVal) = 0;
                if (ampersandSeen) {
                    TranslateEntityRefs(attrnode->nodeValue, 
                                        &(attrnode->valueLength) );







<







1217
1218
1219
1220
1221
1222
1223

1224
1225
1226
1227
1228
1229
1230
                h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames),
                                        ArgName, &hnew);
                attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
                memset(attrnode, 0, sizeof(domAttrNode));
                attrnode->parentNode  = node;
                attrnode->nodeName    = (char *)&(h->key);
                attrnode->nodeType    = ATTRIBUTE_NODE;

                attrnode->nodeValue   = (char*)MALLOC(nArgVal+1);
                attrnode->valueLength = nArgVal;
                memmove(attrnode->nodeValue, ArgVal, nArgVal);
                *(attrnode->nodeValue + nArgVal) = 0;
                if (ampersandSeen) {
                    TranslateEntityRefs(attrnode->nodeValue, 
                                        &(attrnode->valueLength) );
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
                if (*x) {
                    /*----------------------------------------------------
                    |   allocate new TEXT node for style/script data
                    \---------------------------------------------------*/
                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                    memset(tnode, 0, sizeof(domTextNode));
                    tnode->nodeType      = TEXT_NODE;
                    tnode->nodeFlags     = 0;
                    tnode->ownerDocument = doc;
                    tnode->nodeNumber    = NODE_NO(doc);
                    tnode->parentNode    = node;
                    tnode->valueLength   = (x - start);
                    tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                    memmove(tnode->nodeValue, start, (x - start));
                    *(tnode->nodeValue + (x - start)) = 0;







<







1325
1326
1327
1328
1329
1330
1331

1332
1333
1334
1335
1336
1337
1338
                if (*x) {
                    /*----------------------------------------------------
                    |   allocate new TEXT node for style/script data
                    \---------------------------------------------------*/
                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                    memset(tnode, 0, sizeof(domTextNode));
                    tnode->nodeType      = TEXT_NODE;

                    tnode->ownerDocument = doc;
                    tnode->nodeNumber    = NODE_NO(doc);
                    tnode->parentNode    = node;
                    tnode->valueLength   = (x - start);
                    tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                    memmove(tnode->nodeValue, start, (x - start));
                    *(tnode->nodeValue + (x - start)) = 0;
Changes to generic/domhtml5.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2017  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2017  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domjson.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2017  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2017  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domlock.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domxpath.c.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|   A XPath implementation (lexer/parser/evaluator) for tDOM,
|   the DOM implementation for Tcl.
|   Based on November 16 1999 Recommendation of the W3C
|   (http://www.w3.org/TR/1999/REC-xslt-19991116)
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|   A XPath implementation (lexer/parser/evaluator) for tDOM,
|   the DOM implementation for Tcl.
|   Based on November 16 1999 Recommendation of the W3C
|   (http://www.w3.org/TR/1999/REC-xslt-19991116)
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
2431
2432
2433
2434
2435
2436
2437

2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
        DBG(fprintf(stderr, "nodeTest: nodeType=%d == %d?? \n", node->nodeType, TEXT_NODE);)
        return (node->nodeType == TEXT_NODE);
    } else
    if (step->child->type == IsPI) {
        return (node->nodeType == PROCESSING_INSTRUCTION_NODE);
    } else
    if (step->child->type == IsSpecificPI) {

        return (strncmp (((domProcessingInstructionNode*)node)->targetValue,
                         step->child->strvalue,
                         ((domProcessingInstructionNode*)node)->targetLength)
            == 0);
    } else
    if (step->child->type == IsComment) {
        return (node->nodeType == COMMENT_NODE);
    }
    return 1;
}








>
|
|
|
|







2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
        DBG(fprintf(stderr, "nodeTest: nodeType=%d == %d?? \n", node->nodeType, TEXT_NODE);)
        return (node->nodeType == TEXT_NODE);
    } else
    if (step->child->type == IsPI) {
        return (node->nodeType == PROCESSING_INSTRUCTION_NODE);
    } else
    if (step->child->type == IsSpecificPI) {
        return (node->nodeType == PROCESSING_INSTRUCTION_NODE
                && strncmp (((domProcessingInstructionNode*)node)->targetValue,
                            step->child->strvalue,
                            ((domProcessingInstructionNode*)node)->targetLength)
                    == 0);
    } else
    if (step->child->type == IsComment) {
        return (node->nodeType == COMMENT_NODE);
    }
    return 1;
}

2819
2820
2821
2822
2823
2824
2825



























































2826
2827
2828
2829
2830
2831
2832
int xpathRound (double r) {
    if (r < 0.0) {
        return (int)floor (r + 0.5);
    } else {
        return (int)(r + 0.5);
    }
}




























































/*----------------------------------------------------------------------------
|   xpathEvalFunction
|
\---------------------------------------------------------------------------*/
static int
xpathEvalFunction (







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
int xpathRound (double r) {
    if (r < 0.0) {
        return (int)floor (r + 0.5);
    } else {
        return (int)(r + 0.5);
    }
}

/*----------------------------------------------------------------------------
|   idSplitAndAdd
|
\---------------------------------------------------------------------------*/
static void
idSplitAndAdd (
    char           *idStr,
    Tcl_HashTable  *ids,
    xpathResultSet *result
    ) 
{
    int            pwhite;
    char          *pfrom, *pto;
    Tcl_HashEntry *entryPtr;
    domNode       *node;
    
    pwhite = 0;
    pfrom = pto = idStr;
    while (*pto) {
        switch (*pto) {
        case ' ' : case '\n': case '\r': case '\t':
            if (pwhite) {
                pto++;
                continue;
            }
            *pto = '\0';
            entryPtr = Tcl_FindHashEntry (ids, pfrom);
            if (entryPtr) {
                node = (domNode*) Tcl_GetHashValue (entryPtr);
                /* Don't report nodes out of the fragment list */
                if (node->parentNode != NULL ||
                    (node == node->ownerDocument->documentElement)) {
                    rsAddNode (result, node);
                }
            }
            pwhite = 1;
            pto++;
            continue;
        default:
            if (pwhite) {
                pfrom = pto;
                pwhite = 0;
            }
            pto++;
        }
    }
    if (!pwhite) {
        entryPtr = Tcl_FindHashEntry (ids, pfrom);
        if (entryPtr) {
            node = (domNode*) Tcl_GetHashValue (entryPtr);
            /* Don't report nodes out of the fragment list */
            if (node->parentNode != NULL ||
                (node == node->ownerDocument->documentElement)) {
                rsAddNode (result, node);
            }
        }
    }
}

/*----------------------------------------------------------------------------
|   xpathEvalFunction
|
\---------------------------------------------------------------------------*/
static int
xpathEvalFunction (
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
        if (leftResult.type == EmptyResult) {
            xpathRSFree (&leftResult);
            return XPATH_OK;
        }
        if (leftResult.type == xNodeSetResult) {
            for (i=0; i < leftResult.nr_nodes; i++) {
                leftStr = xpathFuncStringForNode (leftResult.nodes[i]);
                entryPtr = Tcl_FindHashEntry (ids, leftStr);
                if (entryPtr) {
                    node = (domNode*) Tcl_GetHashValue (entryPtr);
                    /* Don't report nodes out of the fragment list */
                    if (node->parentNode != NULL ||
                        (node == node->ownerDocument->documentElement)) {
                        rsAddNode (result, node);
                    }
                }
                FREE(leftStr);
                /*xpathRSFree (&newNodeList);*/
            }
        } else {
            leftStr = xpathFuncString (&leftResult);
            from = 0;
            pwhite = 0;
            pfrom = pto = leftStr;
            while (*pto) {
                switch (*pto) {
                case ' ' : case '\n': case '\r': case '\t':
                    if (pwhite) {
                        pto++;
                        continue;
                    }
                    *pto = '\0';
                    entryPtr = Tcl_FindHashEntry (ids, pfrom);
                    if (entryPtr) {
                        node = (domNode*) Tcl_GetHashValue (entryPtr);
                        /* Don't report nodes out of the fragment list */
                        if (node->parentNode != NULL ||
                            (node == node->ownerDocument->documentElement)) {
                            rsAddNode (result, node);
                        }
                    }
                    pwhite = 1;
                    pto++;
                    continue;
                default:
                    if (pwhite) {
                        pfrom = pto;
                        pwhite = 0;
                    }
                    pto++;
                }
            }
            if (!pwhite) {
                entryPtr = Tcl_FindHashEntry (ids, pfrom);
                if (entryPtr) {
                    node = (domNode*) Tcl_GetHashValue (entryPtr);
                    /* Don't report nodes out of the fragment list */
                    if (node->parentNode != NULL ||
                        (node == node->ownerDocument->documentElement)) {
                        rsAddNode (result, node);
                    }
                }
            }
            FREE(leftStr);
        }
        sortByDocOrder (result);
        xpathRSFree (&leftResult);
        break;

    case f_sum:







|
<
<
<
<
<
<
<
<

<



<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







3128
3129
3130
3131
3132
3133
3134
3135








3136

3137
3138
3139


3140







































3141
3142
3143
3144
3145
3146
3147
        if (leftResult.type == EmptyResult) {
            xpathRSFree (&leftResult);
            return XPATH_OK;
        }
        if (leftResult.type == xNodeSetResult) {
            for (i=0; i < leftResult.nr_nodes; i++) {
                leftStr = xpathFuncStringForNode (leftResult.nodes[i]);
                idSplitAndAdd (leftStr, ids, result);








                FREE(leftStr);

            }
        } else {
            leftStr = xpathFuncString (&leftResult);


            idSplitAndAdd (leftStr, ids, result);







































            FREE(leftStr);
        }
        sortByDocOrder (result);
        xpathRSFree (&leftResult);
        break;

    case f_sum:
5697
5698
5699
5700
5701
5702
5703



5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
        if (steps->type == IsNSAttr) {
            if (strcmp(steps->child->strvalue, "*")==0) {
                return -0.25;
            } else {
                return 0.0;
            }
        } else



        if ( steps->type == IsNode
             || steps->type == IsText
             || steps->type == IsPI
             || steps->type == IsComment
             || steps->type == IsSpecificPI
            ) {
            return -0.5;
        } else 
        if ( steps->type == AxisChild
             || steps->type == AxisAttribute
             || steps->type == EvalSteps
            ) {







>
>
>




<







5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720

5721
5722
5723
5724
5725
5726
5727
        if (steps->type == IsNSAttr) {
            if (strcmp(steps->child->strvalue, "*")==0) {
                return -0.25;
            } else {
                return 0.0;
            }
        } else
        if (steps->type == IsSpecificPI) {
            return 0.0;
        } else 
        if ( steps->type == IsNode
             || steps->type == IsText
             || steps->type == IsPI
             || steps->type == IsComment

            ) {
            return -0.5;
        } else 
        if ( steps->type == AxisChild
             || steps->type == AxisAttribute
             || steps->type == EvalSteps
            ) {
Changes to generic/domxpath.h.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|   A (partial) XPath implementation (lexer/parser/evaluator) for tDOM, 
|   the DOM implementation for Tcl.
|   Based on the August 13 working draft of the W3C 
|   (http://www.w3.org/1999/08/WD-xpath-19990813.html)
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|   A (partial) XPath implementation (lexer/parser/evaluator) for tDOM, 
|   the DOM implementation for Tcl.
|   Based on the August 13 working draft of the W3C 
|   (http://www.w3.org/1999/08/WD-xpath-19990813.html)
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/domxslt.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000 Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A XSLT implementation for tDOM, according to the W3C
|   recommendation (16 Nov 1999).
|   See http://www.w3.org/TR/1999/REC-xslt-19991116 for details.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000 Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A XSLT implementation for tDOM, according to the W3C
|   recommendation (16 Nov 1999).
|   See http://www.w3.org/TR/1999/REC-xslt-19991116 for details.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
3489
3490
3491
3492
3493
3494
3495




3496
3497
3498

3499
3500
3501
3502
3503
3504
3505
                                 NULL, &t_count, errMsg);
                if (rc < 0) goto xsltNumberError;
                Tcl_SetHashValue (h, t_count);
            }
        } else {
            Tcl_DStringInit (&dStr);
            if (currentNode->nodeType == ELEMENT_NODE) {




                /* TODO: This is wrong. Instead this should use the
                   "expanded-name" of the current node. */
                Tcl_DStringAppend (&dStr, currentNode->nodeName, -1);

            } else 
            if (currentNode->nodeType == ATTRIBUTE_NODE) {
                Tcl_DStringAppend (&dStr, "@", 1);
                Tcl_DStringAppend (&dStr, currentNode->nodeName, -1);
            } else 
            if (currentNode->nodeType == COMMENT_NODE) {
                Tcl_DStringAppend (&dStr, "comment()", -1);







>
>
>
>
|
|
|
>







3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
                                 NULL, &t_count, errMsg);
                if (rc < 0) goto xsltNumberError;
                Tcl_SetHashValue (h, t_count);
            }
        } else {
            Tcl_DStringInit (&dStr);
            if (currentNode->nodeType == ELEMENT_NODE) {
                if (!currentNode->parentNode &&
                    currentNode == currentNode->ownerDocument->rootNode) {
                    Tcl_DStringAppend (&dStr, "/", 1);
                } else {
                    /* TODO: This is wrong. Instead this should use the
                       "expanded-name" of the current node. */
                    Tcl_DStringAppend (&dStr, currentNode->nodeName, -1);
                }
            } else 
            if (currentNode->nodeType == ATTRIBUTE_NODE) {
                Tcl_DStringAppend (&dStr, "@", 1);
                Tcl_DStringAppend (&dStr, currentNode->nodeName, -1);
            } else 
            if (currentNode->nodeType == COMMENT_NODE) {
                Tcl_DStringAppend (&dStr, "comment()", -1);
4339
4340
4341
4342
4343
4344
4345






4346
4347
4348
4349
4350
4351
4352
                           &rs, errMsg);
            CHECK_RC;
            TRACE1(" copyOf select='%s':\n", select);
            DBG(rsPrint(&rs));
            if (rs.type == xNodeSetResult) {
                for (i=0; i<rs.nr_nodes; i++) {
                    if (rs.nodes[i]->nodeType == ATTRIBUTE_NODE) {






                        attr = (domAttrNode*)rs.nodes[i];
                        if (attr ->nodeFlags & IS_NS_NODE) {
                            /* If someone selects explicitly namespace nodes
                               to copy-of with e.g namespace::* (remember: @*
                               doesn't select namespace nodes), we must this
                               handle separately.*/
                            /* The xmlns:xml namespace node will always







>
>
>
>
>
>







4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
                           &rs, errMsg);
            CHECK_RC;
            TRACE1(" copyOf select='%s':\n", select);
            DBG(rsPrint(&rs));
            if (rs.type == xNodeSetResult) {
                for (i=0; i<rs.nr_nodes; i++) {
                    if (rs.nodes[i]->nodeType == ATTRIBUTE_NODE) {
                        if (xs->lastNode->firstChild) {
                            /* Adding an Attribute to an element after
                               children have been added to it is an error.
                               Ignore the attribute. */
                            continue;
                        }
                        attr = (domAttrNode*)rs.nodes[i];
                        if (attr ->nodeFlags & IS_NS_NODE) {
                            /* If someone selects explicitly namespace nodes
                               to copy-of with e.g namespace::* (remember: @*
                               doesn't select namespace nodes), we must this
                               handle separately.*/
                            /* The xmlns:xml namespace node will always
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
                             " attribute \"name\".", errMsg);
                return -1;
            }

            rc = evalAttrTemplates( xs, context, currentNode, currentPos,
                                    str, &str2, errMsg);
            CHECK_RC;
            if (!domIsNAME (str2)) {
                reportError (actionNode, "xsl:element: Element name is not a"
                             " valid QName.", errMsg);
                FREE(str2);
                return -1;
            }
            out = NULL;
            nsStr = NULL;







|







4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
                             " attribute \"name\".", errMsg);
                return -1;
            }

            rc = evalAttrTemplates( xs, context, currentNode, currentPos,
                                    str, &str2, errMsg);
            CHECK_RC;
            if (!domIsQNAME (str2)) {
                reportError (actionNode, "xsl:element: Element name is not a"
                             " valid QName.", errMsg);
                FREE(str2);
                return -1;
            }
            out = NULL;
            nsStr = NULL;
Changes to generic/domxslt.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000 Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A (partial) XSLT implementation for tDOM, according to the W3C
|   recommendation (16 Nov 1999,
|   http://www.w3.org/TR/1999/REC-xslt-19991116).
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*----------------------------------------------------------------------------
|   Copyright (c) 2000 Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A (partial) XSLT implementation for tDOM, according to the W3C
|   recommendation (16 Nov 1999,
|   http://www.w3.org/TR/1999/REC-xslt-19991116).
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/nodecmd.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   Rcsid: @(#)$Id$
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   Rcsid: @(#)$Id$
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/nodecmd.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$

|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*----------------------------------------------------------------------------
|   Copyright (C) 1999  Jochen C. Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$

|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/tcldom.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/tcldom.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
|
| 
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
|
| 
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/tclexpat.c.
2379
2380
2381
2382
2383
2384
2385
2386


2387
2388
2389
2390
2391
2392
2393


/*
 *----------------------------------------------------------------------------
 *
 * TclGenExpatStartNamespaceDeclHandler --
 *
 *	Called by expat for each start tag.


 *
 * Results:
 *	None.
 *
 * Side Effects:
 *	Callback scripts are invoked.
 *







|
>
>







2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395


/*
 *----------------------------------------------------------------------------
 *
 * TclGenExpatStartNamespaceDeclHandler --
 *
 *	Called by expat for each namespace declaration command (and is
 *	called before the start tag handler on which the namespace is
 *	declared).
 *
 * Results:
 *	None.
 *
 * Side Effects:
 *	Callback scripts are invoked.
 *
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
  }

  activeTclHandlerSet = expat->firstTclHandlerSet;
  while (activeTclHandlerSet) {

      switch (activeTclHandlerSet->status) {
      case TCL_CONTINUE:
          /*
           * We're currently skipping elements looking for the
           * close of the continued element.
           */

          activeTclHandlerSet->continueCount++;
          goto nextTcl;
          break;
      case TCL_BREAK:
          goto nextTcl;
          break;
      default:
          ;
      }








<
<
<
<
<
<
<
<







2413
2414
2415
2416
2417
2418
2419








2420
2421
2422
2423
2424
2425
2426
  }

  activeTclHandlerSet = expat->firstTclHandlerSet;
  while (activeTclHandlerSet) {

      switch (activeTclHandlerSet->status) {
      case TCL_CONTINUE:








      case TCL_BREAK:
          goto nextTcl;
          break;
      default:
          ;
      }

2474
2475
2476
2477
2478
2479
2480
2481

2482
2483
2484
2485
2486
2487
2488
}

/*
 *----------------------------------------------------------------------------
 *
 * TclGenExpatEndNamespaceDeclHandler --
 *
 *	Called by expat for each end tag.

 *
 * Results:
 *	None.
 *
 * Side Effects:
 *	Callback scripts are invoked.
 *







|
>







2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
}

/*
 *----------------------------------------------------------------------------
 *
 * TclGenExpatEndNamespaceDeclHandler --
 *
 *	Called by expat for the end of scope for any namespace (and
 *	after the handler for the according element tag.
 *
 * Results:
 *	None.
 *
 * Side Effects:
 *	Callback scripts are invoked.
 *
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
  }

  activeTclHandlerSet = expat->firstTclHandlerSet;
  while (activeTclHandlerSet) {

      switch (activeTclHandlerSet->status) {
      case TCL_CONTINUE:
          /*
           * We're currently skipping elements looking for the
           * end of the currently open element.
           */

          if (!--(activeTclHandlerSet->continueCount)) {
              activeTclHandlerSet->status = TCL_OK;
          }
          goto nextTcl;
          break;
      case TCL_BREAK:
          goto nextTcl;
          break;
      default:
          ;
      }








<
<
<
<
<
<
<
<
<
<







2500
2501
2502
2503
2504
2505
2506










2507
2508
2509
2510
2511
2512
2513
  }

  activeTclHandlerSet = expat->firstTclHandlerSet;
  while (activeTclHandlerSet) {

      switch (activeTclHandlerSet->status) {
      case TCL_CONTINUE:










      case TCL_BREAK:
          goto nextTcl;
          break;
      default:
          ;
      }

Changes to generic/tclpull.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2018  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*----------------------------------------------------------------------------
|   Copyright (c) 2018  Rolf Ade ([email protected])
|-----------------------------------------------------------------------------
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/tdomStubLib.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 2007 Rolf Ade ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|   Implements entry point, which has to be called by C coded extensions
|   to tDOM. Following http://wiki.tcl.tk/3358.
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 2007 Rolf Ade ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|   Implements entry point, which has to be called by C coded extensions
|   to tDOM. Following http://wiki.tcl.tk/3358.
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to generic/tdominit.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
| 
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*----------------------------------------------------------------------------
|   Copyright (c) 1999 Jochen Loewer ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   A DOM implementation for Tcl using James Clark's expat XML parser
| 
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

int
Tdom_Init (
     Tcl_Interp *interp /* Interpreter to initialize. */
) {
        
#ifdef USE_TCL_STUBS
    Tcl_InitStubs(interp, "8", 0);
#endif
        
    domModuleInitialize();

#ifdef TCL_THREADS
    tcldom_initialize();
#endif /* TCL_THREADS */







|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

int
Tdom_Init (
     Tcl_Interp *interp /* Interpreter to initialize. */
) {
        
#ifdef USE_TCL_STUBS
    Tcl_InitStubs(interp, "8.4", 0);
#endif
        
    domModuleInitialize();

#ifdef TCL_THREADS
    tcldom_initialize();
#endif /* TCL_THREADS */
Changes to generic/xmlsimple.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 1999  Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|
|   A simple (hopefully fast) parser to build up a DOM structure in memory.
|   Initially based on Richard Hipp's XML parser for TMML.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 1999  Jochen Loewer ([email protected])
|-----------------------------------------------------------------------------
|
|
|   A simple (hopefully fast) parser to build up a DOM structure in memory.
|   Initially based on Richard Hipp's XML parser for TMML.
|
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
                } else {
                    /*--------------------------------------------------------
                      |   allocate new TEXT node
                      \-------------------------------------------------------*/
                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                    memset(tnode, 0, sizeof(domTextNode));
                    tnode->nodeType    = TEXT_NODE;
                    tnode->nodeFlags   = 0;
                    tnode->ownerDocument = doc;
                    tnode->nodeNumber  = NODE_NO(doc);
                    tnode->valueLength = (x - start);
                    tnode->nodeValue   = (char*)MALLOC((x - start)+1);
                    memmove(tnode->nodeValue, start, (x - start));
                    *(tnode->nodeValue + (x - start)) = 0;
                    tnode->parentNode = parent_node;







<







414
415
416
417
418
419
420

421
422
423
424
425
426
427
                } else {
                    /*--------------------------------------------------------
                      |   allocate new TEXT node
                      \-------------------------------------------------------*/
                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                    memset(tnode, 0, sizeof(domTextNode));
                    tnode->nodeType    = TEXT_NODE;

                    tnode->ownerDocument = doc;
                    tnode->nodeNumber  = NODE_NO(doc);
                    tnode->valueLength = (x - start);
                    tnode->nodeValue   = (char*)MALLOC((x - start)+1);
                    memmove(tnode->nodeValue, start, (x - start));
                    *(tnode->nodeValue + (x - start)) = 0;
                    tnode->parentNode = parent_node;
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
                    if (*x) {
                        /*----------------------------------------------------
                        |   allocate new COMMENT node for comments
                        \---------------------------------------------------*/
                        tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                        memset(tnode, 0, sizeof(domTextNode));
                        tnode->nodeType      = COMMENT_NODE;
                        tnode->nodeFlags     = 0;
                        tnode->ownerDocument = doc;
                        tnode->nodeNumber    = NODE_NO(doc);
                        tnode->parentNode    = parent_node;
                        tnode->valueLength   = x - start - 4;
                        tnode->nodeValue     = (char*)MALLOC(tnode->valueLength+1);
                        memmove(tnode->nodeValue, start+4, tnode->valueLength);
                        *(tnode->nodeValue + tnode->valueLength) = 0;







<







500
501
502
503
504
505
506

507
508
509
510
511
512
513
                    if (*x) {
                        /*----------------------------------------------------
                        |   allocate new COMMENT node for comments
                        \---------------------------------------------------*/
                        tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                        memset(tnode, 0, sizeof(domTextNode));
                        tnode->nodeType      = COMMENT_NODE;

                        tnode->ownerDocument = doc;
                        tnode->nodeNumber    = NODE_NO(doc);
                        tnode->parentNode    = parent_node;
                        tnode->valueLength   = x - start - 4;
                        tnode->nodeValue     = (char*)MALLOC(tnode->valueLength+1);
                        memmove(tnode->nodeValue, start+4, tnode->valueLength);
                        *(tnode->nodeValue + tnode->valueLength) = 0;
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
                                      \---------------------------------------------------*/
                                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                                    memset(tnode, 0, sizeof(domTextNode));
                                    if (keepCDATA)
                                        tnode->nodeType      = CDATA_SECTION_NODE;
                                    else 
                                        tnode->nodeType      = TEXT_NODE;
                                    tnode->nodeFlags     = 0;
                                    tnode->ownerDocument = doc;
                                    tnode->nodeNumber    = NODE_NO(doc);
                                    tnode->parentNode    = parent_node;
                                    tnode->valueLength   = (x - start);
                                    tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                                    memmove(tnode->nodeValue, start, (x - start));
                                    *(tnode->nodeValue + (x - start)) = 0;







<







607
608
609
610
611
612
613

614
615
616
617
618
619
620
                                      \---------------------------------------------------*/
                                    tnode = (domTextNode*) domAlloc(sizeof(domTextNode));
                                    memset(tnode, 0, sizeof(domTextNode));
                                    if (keepCDATA)
                                        tnode->nodeType      = CDATA_SECTION_NODE;
                                    else 
                                        tnode->nodeType      = TEXT_NODE;

                                    tnode->ownerDocument = doc;
                                    tnode->nodeNumber    = NODE_NO(doc);
                                    tnode->parentNode    = parent_node;
                                    tnode->valueLength   = (x - start);
                                    tnode->nodeValue     = (char*)MALLOC((x - start)+1);
                                    memmove(tnode->nodeValue, start, (x - start));
                                    *(tnode->nodeValue + (x - start)) = 0;
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
                    /*------------------------------------------------------------
                    |   allocate new PI node for processing instruction section
                    \-----------------------------------------------------------*/
                    pinode = (domProcessingInstructionNode*)
                            domAlloc(sizeof(domProcessingInstructionNode));
                    memset(pinode, 0, sizeof(domProcessingInstructionNode));
                    pinode->nodeType      = PROCESSING_INSTRUCTION_NODE;
                    pinode->nodeFlags     = 0;
                    pinode->namespace     = 0;
                    pinode->ownerDocument = doc;
                    pinode->nodeNumber    = NODE_NO(doc);
                    pinode->parentNode    = parent_node;

                    /*-------------------------------------------------
                    |   extract PI target
                    \------------------------------------------------*/







<
<







651
652
653
654
655
656
657


658
659
660
661
662
663
664
                    /*------------------------------------------------------------
                    |   allocate new PI node for processing instruction section
                    \-----------------------------------------------------------*/
                    pinode = (domProcessingInstructionNode*)
                            domAlloc(sizeof(domProcessingInstructionNode));
                    memset(pinode, 0, sizeof(domProcessingInstructionNode));
                    pinode->nodeType      = PROCESSING_INSTRUCTION_NODE;


                    pinode->ownerDocument = doc;
                    pinode->nodeNumber    = NODE_NO(doc);
                    pinode->parentNode    = parent_node;

                    /*-------------------------------------------------
                    |   extract PI target
                    \------------------------------------------------*/
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
            |   create new DOM element node
            \-----------------------------------------------------*/
            h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), start+1,
                                    &hnew);
            node = (domNode*) domAlloc(sizeof(domNode));
            memset(node, 0, sizeof(domNode));
            node->nodeType      = ELEMENT_NODE;
            node->nodeFlags     = 0;
            node->namespace     = 0;
            node->nodeName      = (char *)&(h->key);
            node->ownerDocument = doc;
            node->nodeNumber    = NODE_NO(doc);
            node->ownerDocument = doc;

            if (parent_node == NULL) {
                if (doc->rootNode->lastChild) {







<
<







730
731
732
733
734
735
736


737
738
739
740
741
742
743
            |   create new DOM element node
            \-----------------------------------------------------*/
            h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_tagNames), start+1,
                                    &hnew);
            node = (domNode*) domAlloc(sizeof(domNode));
            memset(node, 0, sizeof(domNode));
            node->nodeType      = ELEMENT_NODE;


            node->nodeName      = (char *)&(h->key);
            node->ownerDocument = doc;
            node->nodeNumber    = NODE_NO(doc);
            node->ownerDocument = doc;

            if (parent_node == NULL) {
                if (doc->rootNode->lastChild) {
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
                    h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames),
                                            ArgName, &hnew);
                    attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
                    memset(attrnode, 0, sizeof(domAttrNode));
                    attrnode->parentNode  = node;
                    attrnode->nodeName    = (char *)&(h->key);
                    attrnode->nodeType    = ATTRIBUTE_NODE;
                    attrnode->nodeFlags   = 0;
                    attrnode->nodeValue   = (char*)MALLOC(nArgVal+1);
                    attrnode->valueLength = nArgVal;
                    memmove(attrnode->nodeValue, ArgVal, nArgVal);
                    *(attrnode->nodeValue + nArgVal) = 0;
                    if (ampersandSeen) {
                        if (!TranslateEntityRefs(attrnode->nodeValue,
                                                 &(attrnode->valueLength) )) {







<







902
903
904
905
906
907
908

909
910
911
912
913
914
915
                    h = Tcl_CreateHashEntry(&HASHTAB(doc,tdom_attrNames),
                                            ArgName, &hnew);
                    attrnode = (domAttrNode*) domAlloc(sizeof(domAttrNode));
                    memset(attrnode, 0, sizeof(domAttrNode));
                    attrnode->parentNode  = node;
                    attrnode->nodeName    = (char *)&(h->key);
                    attrnode->nodeType    = ATTRIBUTE_NODE;

                    attrnode->nodeValue   = (char*)MALLOC(nArgVal+1);
                    attrnode->valueLength = nArgVal;
                    memmove(attrnode->nodeValue, ArgVal, nArgVal);
                    *(attrnode->nodeValue + nArgVal) = 0;
                    if (ampersandSeen) {
                        if (!TranslateEntityRefs(attrnode->nodeValue,
                                                 &(attrnode->valueLength) )) {
Changes to lib/tdom.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#----------------------------------------------------------------------------
#   Copyright (c) 1999 Jochen Loewer ([email protected])
#----------------------------------------------------------------------------
#
#   $Id$
#
#
#   The higher level functions of tDOM written in plain Tcl.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 1.1 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#----------------------------------------------------------------------------
#   Copyright (c) 1999 Jochen Loewer ([email protected])
#----------------------------------------------------------------------------
#
#   $Id$
#
#
#   The higher level functions of tDOM written in plain Tcl.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 2.0 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.
Changes to tests/OASIS-suite.tcl.
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
set notFailed 0

proc extRefHandler {base systemId publicId} {
    variable usageCounter

    set absolutURI [uri::resolve $base $systemId]
    incr usageCounter($absolutURI)
    if {$usageCounter($absolutURI) > 10} {
        error "Cirular import/include?"
    }
    switch $systemId {
        "notfound.xml" {
            return [list string $absolutURI "<notfound/>"]
        }
    }
    array set uriData [uri::split $absolutURI]







|
|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
set notFailed 0

proc extRefHandler {base systemId publicId} {
    variable usageCounter

    set absolutURI [uri::resolve $base $systemId]
    incr usageCounter($absolutURI)
    if {$usageCounter($absolutURI) > 50} {
        error "Circular import/include?"
    }
    switch $systemId {
        "notfound.xml" {
            return [list string $absolutURI "<notfound/>"]
        }
    }
    array set uriData [uri::split $absolutURI]
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
            set refinfosetdoc [$infoset $refdoc]
            set resultinfosetdoc [$infoset $resultDoc]
            if {[$refinfosetdoc asXML -indent none] 
                ne [$resultinfosetdoc asXML -indent none]} {
                incr compareDIFF
                log 1 "Result and ref differ."
                log 2 "Ref:"
                log 2 [$refinfosetdoc asXML]
                log 2 "Result:"
                log 2 [$resultinfosetdoc asXML]
            } else {
                incr compareOK
            }
            $refinfosetdoc delete
            $resultinfosetdoc delete
        } else {
            incr compareFAILED







|

|







360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
            set refinfosetdoc [$infoset $refdoc]
            set resultinfosetdoc [$infoset $resultDoc]
            if {[$refinfosetdoc asXML -indent none] 
                ne [$resultinfosetdoc asXML -indent none]} {
                incr compareDIFF
                log 1 "Result and ref differ."
                log 2 "Ref:"
                log 2 [$refinfosetdoc asXML -indent none]
                log 2 "Result:"
                log 2 [$resultinfosetdoc asXML -indent none]
            } else {
                incr compareOK
            }
            $refinfosetdoc delete
            $resultinfosetdoc delete
        } else {
            incr compareFAILED
Changes to tests/all.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# all.tcl --
#
# This file contains a top-level script to run all of the Tcl
# tests.  Execute it by invoking "tclsh all.test".
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id$
# 

source [file join [file dir [info script]] loadtdom.tcl]

if {$tcl_version >= 8.1} {
    if {[lsearch [info proc ::tcltest::testConstraint] \
            ::tcltest::testConstraint] == -1} {
        set ::tcltest::testConfig(need_i18n) 1
        set ::tcltest::testConstraints(need_i18n) 1
        if {[info procs ::tdom::extRefHandler] != ""} {
            set ::tcltest::testConfig(need_uri) 1
            set ::tcltest::testConstraints(need_uri) 1
        }
    } else {
        ::tcltest::testConstraint need_i18n 1
        if {[info procs ::tdom::extRefHandler] != ""} {
            ::tcltest::testConstraint need_uri 1
        }
    }
}

::tcltest::testConstraint needExpand 1
if {$tcl_version < 8.5} {
    ::tcltest::testConstraint needExpand 0
}
    
set timeCmd {clock format [clock seconds]}

set ::tcltest::testSingleFile false

puts stdout "Tcl $tcl_patchLevel tests running in interp:  [info nameofexecutable]"

if {$tcl_version < 8.2} {
    set TESTS_DIR [file join [pwd] [file dirname [info script]]]
    set currentDir [pwd]

    set globPattern [file join $TESTS_DIR *.test]
    foreach file [lsort [glob $globPattern]] {
        set tail [file tail $file]
        if {[string match l.*.test $tail]} {
            # This is an SCCS lockfile; ignore it
            continue
        }
        puts stdout $tail
        if {[catch {source $file} msg]} {
            puts stdout $msg
        }
    }
} else {
    set ::tcltest::testsDirectory [file dir [info script]]

    puts stdout "Tests running in working dir:  $::tcltest::testsDirectory"
    if {[llength $::tcltest::skip] > 0} {
        puts stdout "Skipping tests that match:  $::tcltest::skip"
    }
    if {[llength $::tcltest::match] > 0} {
        puts stdout "Only running tests that match:  $::tcltest::match"
    }

    if {[llength $::tcltest::skipFiles] > 0} {
        puts stdout "Skipping test files that match:  $::tcltest::skipFiles"
    }
    if {[llength $::tcltest::matchFiles] > 0} {
        puts stdout "Only sourcing test files that match:  $::tcltest::matchFiles"
    }

    puts stdout "Tests began at [eval $timeCmd]"

    # source each of the specified tests
    foreach file [lsort [::tcltest::getMatchingFiles]] {
        set tail [file tail $file]
        puts stdout $tail
        if {[catch {source $file} msg]} {
            puts stdout $msg
        }
    }
} 

# cleanup
puts stdout "\nTests ended at [eval $timeCmd]"
::tcltest::cleanupTests 1

# See http://mini.net/tcl/3248 for an explanation.
proc exit args {}














<
<
<
<
<
|
<
<
<
<
<
<
|
|
|
<
|
<

<
<
|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
|
<
<
<
|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



1
2
3
4
5
6
7
8
9
10
11
12
13





14






15
16
17

18

19


20







21














22

23



24



25























26
27
28
# all.tcl --
#
# This file contains a top-level script to run all of the Tcl
# tests.  Execute it by invoking "tclsh all.test".
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id$
# 

source [file join [file dir [info script]] loadtdom.tcl]






if {[info procs ::tdom::extRefHandler] != ""} {






    testConstraint need_uri 1
}


singleProcess 1

if {$tcl_version < 8.5} {


    # We still support 8.4 to some degree







    testsDirectory [file dirname [info script]]














} else {

    configure {*}$argv -testdir [file dirname [info script]]



}



runAllTests























# See http://mini.net/tcl/3248 for an explanation.
proc exit args {}

Changes to tests/dom.test.
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858

set nameStartChars [lsort -command sortCmd \
        [concat $BaseChar $Ideographic 0x005F 0x003A]]

# Append stop char needed by the test code to work properly.
lappend nameStartChars 0x10000

test dom-3.8 {isName} {longRunning && need_i18n} {
    set ind 0
    set nr 0
    while {$nr < 65536} {
        set range [lindex $nameStartChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break







|







844
845
846
847
848
849
850
851
852
853
854
855
856
857
858

set nameStartChars [lsort -command sortCmd \
        [concat $BaseChar $Ideographic 0x005F 0x003A]]

# Append stop char needed by the test code to work properly.
lappend nameStartChars 0x10000

test dom-3.8 {isName} {longRunning} {
    set ind 0
    set nr 0
    while {$nr < 65536} {
        set range [lindex $nameStartChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
set nameChars [lsort -command sortCmd \
        [concat $BaseChar $Ideographic $Digit 0x002E 0x002D 0x005F 0x003A \
                $CombiningChar $Extender]]

# Append stop char needed by the test code to work properly.
lappend nameChars 0x10000

test dom-3.9 {isName} {longRunning && need_i18n} {
    set ind 0
    set nr 0
    while {$nr < 65536} {
        set range [lindex $nameChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break







|







880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
set nameChars [lsort -command sortCmd \
        [concat $BaseChar $Ideographic $Digit 0x002E 0x002D 0x005F 0x003A \
                $CombiningChar $Extender]]

# Append stop char needed by the test code to work properly.
lappend nameChars 0x10000

test dom-3.9 {isName} {
    set ind 0
    set nr 0
    while {$nr < 65536} {
        set range [lindex $nameChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
     dom isQName 1:foo
} {0}

set XMLChars {
    0x9 0xA 0xD {0x20 0xD7FF} {0xE000 0xFFFD} {0x10000 0x10FFFF}
}

test dom-3.27 {isCharData} {longRunning && need_i18n} {
    set ind 0
    set nr 1
    while {$nr < 65536} {
        set range [lindex $XMLChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break







|







991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
     dom isQName 1:foo
} {0}

set XMLChars {
    0x9 0xA 0xD {0x20 0xD7FF} {0xE000 0xFFFD} {0x10000 0x10FFFF}
}

test dom-3.27 {isCharData} {longRunning} {
    set ind 0
    set nr 1
    while {$nr < 65536} {
        set range [lindex $XMLChars $ind]
        incr ind
        if {[llength $range] == 2} {
            foreach {min max} $range break
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
    dom isCDATA "invalid: ]]>"
} {0}

test dom-3.37 {isCDATA} {
    dom isCDATA "valid: ]]> "
} {0}

test dom-3.38 {isCDATA} {need_i18n} {
    dom isCDATA "\ud7fa\ud7fb\ud7fc\ud7fd\ud7fe\ud7ff]]>"
} {0}

test dom-3.39 {isPIValue} {
    dom isPIValue "some processing instruction data"
} {1}








|







1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
    dom isCDATA "invalid: ]]>"
} {0}

test dom-3.37 {isCDATA} {
    dom isCDATA "valid: ]]> "
} {0}

test dom-3.38 {isCDATA} {
    dom isCDATA "\ud7fa\ud7fb\ud7fc\ud7fd\ud7fe\ud7ff]]>"
} {0}

test dom-3.39 {isPIValue} {
    dom isPIValue "some processing instruction data"
} {1}

Changes to tests/domDoc.test.
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#    domDoc-27.*: deleteXPathCache
#    domDoc-28.*: createElementNS
#
# Copyright (c) 2004 - 2007 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

test domDoc-1.1 {asXML -escapeNonASCII} {need_i18n} {
    set doc [dom parse [tdom::xmlReadFile \
            [file join [file dir [info script]] data/i18n_1.xml]]]
    set result [$doc asXML -escapeNonASCII]
    $doc delete
    set result
} {<test>&#1072;&#1073;&#1074;&#1075;&#1076;&#1077;&#1078;&#1079;&#1080;&#1081;</test>
}

test domDoc-1.2 {asXML -escapeNonASCII; comments and PI's are not altered} {need_i18n} {
    set doc [dom parse [tdom::xmlReadFile \
            [file join [file dir [info script]] data/i18n_2.xml]]]
    set result [$doc asXML -indent none -escapeNonASCII]
    $doc delete
    set result
} "<root withUmlauts=\"&#228;&#246;&#252;&#223;\"><!-- A comment with german umlauts: \u00E4\u00F6\u00FC\u00DF --><?\u00E4\u00F6\u00FC\u00DF A processing node with german umlauts?>
german umlauts: &#228;&#246;&#252;&#223;
</root>"

test domDoc-1.3 {asHTML -escapeNonASCII -htmlEntities} {need_i18n} {
    set doc [dom parse {<html><body>&#228;&#xfc;&#8222;&#8223;&#8224;</body></html>}]
    set result [$doc asHTML -escapeNonASCII -htmlEntities]
    $doc delete
    set result
} {<html><body>&auml;&uuml;&bdquo;&#8223;&dagger;</body></html>}









|








|









|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#    domDoc-27.*: deleteXPathCache
#    domDoc-28.*: createElementNS
#
# Copyright (c) 2004 - 2007 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

test domDoc-1.1 {asXML -escapeNonASCII} {
    set doc [dom parse [tdom::xmlReadFile \
            [file join [file dir [info script]] data/i18n_1.xml]]]
    set result [$doc asXML -escapeNonASCII]
    $doc delete
    set result
} {<test>&#1072;&#1073;&#1074;&#1075;&#1076;&#1077;&#1078;&#1079;&#1080;&#1081;</test>
}

test domDoc-1.2 {asXML -escapeNonASCII; comments and PI's are not altered} {
    set doc [dom parse [tdom::xmlReadFile \
            [file join [file dir [info script]] data/i18n_2.xml]]]
    set result [$doc asXML -indent none -escapeNonASCII]
    $doc delete
    set result
} "<root withUmlauts=\"&#228;&#246;&#252;&#223;\"><!-- A comment with german umlauts: \u00E4\u00F6\u00FC\u00DF --><?\u00E4\u00F6\u00FC\u00DF A processing node with german umlauts?>
german umlauts: &#228;&#246;&#252;&#223;
</root>"

test domDoc-1.3 {asHTML -escapeNonASCII -htmlEntities} {
    set doc [dom parse {<html><body>&#228;&#xfc;&#8222;&#8223;&#8224;</body></html>}]
    set result [$doc asHTML -escapeNonASCII -htmlEntities]
    $doc delete
    set result
} {<html><body>&auml;&uuml;&bdquo;&#8223;&dagger;</body></html>}


Changes to tests/domjson.test.
11
12
13
14
15
16
17




18
19
20
21
22
23
24
#    json-7.*: jsonType
#    json-8.*: appendFromScript
#    json-9.*: cloneNode
# Copyright (c) 2017 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]






namespace eval nodeCmds {
    dom createNodeCmd elementNode e1
    dom createNodeCmd -jsonType ARRAY elementNode jae1
    dom createNodeCmd elementNode e2
    dom createNodeCmd commentNode c
    dom createNodeCmd textNode    t







>
>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#    json-7.*: jsonType
#    json-8.*: appendFromScript
#    json-9.*: cloneNode
# Copyright (c) 2017 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

testConstraint needExpand 1
if {$tcl_version < 8.5} {
    testConstraint needExpand 0
}

namespace eval nodeCmds {
    dom createNodeCmd elementNode e1
    dom createNodeCmd -jsonType ARRAY elementNode jae1
    dom createNodeCmd elementNode e2
    dom createNodeCmd commentNode c
    dom createNodeCmd textNode    t
Changes to tests/domnamespace.test.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Copyright (c) 2002 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test domnamespace-1.1 {multiple definition of the same namespace (same prefix/uri)} {need_i18n} {
    set ch [open [file join [pwd] [file dir [info script]] data/REC-xslt-19991116.xml]]
    fconfigure $ch -encoding iso8859-1
    set doc [dom parse -channel $ch]
    set root [$doc documentElement]
    set nodes [$root selectNodes //e:element-syntax]
    $doc delete
    llength $nodes







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Copyright (c) 2002 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test domnamespace-1.1 {multiple definition of the same namespace (same prefix/uri)} {
    set ch [open [file join [pwd] [file dir [info script]] data/REC-xslt-19991116.xml]]
    fconfigure $ch -encoding iso8859-1
    set doc [dom parse -channel $ch]
    set root [$doc documentElement]
    set nodes [$root selectNodes //e:element-syntax]
    $doc delete
    llength $nodes
Changes to tests/html5reader.test.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Copyright (c) 2017 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

testConstraint html5 [dom featureinfo html5]

test html5-1.1 {HTML character entities} {need_i18n html5} {
    set doc [dom parse -html5 -ignorexmlns {<html><body>&nbsp;&iexcl;&Auml;&uuml;</body></html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u00A0\u00A1\u00c4\u00fc"

test html5-1.2 {character entities} {need_i18n html5} {
    set doc [dom parse -html5 -ignorexmlns {<html><body>&#214;&#xC4;&#xc4;</body></html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"

test html5-1.3 {character entities} {need_i18n html5} {
    set doc [dom parse -html5 -ignorexmlns {<html>&euro;&ni;</html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u20ac\u220b"

test html5-1.4 {invalid characters} {need_i18n html5} {
    set doc [dom parse -html5 -ignorexmlns {<html>&#1;&#2;&#3;&#4;foo;</html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u0001\u0002\u0003\u0004foo;"







|








|








|








|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Copyright (c) 2017 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

testConstraint html5 [dom featureinfo html5]

test html5-1.1 {HTML character entities} {html5} {
    set doc [dom parse -html5 -ignorexmlns {<html><body>&nbsp;&iexcl;&Auml;&uuml;</body></html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u00A0\u00A1\u00c4\u00fc"

test html5-1.2 {character entities} {html5} {
    set doc [dom parse -html5 -ignorexmlns {<html><body>&#214;&#xC4;&#xc4;</body></html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"

test html5-1.3 {character entities} {html5} {
    set doc [dom parse -html5 -ignorexmlns {<html>&euro;&ni;</html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u20ac\u220b"

test html5-1.4 {invalid characters} {html5} {
    set doc [dom parse -html5 -ignorexmlns {<html>&#1;&#2;&#3;&#4;foo;</html>}]
    set root [$doc documentElement]
    set body [$root selectNodes body]
    set result [$body text]
    $doc delete
    set result
} "\u0001\u0002\u0003\u0004foo;"
Changes to tests/htmlreader.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# Copyright (c) 2002-2007 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test html-1.1 {HTML character entities} {need_i18n} {
    set doc [dom parse -html {<html><body>&nbsp;&iexcl;&Auml;&uuml;</body></html>}]
    set root [$doc documentElement]
    set body [$root firstChild]
    set result [$body text]
    $doc delete
    set result
} "\u00A0\u00A1\u00c4\u00fc"

test html-1.2 {character entities} {need_i18n} {
    set doc [dom parse -html {<html><body>&#214;&#xC4;&#xc4;</body></html>}]
    set root [$doc documentElement]
    set body [$root firstChild]
    set result [$body text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"

test html-1.3 {character entities} {need_i18n} {
    set doc [dom parse -html {<html>&euro;&ni;</html>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "\u20ac\u220b"








|








|








|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# Copyright (c) 2002-2007 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test html-1.1 {HTML character entities} {
    set doc [dom parse -html {<html><body>&nbsp;&iexcl;&Auml;&uuml;</body></html>}]
    set root [$doc documentElement]
    set body [$root firstChild]
    set result [$body text]
    $doc delete
    set result
} "\u00A0\u00A1\u00c4\u00fc"

test html-1.2 {character entities} {
    set doc [dom parse -html {<html><body>&#214;&#xC4;&#xc4;</body></html>}]
    set root [$doc documentElement]
    set body [$root firstChild]
    set result [$body text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"

test html-1.3 {character entities} {
    set doc [dom parse -html {<html>&euro;&ni;</html>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "\u20ac\u220b"

58
59
60
61
62
63
64




























































































































































































































































































65
66
67
68
69
70
71
test html-1.6 {Numeric character entity} {
    set doc [dom parse -html {<html>&#xabcdef;</html>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "&#xabcdef;"





























































































































































































































































































test html-2.1 {not closed p tags} {
    set doc [dom parse -html {
        <html><body><p>Para 1<p>Para 2<p>Para 3</body></html>
    }]
    set result [$doc asXML -indent none]
    $doc delete







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
test html-1.6 {Numeric character entity} {
    set doc [dom parse -html {<html>&#xabcdef;</html>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "&#xabcdef;"

test html-1.7 {character entities} {
    set doc [dom parse -html {<html>&frac14;</html>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "\u00bc"

proc toutf8 c {
    set s [encoding convertto utf-8 $c]
    binary scan $s H* x
    regsub -all -expanded {..} $x {\x&}
}

test html-1.8 {character entities} {
    set result ""
    foreach {entity byteseq} {
        "amp"       "\\x26"
        "lt"        "\\x3C"
        "gt"        "\\x3E"
        "apos"      "\\x27"
        "quot"      "\\x22"
        "nbsp"      "\\xC2\\xA0"
        "iexcl"     "\\xC2\\xA1"
        "cent"      "\\xC2\\xA2"
        "pound"     "\\xC2\\xA3"
        "curren"    "\\xC2\\xA4"
        "yen"       "\\xC2\\xA5"
        "brvbar"    "\\xC2\\xA6"
        "sect"      "\\xC2\\xA7"
        "uml"       "\\xC2\\xA8"
        "copy"      "\\xC2\\xA9"
        "ordf"      "\\xC2\\xAA"
        "laquo"     "\\xC2\\xAB"
        "not"       "\\xC2\\xAC"
        "shy"       "\\xC2\\xAD"
        "reg"       "\\xC2\\xAE"
        "macr"      "\\xC2\\xAF"
        "deg"       "\\xC2\\xB0"
        "plusmn"    "\\xC2\\xB1"
        "sup2"      "\\xC2\\xB2"
        "sup3"      "\\xC2\\xB3"
        "acute"     "\\xC2\\xB4"
        "micro"     "\\xC2\\xB5"
        "para"      "\\xC2\\xB6"
        "middot"    "\\xC2\\xB7"
        "cedil"     "\\xC2\\xB8"
        "sup1"      "\\xC2\\xB9"
        "ordm"      "\\xC2\\xBA"
        "raquo"     "\\xC2\\xBB"
        "frac14"    "\\xC2\\xBC"
        "frac12"    "\\xC2\\xBD"
        "frac34"    "\\xC2\\xBE"
        "iquest"    "\\xC2\\xBF"
        "Agrave"    "\\xC3\\x80"
        "Aacute"    "\\xC3\\x81"
        "Acirc"     "\\xC3\\x82"
        "Atilde"    "\\xC3\\x83"
        "Auml"      "\\xC3\\x84"
        "Aring"     "\\xC3\\x85"
        "AElig"     "\\xC3\\x86"
        "Ccedil"    "\\xC3\\x87"
        "Egrave"    "\\xC3\\x88"
        "Eacute"    "\\xC3\\x89"
        "Ecirc"     "\\xC3\\x8A"
        "Euml"      "\\xC3\\x8B"
        "Igrave"    "\\xC3\\x8C"
        "Iacute"    "\\xC3\\x8D"
        "Icirc"     "\\xC3\\x8E"
        "Iuml"      "\\xC3\\x8F"
        "ETH"       "\\xC3\\x90"
        "Ntilde"    "\\xC3\\x91"
        "Ograve"    "\\xC3\\x92"
        "Oacute"    "\\xC3\\x93"
        "Ocirc"     "\\xC3\\x94"
        "Otilde"    "\\xC3\\x95"
        "Ouml"      "\\xC3\\x96"
        "times"     "\\xC3\\x97"
        "Oslash"    "\\xC3\\x98"
        "Ugrave"    "\\xC3\\x99"
        "Uacute"    "\\xC3\\x9A"
        "Ucirc"     "\\xC3\\x9B"
        "Uuml"      "\\xC3\\x9C"
        "Yacute"    "\\xC3\\x9D"
        "THORN"     "\\xC3\\x9E"
        "szlig"     "\\xC3\\x9F"
        "agrave"    "\\xC3\\xA0"
        "aacute"    "\\xC3\\xA1"
        "acirc"     "\\xC3\\xA2"
        "atilde"    "\\xC3\\xA3"
        "auml"      "\\xC3\\xA4"
        "aring"     "\\xC3\\xA5"
        "aelig"     "\\xC3\\xA6"
        "ccedil"    "\\xC3\\xA7"
        "egrave"    "\\xC3\\xA8"
        "eacute"    "\\xC3\\xA9"
        "ecirc"     "\\xC3\\xAA"
        "euml"      "\\xC3\\xAB"
        "igrave"    "\\xC3\\xAC"
        "iacute"    "\\xC3\\xAD"
        "icirc"     "\\xC3\\xAE"
        "iuml"      "\\xC3\\xAF"
        "eth"       "\\xC3\\xB0"
        "ntilde"    "\\xC3\\xB1"
        "ograve"    "\\xC3\\xB2"
        "oacute"    "\\xC3\\xB3"
        "ocirc"     "\\xC3\\xB4"
        "otilde"    "\\xC3\\xB5"
        "ouml"      "\\xC3\\xB6"
        "divide"    "\\xC3\\xB7"
        "oslash"    "\\xC3\\xB8"
        "ugrave"    "\\xC3\\xB9"
        "uacute"    "\\xC3\\xBA"
        "ucirc"     "\\xC3\\xBB"
        "uuml"      "\\xC3\\xBC"
        "yacute"    "\\xC3\\xBD"
        "thorn"     "\\xC3\\xBE"
        "yuml"      "\\xC3\\xBF"
        "OElig"     "\\xC5\\x92"
        "oelig"     "\\xC5\\x93"
        "Scaron"    "\\xC5\\xA0"
        "scaron"    "\\xC5\\xA1"
        "Yuml"      "\\xC5\\xB8"
        "circ"      "\\xCB\\x86"
        "tilde"     "\\xCB\\x9C"
        "ensp"      "\\xE2\\x80\\x82"
        "emsp"      "\\xE2\\x80\\x83"
        "thinsp"    "\\xE2\\x80\\x89"
        "zwnj"      "\\xE2\\x81\\xB0"
        "zwj"       "\\xE2\\x80\\x8D"
        "lrm"       "\\xE2\\x80\\x8E"
        "rlm"       "\\xE2\\x80\\x8F"
        "ndash"     "\\xE2\\x80\\x93"
        "mdash"     "\\xE2\\x80\\x94"
        "lsquo"     "\\xE2\\x80\\x98"
        "rsquo"     "\\xE2\\x80\\x99"
        "sbquo"     "\\xE2\\x80\\x9A"
        "ldquo"     "\\xE2\\x80\\x9C"
        "rdquo"     "\\xE2\\x80\\x9D"
        "bdquo"     "\\xE2\\x80\\x9E"
        "dagger"    "\\xE2\\x80\\xA0"
        "Dagger"    "\\xE2\\x80\\xA1"
        "permil"    "\\xE2\\x80\\xB0"
        "lsaquo"    "\\xE2\\x80\\xB9"
        "rsaquo"    "\\xE2\\x80\\xBA"
        "euro"      "\\xE2\\x82\\xAC"
        "fnof"      "\\xC6\\x92"
        "Alpha"     "\\xCE\\x91"
        "Beta"      "\\xCE\\x92"
        "Gamma"     "\\xCE\\x93"
        "Delta"     "\\xCE\\x94"
        "Epsilon"   "\\xCE\\x95"
        "Zeta"      "\\xCE\\x96"
        "Eta"       "\\xCE\\x97"
        "Theta"     "\\xCE\\x98"
        "Iota"      "\\xCE\\x99"
        "Kappa"     "\\xCE\\x9A"
        "Lambda"    "\\xCE\\x9B"
        "Mu"        "\\xCE\\x9C"
        "Nu"        "\\xCE\\x9D"
        "Xi"        "\\xCE\\x9E"
        "Omicron"   "\\xCE\\x9F"
        "Pi"        "\\xCE\\xA0"
        "Rho"       "\\xCE\\xA1"
        "Sigma"     "\\xCE\\xA3"
        "Tau"       "\\xCE\\xA4"
        "Upsilon"   "\\xCE\\xA5"
        "Phi"       "\\xCE\\xA6"
        "Chi"       "\\xCE\\xA7"
        "Psi"       "\\xCE\\xA8"
        "Omega"     "\\xCE\\xA9"
        "alpha"     "\\xCE\\xB1"
        "beta"      "\\xCE\\xB2"
        "gamma"     "\\xCE\\xB3"
        "delta"     "\\xCE\\xB4"
        "epsilon"   "\\xCE\\xB5"
        "zeta"      "\\xCE\\xB6"
        "eta"       "\\xCE\\xB7"
        "theta"     "\\xCE\\xB8"
        "iota"      "\\xCE\\xB9"
        "kappa"     "\\xCE\\xBA"
        "lambda"    "\\xCE\\xBB"
        "mu"        "\\xCE\\xBC"
        "nu"        "\\xCE\\xBD"
        "xi"        "\\xCE\\xBE"
        "omicron"   "\\xCE\\xBF"
        "pi"        "\\xCF\\x80"
        "rho"       "\\xCF\\x81"
        "sigmaf"    "\\xCF\\x82"
        "sigma"     "\\xCF\\x83"
        "tau"       "\\xCF\\x84"
        "upsilon"   "\\xCF\\x85"
        "phi"       "\\xCF\\x86"
        "chi"       "\\xCF\\x87"
        "psi"       "\\xCF\\x88"
        "omega"     "\\xCF\\x89"
        "thetasym"  "\\xCF\\x91"
        "upsih"     "\\xCF\\x92"
        "piv"       "\\xCF\\x96"
        "bull"      "\\xE2\\x80\\xA2"
        "hellip"    "\\xE2\\x80\\xA6"
        "prime"     "\\xE2\\x80\\xB2"
        "Prime"     "\\xE2\\x80\\xB3"
        "oline"     "\\xE2\\x80\\xBE"
        "frasl"     "\\xE2\\x81\\x84"
        "weierp"    "\\xE2\\x84\\x98"
        "image"     "\\xE2\\x84\\x91"
        "real"      "\\xE2\\x84\\x9C"
        "trade"     "\\xE2\\x84\\xA2"
        "alefsym"   "\\xE2\\x84\\xB5"
        "larr"      "\\xE2\\x86\\x90"
        "uarr"      "\\xE2\\x86\\x91"
        "rarr"      "\\xE2\\x86\\x92"
        "darr"      "\\xE2\\x86\\x93"
        "harr"      "\\xE2\\x86\\x94"
        "crarr"     "\\xE2\\x86\\xB5"
        "lArr"      "\\xE2\\x87\\x90"
        "uArr"      "\\xE2\\x87\\x91"
        "rArr"      "\\xE2\\x87\\x92"
        "dArr"      "\\xE2\\x87\\x93"
        "hArr"      "\\xE2\\x87\\x94"
        "forall"    "\\xE2\\x88\\x80"
        "part"      "\\xE2\\x88\\x82"
        "exist"     "\\xE2\\x88\\x83"
        "empty"     "\\xE2\\x88\\x85"
        "nabla"     "\\xE2\\x88\\x87"
        "isin"      "\\xE2\\x88\\x88"
        "notin"     "\\xE2\\x88\\x89"
        "ni"        "\\xE2\\x88\\x8B"
        "prod"      "\\xE2\\x88\\x8F"
        "sum"       "\\xE2\\x88\\x91"
        "minus"     "\\xE2\\x88\\x92"
        "lowast"    "\\xE2\\x88\\x97"
        "radic"     "\\xE2\\x88\\x9A"
        "prop"      "\\xE2\\x88\\x9D"
        "infin"     "\\xE2\\x88\\x9E"
        "ang"       "\\xE2\\x88\\xA0"
        "and"       "\\xE2\\x88\\xA7"
        "or"        "\\xE2\\x88\\xA8"
        "cap"       "\\xE2\\x88\\xA9"
        "cup"       "\\xE2\\x88\\xAA"
        "int"       "\\xE2\\x88\\xAB"
        "there4"    "\\xE2\\x88\\xB4"
        "sim"       "\\xE2\\x88\\xBC"
        "cong"      "\\xE2\\x89\\x85"
        "asymp"     "\\xE2\\x89\\x88"
        "ne"        "\\xE2\\x89\\xA0"
        "equiv"     "\\xE2\\x89\\xA1"
        "le"        "\\xE2\\x89\\xA4"
        "ge"        "\\xE2\\x89\\xA5"
        "sub"       "\\xE2\\x8A\\x82"
        "sup"       "\\xE2\\x8A\\x83"
        "nsub"      "\\xE2\\x8A\\x84"
        "sube"      "\\xE2\\x8A\\x86"
        "supe"      "\\xE2\\x8A\\x87"
        "oplus"     "\\xE2\\x8A\\x95"
        "otimes"    "\\xE2\\x8A\\x97"
        "perp"      "\\xE2\\x8A\\xA5"
        "sdot"      "\\xE2\\x8B\\x85"
        "lceil"     "\\xE2\\x8C\\x88"
        "rceil"     "\\xE2\\x8C\\x89"
        "lfloor"    "\\xE2\\x8C\\x8A"
        "rfloor"    "\\xE2\\x8C\\x8B"
        "lang"      "\\xE2\\x8C\\xA9"
        "rang"      "\\xE2\\x8C\\xAA"
        "loz"       "\\xE2\\x97\\x8A"
        "spades"    "\\xE2\\x99\\xA0"
        "clubs"     "\\xE2\\x99\\xA3"
        "hearts"    "\\xE2\\x99\\xA5"
        "diams"     "\\xE2\\x99\\xA6"
    } {
        set html "<html><body>&$entity;</body></html>"
        set doc [dom parse -html $html]
        set root [$doc documentElement]
        set body [$root firstChild]
        if {[toutf8 [$body text]] ne [string tolower $byteseq]} {
            lappend result $entity [toutf8 [$body text]] [string tolower $byteseq]
        }
        $doc delete
    }
    set result
} ""


test html-2.1 {not closed p tags} {
    set doc [dom parse -html {
        <html><body><p>Para 1<p>Para 2<p>Para 3</body></html>
    }]
    set result [$doc asXML -indent none]
    $doc delete
199
200
201
202
203
204
205
206


207

208
209
210


211

212
213
214
215
216
217
218
</select></form></body>
</html>}

test html-3.1 {Bad data} {
    set data {line 6 column 17 - Warning: <script> lacks "type" attribute
line 10 column 17 - Warning: <script> lacks "type" attribute
        line 11 column 17 - Warning: <table> lacks "summary" attribute}
    catch {set doc [dom parse -html $data]}


} 1


test html-3.2 {Bad data} {
     catch {set doc [dom parse -html {<a>}]}


} 1

        
test html-4.1 {Tag name case normalization} {
    set doc [dom parse -html {<HtmL><boDY></BODy></HTml>}]
    set result [$doc asHTML]
    $doc delete
    set result
} {<html><body></body></html>}







|
>
>
|
>


|
>
>
|
>







483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
</select></form></body>
</html>}

test html-3.1 {Bad data} {
    set data {line 6 column 17 - Warning: <script> lacks "type" attribute
line 10 column 17 - Warning: <script> lacks "type" attribute
        line 11 column 17 - Warning: <table> lacks "summary" attribute}
    set doc [dom parse -html $data]
    set result [$doc asHTML]
    $doc delete
    set result
} {<html><script></script></html>}

test html-3.2 {Bad data} {
    set doc [dom parse -html {<a>}]
    set result [$doc asHTML]
    $doc delete
    set result
} {<html><a></a></html>}
        
test html-4.1 {Tag name case normalization} {
    set doc [dom parse -html {<HtmL><boDY></BODy></HTml>}]
    set result [$doc asHTML]
    $doc delete
    set result
} {<html><body></body></html>}
Changes to tests/i18n.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Features covered: international issues 
#
# Copyright (c) 2002 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

testConstraint beyondBMP [expr {[dom featureinfo TCL_UTF_MAX] > 3}]
testConstraint 8.6 [package vsatisfies [package present Tcl] 8.6]

test i18n-1.1 {parse utf-8 string} {need_i18n} {
    set russian "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
    set doc [dom parse "<test>$russian</test>"]
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}

test i18n-1.2 {parse utf-8 channel} {need_i18n} {
    set fd [open [file join [pwd] [file dir [info script]] data/i18n_1.xml]]
    fconfigure $fd -encoding utf-8
    set doc [dom parse -channel $fd]
    close $fd
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}
    
test i18n-1.3 {parse utf-8 readFile} {need_i18n} {
    set doc [dom parse [::tdom::xmlReadFile [file join [pwd] [file dir [info script]] data/i18n_1.xml]]]
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}
    











|








|










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Features covered: international issues 
#
# Copyright (c) 2002 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

testConstraint beyondBMP [expr {[dom featureinfo TCL_UTF_MAX] > 3}]
testConstraint 8.6 [package vsatisfies [package present Tcl] 8.6]

test i18n-1.1 {parse utf-8 string} {
    set russian "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
    set doc [dom parse "<test>$russian</test>"]
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}

test i18n-1.2 {parse utf-8 channel} {
    set fd [open [file join [pwd] [file dir [info script]] data/i18n_1.xml]]
    fconfigure $fd -encoding utf-8
    set doc [dom parse -channel $fd]
    close $fd
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}
    
test i18n-1.3 {parse utf-8 readFile} {
    set doc [dom parse [::tdom::xmlReadFile [file join [pwd] [file dir [info script]] data/i18n_1.xml]]]
    set root [$doc documentElement]
    set text [$root text]
    $doc delete
    string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439"
} {0}
    
Changes to tests/loadtdom.tcl.
1
2
3
4
5
6
7
8






9
10
11
12
13
14
15
16
17
18
19
20
# loadtdom.tcl --
#
# This file is [source]d by all.tcl and all test files, to ensure, that
# the tcltest package and the lastest tdom build is present.
#
# RCS: @(#) $Id$
#







package require tcltest
namespace import ::tcltest::*
if {[catch {package require -exact tdom 0.9.1}]} {
    if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.1.so]}]} {
        error "Unable to load the appropriate tDOM version!"
    }
}
if {[info commands ::tdom::xmlReadFile] == ""} {
    # tcldomsh without the script library. Source the lib.
    source [file join [file dir [info script]] ../lib tdom.tcl]
}









>
>
>
>
>
>
|

|
|







<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# loadtdom.tcl --
#
# This file is [source]d by all.tcl and all test files, to ensure, that
# the tcltest package and the lastest tdom build is present.
#
# RCS: @(#) $Id$
#

if {$tcl_version < 8.5} {
    # We still support 8.4 to some degree
    package require Tcl 8.4
} else {
    package require Tcl 8.4-
}
package require tcltest 2.2
namespace import ::tcltest::*
if {[catch {package require -exact tdom 0.9.2}]} {
    if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.2.so]}]} {
        error "Unable to load the appropriate tDOM version!"
    }
}
if {[info commands ::tdom::xmlReadFile] == ""} {
    # tcldomsh without the script library. Source the lib.
    source [file join [file dir [info script]] ../lib tdom.tcl]
}

Changes to tests/pullparser.test.
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
    pp delete
}

proc fdata {file} {
    file join [file dir [info script]] data/$file
}

test pp-2.1 {dom/pull comparsion: mondial-europe.xml} {
    comparewithDOM [fdata mondial-europe.xml] inputfile
} 1

test pp-2.2 {dom/pull comparsion: books.xml} {
    comparewithDOM [fdata books.xml] inputfile
} 1

test pp-2.3 {dom/pull comparsion: i18n_1.xml} {
    comparewithDOM [fdata i18n_1.xml] inputfile
} 1

test pp-2.4 {dom/pull comparsion: i18n_2.xml} {
    comparewithDOM [fdata i18n_2.xml] inputfile
} 1

test pp-2.5 {dom/pull comparsion: REC-xslt-19991116.xml} {
    comparewithDOM [fdata REC-xslt-19991116.xml] inputfile
} 1

test pp-2.6 {dom/pull comparsion: xslt_1.xsl} {
    comparewithDOM [fdata xslt_1.xsl] inputfile
} 1








|















|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
    pp delete
}

proc fdata {file} {
    file join [file dir [info script]] data/$file
}

test pp-2.1 {dom/pull comparsion: mondial-europe.xml} {longRunning} {
    comparewithDOM [fdata mondial-europe.xml] inputfile
} 1

test pp-2.2 {dom/pull comparsion: books.xml} {
    comparewithDOM [fdata books.xml] inputfile
} 1

test pp-2.3 {dom/pull comparsion: i18n_1.xml} {
    comparewithDOM [fdata i18n_1.xml] inputfile
} 1

test pp-2.4 {dom/pull comparsion: i18n_2.xml} {
    comparewithDOM [fdata i18n_2.xml] inputfile
} 1

test pp-2.5 {dom/pull comparsion: REC-xslt-19991116.xml} {longRunning} {
    comparewithDOM [fdata REC-xslt-19991116.xml] inputfile
} 1

test pp-2.6 {dom/pull comparsion: xslt_1.xsl} {
    comparewithDOM [fdata xslt_1.xsl] inputfile
} 1

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
        return 0
    }
    pushparser free
    pullparser delete
}


test pp-2.10 {expat/pull comparsion: mondial-europe.xml} {
    comparewithExpat [fdata mondial-europe.xml] file
} 1

test pp-2.11 {expat/pull comparsion: books.xml} {
    comparewithExpat [fdata books.xml] file
} 1

test pp-2.12 {expat/pull comparsion: i18n_1.xml} {
    comparewithExpat [fdata i18n_1.xml] file
} 1

test pp-2.13 {expat/pull comparsion: i18n_2.xml} {
    comparewithExpat [fdata i18n_2.xml] file
} 1

test pp-2.14 {expat/pull comparsion: REC-xslt-19991116.xml} {
    comparewithExpat [fdata REC-xslt-19991116.xml] file
} 1

test pp-2.15 {expat/pull comparsion: xslt_1.xsl} {
    comparewithExpat [fdata xslt_1.xsl] file
} 1








|















|







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
        return 0
    }
    pushparser free
    pullparser delete
}


test pp-2.10 {expat/pull comparsion: mondial-europe.xml} {longRunning} {
    comparewithExpat [fdata mondial-europe.xml] file
} 1

test pp-2.11 {expat/pull comparsion: books.xml} {
    comparewithExpat [fdata books.xml] file
} 1

test pp-2.12 {expat/pull comparsion: i18n_1.xml} {
    comparewithExpat [fdata i18n_1.xml] file
} 1

test pp-2.13 {expat/pull comparsion: i18n_2.xml} {
    comparewithExpat [fdata i18n_2.xml] file
} 1

test pp-2.14 {expat/pull comparsion: REC-xslt-19991116.xml} {longRunning} {
    comparewithExpat [fdata REC-xslt-19991116.xml] file
} 1

test pp-2.15 {expat/pull comparsion: xslt_1.xsl} {
    comparewithExpat [fdata xslt_1.xsl] file
} 1

Changes to tests/xmlsimple.test.
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
    set doc [dom parse -simple {<doc>&#65;&#x42;</doc>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} {AB}

test simple-2.3 {character entities} {need_i18n} {
    set doc [dom parse -simple {<doc>&#214;&#xC4;&#xc4;</doc>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"








|







195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
    set doc [dom parse -simple {<doc>&#65;&#x42;</doc>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} {AB}

test simple-2.3 {character entities} {
    set doc [dom parse -simple {<doc>&#214;&#xC4;&#xc4;</doc>}]
    set root [$doc documentElement]
    set result [$root text]
    $doc delete
    set result
} "\u00d6\u00c4\u00c4"

Changes to tests/xpath.test.
1304
1305
1306
1307
1308
1309
1310




























































1311
1312
1313
1314
1315
test xpath-7.9 {Attribute node as context node of an id() call} -setup {
    set doc [dom parse {<doc foo="bar"/>}]
} -body {
    $doc selectNodes {doc/@foo[id(.)]}
} -cleanup {
    $doc delete
} -result ""





























































# cleanup
::tcltest::cleanupTests
return








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
test xpath-7.9 {Attribute node as context node of an id() call} -setup {
    set doc [dom parse {<doc foo="bar"/>}]
} -body {
    $doc selectNodes {doc/@foo[id(.)]}
} -cleanup {
    $doc delete
} -result ""

test xpath-7.10 {processing-instruction with literal argument} -setup {
    set doc [dom parse {<h>
        <?mypi whatever?>
        <stuff>does not matter</stuff>
        </h>
    }]
} -body {
    $doc selectNodes //processing-instruction('dontexist')
} -cleanup {
    $doc delete
} -result {}

test xpath-7.11 {processing-instruction with literal argument} -setup {
    set doc [dom parse {<h>
        <?mypi whatever?>
        <stuff>does not matter</stuff>
        </h>
    }]
} -body {
    [$doc selectNodes //processing-instruction('mypi')] asXML -indent none
} -cleanup {
    $doc delete
} -result {<?mypi whatever?>}

test xpath-7.12 {string value of processing-instruction} -setup {
    set doc [dom parse {<h>
        <?mypi whatever?>
        <stuff>does not matter</stuff>
        </h>
    }]
} -body {
    $doc selectNodes string(//processing-instruction('mypi'))
} -cleanup {
    $doc delete
} -result {whatever}

test xpath-7.13 {string value of processing-instruction} -setup {
    set doc [dom parse {<h>
        <?mypi whatever  ?>
        <stuff>does not matter</stuff>
        </h>
    }]
} -body {
    $doc selectNodes string(//processing-instruction('mypi'))
} -cleanup {
    $doc delete
} -result "whatever  "

test xpath-7.14 {local-name value of processing-instruction} -setup {
    set doc [dom parse {<h>
        <?mypi whatever  ?>
        <stuff>does not matter</stuff>
        </h>
    }]
} -body {
    $doc selectNodes local-name(//processing-instruction('mypi'))
} -cleanup {
    $doc delete
} -result {mypi}

# cleanup
::tcltest::cleanupTests
return

Changes to tests/xslt.test.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
# Copyright (c) 2002 - 2005, 2013 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test xslt-1.1 {unicode chars outside of US-ASCII in var name} {need_i18n} {
     set xml [dom parse {<root/>}]
     set xslt [dom parse [tdom::xmlReadFile [file join [pwd] [file dir [info script]] data/xslt_1.xsl]]]
     set xmlroot [$xml documentElement]
     $xmlroot xslt $xslt resultDoc
     set resultroot [$resultDoc documentElement]
     set result [$resultroot asXML]
     $xml delete







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
# Copyright (c) 2002 - 2005, 2013 Rolf Ade.
#
# RCS: @(#) $Id$

source [file join [file dir [info script]] loadtdom.tcl]

test xslt-1.1 {unicode chars outside of US-ASCII in var name} {
     set xml [dom parse {<root/>}]
     set xslt [dom parse [tdom::xmlReadFile [file join [pwd] [file dir [info script]] data/xslt_1.xsl]]]
     set xmlroot [$xml documentElement]
     $xmlroot xslt $xslt resultDoc
     set resultroot [$resultDoc documentElement]
     set result [$resultroot asXML]
     $xml delete
Changes to unix/tclAppInit.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 2007 Rolf Ade ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   Main file for a standalone tclsh with tDOM build in ('big tclsh').
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 1.1 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*----------------------------------------------------------------------------
|   Copyright (c) 2007 Rolf Ade ([email protected])
+-----------------------------------------------------------------------------
|
|   $Id$
|
|
|   Main file for a standalone tclsh with tDOM build in ('big tclsh').
|
|   The contents of this file are subject to the Mozilla Public License
|   Version 2.0 (the "License"); you may not use this file except in
|   compliance with the License. You may obtain a copy of the License at
|   http://www.mozilla.org/MPL/
|
|   Software distributed under the License is distributed on an "AS IS"
|   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|   License for the specific language governing rights and limitations
|   under the License.
Changes to win/pkgIndex.tcl.
1
2
3
4
5
# tDOM Tcl package index file

package ifneeded tdom 0.9.1 \
    "[list load   [file join $dir tdom091[info sharedlibextension] ] tdom];\
     [list source [file join $dir tdom.tcl]]"



|

1
2
3
4
5
# tDOM Tcl package index file

package ifneeded tdom 0.9.1 \
    "[list load   [file join $dir tdom092[info sharedlibextension] ] tdom];\
     [list source [file join $dir tdom.tcl]]"
Changes to xe/xe.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/opt/tcl/bin/wish
#----------------------------------------------------------------------------
#   Copyright (c) 1999 - 2000  Jochen C. Loewer ([email protected])
#----------------------------------------------------------------------------
#
#   A XML/DOM/XPath evaluator/viewer... featuring the Tk text widget.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 1.1 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/opt/tcl/bin/wish
#----------------------------------------------------------------------------
#   Copyright (c) 1999 - 2000  Jochen C. Loewer ([email protected])
#----------------------------------------------------------------------------
#
#   A XML/DOM/XPath evaluator/viewer... featuring the Tk text widget.
#
#
#   The contents of this file are subject to the Mozilla Public License
#   Version 2.0 (the "License"); you may not use this file except in
#   compliance with the License. You may obtain a copy of the License at
#   http://www.mozilla.org/MPL/
#
#   Software distributed under the License is distributed on an "AS IS"
#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
#   License for the specific language governing rights and limitations
#   under the License.