Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Removed "support" for Tcl 8.0 - it probably doesn't even build any more. Eventually it's time prune out this #ifdefery. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | abandon80 |
Files: | files | file ages | folders |
SHA3-256: |
d729de4c396d71ffa68dcf0b1d4958a1 |
User & Date: | rolf 2018-05-02 15:12:19 |
Original Comment: | Remvoded "support" for Tcl 8.0 - it probably doesn't even build any more. Eventuallay it's time prune out this #ifdefery. |
2018-05-02
| ||
15:27 | More pruning. check-in: 731b463a74 user: rolf tags: abandon80 | |
15:12 | Removed "support" for Tcl 8.0 - it probably doesn't even build any more. Eventually it's time prune out this #ifdefery. check-in: d729de4c39 user: rolf tags: abandon80 | |
10:03 | Fixed editing error. check-in: cb72ce2fdf user: rolf tags: trunk | |
Changes to configure.
︙ | ︙ | |||
5573 5574 5575 5576 5577 5578 5579 | # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="generic/xmlsimple.c \ | < | 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 | # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="generic/xmlsimple.c \ generic/dom.c \ generic/domhtml.c \ generic/domhtml5.c \ generic/domjson.c \ generic/domxpath.c \ generic/domxslt.c \ generic/domlock.c \ |
︙ | ︙ |
Deleted configure-tcl8.0.5.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to configure.in.
︙ | ︙ | |||
92 93 94 95 96 97 98 | # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([generic/xmlsimple.c \ | < | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([generic/xmlsimple.c \ generic/dom.c \ generic/domhtml.c \ generic/domhtml5.c \ generic/domjson.c \ generic/domxpath.c \ generic/domxslt.c \ generic/domlock.c \ |
︙ | ︙ |
Changes to doc/dom.html.
︙ | ︙ | |||
333 334 335 336 337 338 339 | <dt> <b class="cmd">dom</b> <b class="method">createDocumentNode</b> ?<i class="m">objVar</i>?</dt> <dd>Creates a new 'empty' DOM document object without any element node. <i class="m">objVar</i> controls the memory handling as explained above.</dd> | < < < < < < < < < < < < < < < < < < < | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | <dt> <b class="cmd">dom</b> <b class="method">createDocumentNode</b> ?<i class="m">objVar</i>?</dt> <dd>Creates a new 'empty' DOM document object without any element node. <i class="m">objVar</i> controls the memory handling as explained above.</dd> <dt> <b class="cmd">dom</b> <b class="method">createNodeCmd</b> <i class="m">?-returnNodeCmd?</i> <i class="m">?-tagName name?</i> <i class="m">?-jsonType jsonType?</i> <i class="m">?-namespace URI?</i> <i class="m">(element|comment|text|cdata|pi)Node</i> <i class="m">commandName</i> </dt> <dd>This method creates Tcl commands, which in turn create tDOM nodes. Tcl commands created by this command are only available inside a script given to the domNode methods |
︙ | ︙ |
Changes to doc/dom.n.
︙ | ︙ | |||
417 418 419 420 421 422 423 | document element to create. The \fIobjVar\fR controls the memory handling as explained above. .TP \&\fB\fBdom\fP \fBcreateDocumentNode\fP ?\fIobjVar\fB? \&\fRCreates a new 'empty' DOM document object without any element node. \fIobjVar\fR controls the memory handling as explained above. .TP | < < < < < < < < < < < < < < < | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | document element to create. The \fIobjVar\fR controls the memory handling as explained above. .TP \&\fB\fBdom\fP \fBcreateDocumentNode\fP ?\fIobjVar\fB? \&\fRCreates a new 'empty' DOM document object without any element node. \fIobjVar\fR controls the memory handling as explained above. .TP \&\fB\fBdom\fP \fBcreateNodeCmd\fP \fI?-returnNodeCmd?\fB \fI?-tagName name?\fB \fI?-jsonType jsonType?\fB \fI?-namespace URI?\fB \fI(element|comment|text|cdata|pi)Node\fB \fIcommandName\fB \&\fRThis method creates Tcl commands, which in turn create tDOM nodes. Tcl commands created by this command are only available inside a script given to the domNode methods \&\fIappendFromScript\fR or \fIinsertBeforeFromScript\fR. If a command created with \fIcreateNodeCmd\fR is invoked in any other context, it will return error. The created command |
︙ | ︙ |
Changes to doc/dom.xml.
︙ | ︙ | |||
323 324 325 326 327 328 329 | <commanddef> <command><cmd>dom</cmd> <method>createDocumentNode</method> ?<m>objVar</m>?</command> <desc>Creates a new 'empty' DOM document object without any element node. <m>objVar</m> controls the memory handling as explained above.</desc> </commanddef> | < < < < < < < < < < < < < < < < < | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | <commanddef> <command><cmd>dom</cmd> <method>createDocumentNode</method> ?<m>objVar</m>?</command> <desc>Creates a new 'empty' DOM document object without any element node. <m>objVar</m> controls the memory handling as explained above.</desc> </commanddef> <commanddef> <command><cmd>dom</cmd> <method>createNodeCmd</method> <m>?-returnNodeCmd?</m> <m>?-tagName name?</m> <m>?-jsonType jsonType?</m> <m>?-namespace URI?</m> <m>(element|comment|text|cdata|pi)Node</m> <m>commandName</m></command> <desc>This method creates Tcl commands, which in turn create tDOM nodes. Tcl commands created by this command are only available inside a script given to the domNode methods <m>appendFromScript</m> or <m>insertBeforeFromScript</m>. If |
︙ | ︙ |
Changes to doc/tdomcmd.html.
︙ | ︙ | |||
39 40 41 42 43 44 45 | <dt> <b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">getdoc</b> </dt> <dd><p>Returns the DOM tree as domDoc (see there) object.</p></dd> | < < < < < < < < < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | <dt> <b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">getdoc</b> </dt> <dd><p>Returns the DOM tree as domDoc (see there) object.</p></dd> <dt> <b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setStoreLineColumn</b> ?<i class="m">boolean</i>?</dt> <dd><p>See the method <tt class="samp">setStoreLineColumn</tt> of the <b class="cmd">dom</b> command.</p></dd> |
︙ | ︙ |
Changes to doc/tdomcmd.n.
︙ | ︙ | |||
191 192 193 194 195 196 197 | .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBgetdoc\fP \&\fR .RS .PP Returns the DOM tree as domDoc (see there) object. .RE | < < < < < < < < | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBgetdoc\fP \&\fR .RS .PP Returns the DOM tree as domDoc (see there) object. .RE .TP \&\fB\fBtdom\fP \fIparserObj\fB \fBsetStoreLineColumn\fP ?\fIboolean\fB? \&\fR .RS .PP See the method \fBsetStoreLineColumn\fR of the \&\fBdom\fP command. |
︙ | ︙ |
Changes to doc/tdomcmd.xml.
︙ | ︙ | |||
36 37 38 39 40 41 42 | <commanddef> <command><cmd>tdom</cmd> <m>parserObj</m> <method>getdoc</method></command> <desc><p>Returns the DOM tree as domDoc (see there) object.</p></desc> </commanddef> | < < < < < < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <commanddef> <command><cmd>tdom</cmd> <m>parserObj</m> <method>getdoc</method></command> <desc><p>Returns the DOM tree as domDoc (see there) object.</p></desc> </commanddef> <commanddef> <command><cmd>tdom</cmd> <m>parserObj</m> <method>setStoreLineColumn</method> ?<m>boolean</m>?</command> <desc><p>See the method <samp>setStoreLineColumn</samp> of the <cmd>dom</cmd> command.</p></desc> </commanddef> |
︙ | ︙ |
Deleted encodings/GenCompactCodings.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/ascii.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1250.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1251.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1252.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1253.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1254.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1255.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp1256.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp437.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/cp850.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-1.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-2.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-3.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-4.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-5.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-6.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-7.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-8.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/iso8859-9.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Deleted encodings/koi8-r.enc.
|
| < < < < < < < < < < < < < < < < < < < < |
Changes to generic/dom.c.
︙ | ︙ | |||
43 44 45 46 47 48 49 | /*--------------------------------------------------------------------------- | Includes | \--------------------------------------------------------------------------*/ #include <tcl.h> | < < < | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | /*--------------------------------------------------------------------------- | Includes | \--------------------------------------------------------------------------*/ #include <tcl.h> #include <dom.h> #include <domxpath.h> #include <tclexpat.h> /* #define DEBUG */ /*---------------------------------------------------------------------------- | Debug Macros | |
︙ | ︙ | |||
110 111 112 113 114 115 116 | "INUSE_ATTRIBUTE_ERR" }; static char tdom_usage[] = "Usage tdom <expat parser obj> <subCommand>, where subCommand can be:\n" " enable \n" " getdoc \n" | < | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | "INUSE_ATTRIBUTE_ERR" }; static char tdom_usage[] = "Usage tdom <expat parser obj> <subCommand>, where subCommand can be:\n" " enable \n" " getdoc \n" " setStoreLineColumn \n" ; /*--------------------------------------------------------------------------- | type domActiveNS | |
︙ | ︙ | |||
150 151 152 153 154 155 156 | XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; int cdataSection; Tcl_DString *cdata; | < | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; int cdataSection; Tcl_DString *cdata; int storeLineColumn; int ignorexmlns; int feedbackAfter; Tcl_Obj *feedbackCmd; XML_Index nextFeedbackPosition; Tcl_Interp *interp; int activeNSsize; |
︙ | ︙ | |||
1245 1246 1247 1248 1249 1250 1251 | memset(attrnode, 0, sizeof(domAttrNode)); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = IS_NS_NODE; attrnode->namespace = ns->index; attrnode->nodeName = (char *)&(h->key); attrnode->parentNode = node; len = strlen(atPtr[1]); | < < < | 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | memset(attrnode, 0, sizeof(domAttrNode)); attrnode->nodeType = ATTRIBUTE_NODE; attrnode->nodeFlags = IS_NS_NODE; attrnode->namespace = ns->index; attrnode->nodeName = (char *)&(h->key); attrnode->parentNode = node; len = strlen(atPtr[1]); attrnode->valueLength = len; attrnode->nodeValue = (char*)MALLOC(len+1); strcpy(attrnode->nodeValue, atPtr[1]); if (node->firstAttr) { lastAttr->nextSibling = attrnode; } else { node->firstAttr = attrnode; |
︙ | ︙ | |||
1353 1354 1355 1356 1357 1358 1359 | } else { attrnode->nodeFlags = 0; } attrnode->namespace = 0; attrnode->nodeName = (char *)&(h->key); attrnode->parentNode = node; len = strlen(atPtr[1]); | < < < | 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 | } 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]); if (node->firstAttr) { lastAttr->nextSibling = attrnode; } else { |
︙ | ︙ | |||
1510 1511 1512 1513 1514 1515 1516 | char *s; int len, hnew; len = Tcl_DStringLength (info->cdata); if (!len && !info->cdataSection) return; s = Tcl_DStringValue (info->cdata); | < < < | 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 | char *s; int len, hnew; len = Tcl_DStringLength (info->cdata); if (!len && !info->cdataSection) return; s = Tcl_DStringValue (info->cdata); parentNode = info->currentNode; if (!parentNode) return; if ( parentNode->lastChild && parentNode->lastChild->nodeType == TEXT_NODE && !info->cdataSection) { |
︙ | ︙ | |||
1622 1623 1624 1625 1626 1627 1628 | DBG(fprintf (stderr, "commentHandler: insideDTD, skipping\n");) return; } DispatchPCDATA (info); len = strlen(s); | < < < | 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 | DBG(fprintf (stderr, "commentHandler: insideDTD, skipping\n");) return; } DispatchPCDATA (info); len = strlen(s); parentNode = info->currentNode; if (info->storeLineColumn) { node = (domTextNode*) domAlloc(sizeof(domTextNode) + sizeof(domLineColumn)); } else { node = (domTextNode*) domAlloc(sizeof(domTextNode)); |
︙ | ︙ | |||
1731 1732 1733 1734 1735 1736 1737 | (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; } len = strlen(target); | < < < < < < | 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 | (char*) node, &hnew); Tcl_SetHashValue (h, tdomstrdup (XML_GetBase (info->parser))); node->nodeFlags |= HAS_BASEURI; } len = strlen(target); node->targetLength = len; node->targetValue = (char*)MALLOC(len); memmove(node->targetValue, target, len); len = strlen(data); node->dataLength = len; node->dataValue = (char*)MALLOC(len); memmove(node->dataValue, data, len); node->ownerDocument = info->document; node->parentNode = parentNode; if (parentNode == NULL) { |
︙ | ︙ | |||
1881 1882 1883 1884 1885 1886 1887 | Tcl_NewStringObj(publicId, strlen(publicId))); } else { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewObj()); } | < < < < | 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 | Tcl_NewStringObj(publicId, strlen(publicId))); } else { Tcl_ListObjAppendElement(info->interp, cmdPtr, Tcl_NewObj()); } result = Tcl_EvalObjEx (info->interp, cmdPtr, TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL); Tcl_DecrRefCount(cmdPtr); if (result != TCL_OK) { info->status = result; return 0; } |
︙ | ︙ | |||
2128 2129 2130 2131 2132 2133 2134 | domDocument * domReadDocument ( XML_Parser parser, char *xml, int length, int ignoreWhiteSpaces, int keepCDATA, | < < < < | 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 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 | domDocument * domReadDocument ( XML_Parser parser, char *xml, int length, int ignoreWhiteSpaces, int keepCDATA, int storeLineColumn, int ignorexmlns, int feedbackAfter, Tcl_Obj *feedbackCmd, Tcl_Channel channel, const char *baseurl, Tcl_Obj *extResolver, int useForeignDTD, int paramEntityParsing, Tcl_Interp *interp, int *resultcode ) { int done, tclLen; enum XML_Status status; size_t len; domReadInfo info; char buf[8192]; Tcl_Obj *bufObj; Tcl_DString dStr; int useBinary; char *str; domDocument *doc = domCreateDoc(baseurl, storeLineColumn); if (extResolver) { doc->extResolver = tdomstrdup (Tcl_GetString (extResolver)); } if (ignorexmlns) { doc->nodeFlags |= IGNORE_XMLNS; } info.parser = parser; info.document = doc; info.currentNode = NULL; info.depth = 0; info.ignoreWhiteSpaces = ignoreWhiteSpaces; info.cdata = (Tcl_DString*) MALLOC (sizeof (Tcl_DString)); Tcl_DStringInit (info.cdata); info.cdataSection = 0; info.storeLineColumn = storeLineColumn; info.ignorexmlns = ignorexmlns; info.feedbackAfter = feedbackAfter; info.feedbackCmd = feedbackCmd; info.nextFeedbackPosition = feedbackAfter; info.interp = interp; info.activeNSpos = -1; |
︙ | ︙ | |||
2234 2235 2236 2237 2238 2239 2240 | domFreeDocument (doc, NULL, NULL); *resultcode = info.status; return NULL; case XML_STATUS_OK: break; } } else { | < | 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 | domFreeDocument (doc, NULL, NULL); *resultcode = info.status; return NULL; case XML_STATUS_OK: break; } } else { Tcl_DStringInit (&dStr); if (Tcl_GetChannelOption (interp, channel, "-encoding", &dStr) != TCL_OK) { FREE ( (char*) info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domFreeDocument (doc, NULL, NULL); |
︙ | ︙ | |||
2304 2305 2306 2307 2308 2309 2310 | return NULL; case XML_STATUS_OK: break; } } while (!done); Tcl_DecrRefCount (bufObj); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 | return NULL; case XML_STATUS_OK: break; } } while (!done); Tcl_DecrRefCount (bufObj); } } FREE ( info.activeNS ); FREE ( info.baseURIstack ); Tcl_DStringFree (info.cdata); FREE ( info.cdata); domSetDocumentElement (doc); |
︙ | ︙ | |||
5204 5205 5206 5207 5208 5209 5210 | XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; int cdataSection; Tcl_DString *cdata; | < | 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 | XML_Parser parser; domDocument *document; domNode *currentNode; int depth; int ignoreWhiteSpaces; int cdataSection; Tcl_DString *cdata; int storeLineColumn; int ignorexmlns; int feedbackAfter; Tcl_Obj *feedbackCmd; int nextFeedbackPosition; Tcl_Interp *interp; int activeNSsize; |
︙ | ︙ | |||
5336 5337 5338 5339 5340 5341 5342 | int TclTdomObjCmd (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *const objv[]; { | < < | | | 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 | int TclTdomObjCmd (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; Tcl_Obj *const objv[]; { CHandlerSet *handlerSet; int methodIndex, result, bool; tdomCmdReadInfo *info; TclGenExpatInfo *expat; Tcl_Obj *newObjName = NULL; static const char *tdomMethods[] = { "enable", "getdoc", "setStoreLineColumn", "setExternalEntityResolver", "keepEmpties", "remove", "ignorexmlns", "keepCDATA", NULL }; enum tdomMethod { m_enable, m_getdoc, m_setStoreLineColumn, m_setExternalEntityResolver, m_keepEmpties, m_remove, m_ignorexmlns, m_keepCDATA }; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs (interp, 1, objv, tdom_usage); return TCL_ERROR; |
︙ | ︙ | |||
5414 5415 5416 5417 5418 5419 5420 | info->document = NULL; info->currentNode = NULL; info->depth = 0; info->ignoreWhiteSpaces = 1; info->cdataSection = 0; info->cdata = (Tcl_DString*) MALLOC (sizeof (Tcl_DString)); Tcl_DStringInit (info->cdata); | < | 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 | info->document = NULL; info->currentNode = NULL; info->depth = 0; info->ignoreWhiteSpaces = 1; info->cdataSection = 0; info->cdata = (Tcl_DString*) MALLOC (sizeof (Tcl_DString)); Tcl_DStringInit (info->cdata); info->storeLineColumn = 0; info->ignorexmlns = 0; info->feedbackAfter = 0; info->feedbackCmd = NULL; info->nextFeedbackPosition = 0; info->interp = interp; info->activeNSpos = -1; |
︙ | ︙ | |||
5455 5456 5457 5458 5459 5460 5461 | } domSetDocumentElement (info->document); result = tcldom_returnDocumentObj (interp, info->document, 0, newObjName, 0, 0); info->document = NULL; return result; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 | } domSetDocumentElement (info->document); result = tcldom_returnDocumentObj (interp, info->document, 0, newObjName, 0, 0); info->document = NULL; return result; case m_setStoreLineColumn: info = CHandlerSetGetUserData (interp, objv[1], "tdom"); if (!info) { Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL); return TCL_ERROR; } Tcl_SetIntObj (Tcl_GetObjResult (interp), info->storeLineColumn); |
︙ | ︙ |
Changes to generic/dom.h.
︙ | ︙ | |||
33 34 35 36 37 38 39 | | \--------------------------------------------------------------------------*/ #ifndef __DOM_H__ #define __DOM_H__ #include <tcl.h> | | | | > | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | | \--------------------------------------------------------------------------*/ #ifndef __DOM_H__ #define __DOM_H__ #include <tcl.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <expat.h> #include <domalloc.h> /* * tDOM provides it's own memory allocator which is optimized for * low heap usage. It uses the native Tcl allocator underneath, * though, but it is not very MT-friendly. Therefore, you might * use the (normal) Tcl allocator with USE_NORMAL_ALLOCATOR |
︙ | ︙ | |||
132 133 134 135 136 137 138 | #define DOC_CMD(s,doc) sprintf((s), "domDoc%p", (doc)) #define NODE_CMD(s,node) sprintf((s), "domNode%p", (node)) #define XSLT_CMD(s,doc) sprintf((s), "XSLTcmd%p", (doc)) #define XML_NAMESPACE "http://www.w3.org/XML/1998/namespace" #define XMLNS_NAMESPACE "http://www.w3.org/2000/xmlns" | < < < < < < < < < < | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | #define DOC_CMD(s,doc) sprintf((s), "domDoc%p", (doc)) #define NODE_CMD(s,node) sprintf((s), "domNode%p", (node)) #define XSLT_CMD(s,doc) sprintf((s), "XSLTcmd%p", (doc)) #define XML_NAMESPACE "http://www.w3.org/XML/1998/namespace" #define XMLNS_NAMESPACE "http://www.w3.org/2000/xmlns" #define UTF8_1BYTE_CHAR(c) ( 0 == ((c) & 0x80)) #define UTF8_2BYTE_CHAR(c) ( 0xC0 == ((c) & 0xE0)) #define UTF8_3BYTE_CHAR(c) ( 0xE0 == ((c) & 0xF0)) #define UTF8_4BYTE_CHAR(c) ( 0xF0 == ((c) & 0xF8)) #define UTF8_CHAR_LEN(c) \ UTF8_1BYTE_CHAR((c)) ? 1 : \ (UTF8_2BYTE_CHAR((c)) ? 2 : \ (UTF8_3BYTE_CHAR((c)) ? 3 : \ (UTF8_4BYTE_CHAR((c)) ? 4 : 0))) /* The following 2 defines are out of the expat code */ /* A 2 byte UTF-8 representation splits the characters 11 bits between the bottom 5 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ |
︙ | ︙ | |||
213 214 215 216 217 218 219 | ? NCnameStart7Bit[(int)(*(p))] \ : ((n) == 2 \ ? UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)(p)) \ : ((n) == 3 \ ? UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)(p)) \ : 0))) | < < < < | | < | 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 | ? NCnameStart7Bit[(int)(*(p))] \ : ((n) == 2 \ ? UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)(p)) \ : ((n) == 3 \ ? UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)(p)) \ : 0))) #define UTF8_XMLCHAR3(p) \ (*(p) == 0xED \ ? ((p)[1] < 0xA0 ? 1 : 0) \ : (*(p) == 0xEF \ ? ((p)[1] == 0xBF \ ? ((p)[2] == 0xBE || (p)[2] == 0xBF ? 0 : 1) \ : 1) \ : 1)) \ /* This definition is lax in the sense, that it accepts every 4 byte * utf-8 character beyond #xFFFF as valid, no matter, if Unicode has * (so far) defined a character for that encoding point. Additionally, * this define does not care about the discouraged characters beyond * #xFFFF (but after all, they are only discouraged, not * forbidden). */ #define UTF8_XMLCHAR(p, n) \ ((n) == 1 \ ? CharBit[(int)(*(p))] \ : ((n) == 2 \ ? 1 \ : ((n) == 3 \ ? (UTF8_XMLCHAR3(p)) \ : ((n) == 4 \ ? 1 : 0)))) #include "../expat/nametab.h" static const unsigned char nameChar7Bit[] = { /* 0x00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
︙ | ︙ | |||
343 344 345 346 347 348 349 | /* 0x60 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x68 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x70 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x78 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, }; | < < < < < < | | | | < | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | /* 0x60 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x68 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x70 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* 0x78 */ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, }; #define isNameStart(x) UTF8_GET_NAME_START((x),UTF8_CHAR_LEN(*(x))) #define isNCNameStart(x) UTF8_GET_NCNAME_START((x),UTF8_CHAR_LEN(*(x))) #define isNameChar(x) UTF8_GET_NAMING_NMTOKEN((x),UTF8_CHAR_LEN(*(x))) #define isNCNameChar(x) UTF8_GET_NAMING_NCNMTOKEN((x),UTF8_CHAR_LEN(*(x))) #define IS_XML_WHITESPACE(c) ((c)==' ' || (c)=='\n' || (c)=='\r' || (c)=='\t') /*-------------------------------------------------------------------------- | DOMString | \-------------------------------------------------------------------------*/ |
︙ | ︙ | |||
728 729 730 731 732 733 734 | void domSetDocumentElement (domDocument *doc); domDocument * domReadDocument (XML_Parser parser, char *xml, int length, int ignoreWhiteSpaces, int keepCDATA, | < | 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | void domSetDocumentElement (domDocument *doc); domDocument * domReadDocument (XML_Parser parser, char *xml, int length, int ignoreWhiteSpaces, int keepCDATA, int storeLineColumn, int ignoreXMLNS, int feedbackAfter, Tcl_Obj *feedbackCmd, Tcl_Channel channel, const char *baseurl, Tcl_Obj *extResolver, |
︙ | ︙ |
Changes to generic/domhtml.c.
︙ | ︙ | |||
96 97 98 99 100 101 102 | /*---------------------------------------------------------------------------- | The size of the hash table. For best results this should | be a prime number which is about the same size as the number of | character entity references known to the system. | \---------------------------------------------------------------------------*/ | < < < < | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | /*---------------------------------------------------------------------------- | The size of the hash table. For best results this should | be a prime number which is about the same size as the number of | character entity references known to the system. | \---------------------------------------------------------------------------*/ #define ER_HASH_SIZE 257 /*---------------------------------------------------------------------------- | The following flag is TRUE if entity reference hash table needs | to be initialized. | \---------------------------------------------------------------------------*/ static int bErNeedsInit = 1; |
︙ | ︙ | |||
161 162 163 164 165 166 167 | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, { "nbsp", "\xC2\xA0", 0 }, { "iexcl", "\xC2\xA1", 0 }, { "cent", "\xC2\xA2", 0 }, { "pound", "\xC2\xA3", 0 }, { "curren", "\xC2\xA4", 0 }, { "yen", "\xC2\xA5", 0 }, { "brvbar", "\xC2\xA6", 0 }, |
︙ | ︙ | |||
509 510 511 512 513 514 515 | { "lang", "\xE2\x8C\xA9", 0 }, { "rang", "\xE2\x8C\xAA", 0 }, { "loz", "\xE2\x97\x8A", 0 }, { "spades", "\xE2\x99\xA0", 0 }, { "clubs", "\xE2\x99\xA3", 0 }, { "hearts", "\xE2\x99\xA5", 0 }, { "diams", "\xE2\x99\xA6", 0 }, | < | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | { "lang", "\xE2\x8C\xA9", 0 }, { "rang", "\xE2\x8C\xAA", 0 }, { "loz", "\xE2\x97\x8A", 0 }, { "spades", "\xE2\x99\xA0", 0 }, { "clubs", "\xE2\x99\xA3", 0 }, { "hearts", "\xE2\x99\xA5", 0 }, { "diams", "\xE2\x99\xA6", 0 }, }; /*---------------------------------------------------------------------------- | ErInit -- | | Initialize the entity reference hash table |
︙ | ︙ | |||
639 640 641 642 643 644 645 | */ int j; for (j = from; j < i; j++) { z[to++] = z[j]; } from = i; } else { | < < < < | 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 | */ int j; for (j = from; j < i; j++) { z[to++] = z[j]; } from = i; } else { if (value < 0x80) { z[to++] = value; } else if (value <= 0x7FF) { z[to++] = (char) ((value >> 6) | 0xC0); z[to++] = (char) ((value | 0x80) & 0xBF); } else if (value <= 0xFFFF) { z[to++] = (char) ((value >> 12) | 0xE0); z[to++] = (char) (((value >> 6) | 0x80) & 0xBF); z[to++] = (char) ((value | 0x80) & 0xBF); } else { /* error */ } from = i+1; } } else { while (z[i] && isalpha((unsigned char)z[i])) { i++; } c = z[i]; |
︙ | ︙ |
Changes to generic/domxpath.c.
︙ | ︙ | |||
2854 2855 2856 2857 2858 2859 2860 | Tcl_HashTable *ids; Tcl_HashEntry *entryPtr; int left = 0; double dRight = 0.0; char *leftStr = NULL, *rightStr = NULL; const char *str; Tcl_DString dStr; | < < < < | 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 | Tcl_HashTable *ids; Tcl_HashEntry *entryPtr; int left = 0; double dRight = 0.0; char *leftStr = NULL, *rightStr = NULL; const char *str; Tcl_DString dStr; int found, j; int lenstr, fromlen, utfCharLen; char utfBuf[TCL_UTF_MAX]; Tcl_DString tstr, tfrom, tto, tresult; Tcl_UniChar *ufStr, *upfrom, unichar; switch (step->intvalue) { case f_position: XPATH_ARITYCHECK(step,0,errMsg); if (*docOrder) { rsSetInt (result, position+1); |
︙ | ︙ | |||
2979 2980 2981 2982 2983 2984 2985 | leftStr = xpathFuncString (&leftResult ); xpathRSFree( &leftResult ); DBG(fprintf(stderr, "leftStr='%s'\n", leftStr);) if (step->intvalue == f_string) rsSetString (result, leftStr); else if (step->intvalue == f_stringLength) { | < < < < | 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 | leftStr = xpathFuncString (&leftResult ); xpathRSFree( &leftResult ); DBG(fprintf(stderr, "leftStr='%s'\n", leftStr);) if (step->intvalue == f_string) rsSetString (result, leftStr); else if (step->intvalue == f_stringLength) { pto = leftStr; len = 0; while (*pto) { len++; i = UTF8_CHAR_LEN (*pto); if (!i) { FREE (leftStr); *errMsg = tdomstrdup("Can only handle UTF-8 chars up " "to 4 bytes length"); return XPATH_I18N_ERR; } pto += i; } rsSetInt (result, len); } else { pwhite = 1; pfrom = pto = leftStr; while (*pfrom) { switch (*pfrom) { case ' ' : case '\n': case '\r': case '\t': |
︙ | ︙ | |||
3404 3405 3406 3407 3408 3409 3410 | rsSetString (result, ""); return XPATH_OK; } from = 0; } } else { if (from < 0) from = 0; | < < < < < < < < < < < < < < < < < < < < < | 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 | rsSetString (result, ""); return XPATH_OK; } from = 0; } } else { if (from < 0) from = 0; len = INT_MAX; } pfrom = leftStr; while (*pfrom && (from > 0)) { i = UTF8_CHAR_LEN (*pfrom); if (!i) { FREE (leftStr); *errMsg = tdomstrdup("Can only handle UTF-8 chars up " "to 4 bytes length"); |
︙ | ︙ | |||
3456 3457 3458 3459 3460 3461 3462 | } pto += i; len--; } *pto = '\0'; } rsSetString (result, pfrom); | < | 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 | } pto += i; len--; } *pto = '\0'; } rsSetString (result, pfrom); FREE(leftStr); break; case f_translate: XPATH_ARITYCHECK(step,3,errMsg); xpathRSInit (&leftResult); savedDocOrder = *docOrder; |
︙ | ︙ | |||
3484 3485 3486 3487 3488 3489 3490 | CHECK_RC; *docOrder = savedDocOrder; leftStr = xpathFuncString( &leftResult ); rightStr = xpathFuncString( &rightResult ); replaceStr = xpathFuncString( &replaceResult ); | < < < < < < < < < < < < < < < < < < | 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 | CHECK_RC; *docOrder = savedDocOrder; leftStr = xpathFuncString( &leftResult ); rightStr = xpathFuncString( &rightResult ); replaceStr = xpathFuncString( &replaceResult ); Tcl_DStringInit (&tstr); Tcl_DStringInit (&tfrom); Tcl_DStringInit (&tto); Tcl_DStringInit (&tresult); Tcl_UtfToUniCharDString (leftStr, -1, &tstr); Tcl_UtfToUniCharDString (rightStr, -1, &tfrom); |
︙ | ︙ | |||
3543 3544 3545 3546 3547 3548 3549 | upfrom++; } rsSetString (result, Tcl_DStringValue (&tresult)); Tcl_DStringFree (&tstr); Tcl_DStringFree (&tfrom); Tcl_DStringFree (&tto); Tcl_DStringFree (&tresult); | < | 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 | upfrom++; } rsSetString (result, Tcl_DStringValue (&tresult)); Tcl_DStringFree (&tstr); Tcl_DStringFree (&tfrom); Tcl_DStringFree (&tto); Tcl_DStringFree (&tresult); xpathRSFree( &replaceResult ); xpathRSFree( &rightResult ); xpathRSFree( &leftResult ); FREE(leftStr); FREE(rightStr); FREE(replaceStr); break; |
︙ | ︙ |
Changes to generic/domxslt.c.
︙ | ︙ | |||
45 46 47 48 49 50 51 | /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include <stdio.h> | < < < | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include <stdio.h> #include <math.h> #include <limits.h> #include <locale.h> #include <dom.h> #include <domxpath.h> #include <domxslt.h> #include <tcl.h> /* for hash tables */ /*---------------------------------------------------------------------------- |
︙ | ︙ | |||
300 301 302 303 304 305 306 | /*-------------------------------------------------------------------------- | xsltDecimalFormat | \-------------------------------------------------------------------------*/ typedef struct xsltDecimalFormat { | < < < < < < < < < < < < < < | 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 | /*-------------------------------------------------------------------------- | xsltDecimalFormat | \-------------------------------------------------------------------------*/ typedef struct xsltDecimalFormat { char * name; char * uri; Tcl_UniChar decimalSeparator; Tcl_UniChar groupingSeparator; char * infinity; Tcl_UniChar minusSign; char * NaN; Tcl_UniChar percent; Tcl_UniChar perMille; Tcl_UniChar zeroDigit; Tcl_UniChar digit; Tcl_UniChar patternSeparator; struct xsltDecimalFormat * next; } xsltDecimalFormat; /*-------------------------------------------------------------------------- |
︙ | ︙ | |||
1112 1113 1114 1115 1116 1117 1118 | return; } /*---------------------------------------------------------------------------- | xsltFormatNumber | \---------------------------------------------------------------------------*/ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 | return; } /*---------------------------------------------------------------------------- | xsltFormatNumber | \---------------------------------------------------------------------------*/ static int addCurrencySymbol ( Tcl_UniChar *p, Tcl_UniChar *result, int *i ) { Tcl_DString dStr; |
︙ | ︙ | |||
1746 1747 1748 1749 1750 1751 1752 | return 0; xsltFormatNumberError: Tcl_DStringFree (&dStr); Tcl_DStringFree (&s); return -1; } | < < < | 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | return 0; xsltFormatNumberError: Tcl_DStringFree (&dStr); Tcl_DStringFree (&s); return -1; } static xsltNodeSet * createXsltNodeSet (void) { xsltNodeSet * ns; ns = (xsltNodeSet *) MALLOC (sizeof(xsltNodeSet)); |
︙ | ︙ | |||
2519 2520 2521 2522 2523 2524 2525 | char * strB, double realA, double realB, int * greater ) { int rc; | < < < < < < < < < < < < < < | 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 | char * strB, double realA, double realB, int * greater ) { int rc; char *strAptr, *strBptr; int lenA, lenB, len; Tcl_UniChar unicharA, unicharB; *greater = 0; if (typeText) { lenA = Tcl_NumUtfChars (strA, -1); lenB = Tcl_NumUtfChars (strB, -1); len = (lenA < lenB ? lenA : lenB); rc = Tcl_UtfNcasecmp (strA, strB, len); if (rc == 0) { if (lenA > lenB) { rc = 1; |
︙ | ︙ | |||
2566 2567 2568 2569 2570 2571 2572 | break; } } if (!upperFirst) { rc *= -1; } } | < | 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 | break; } } if (!upperFirst) { rc *= -1; } } if (asc) *greater = (rc > 0); else *greater = (rc < 0); } else { DBG( fprintf(stderr, "nodeGreater realA='%f' realB='%f'\n",realA, realB);) if (IS_NAN (realA) || IS_NAN (realB)) { if (asc) { |
︙ | ︙ | |||
5937 5938 5939 5940 5941 5942 5943 | } Tcl_ListObjAppendElement (interp, cmdPtr, (href ? Tcl_NewStringObj (href, strlen (href)) : Tcl_NewStringObj ("", 0))); Tcl_ListObjAppendElement (interp, cmdPtr, Tcl_NewStringObj ("", 0)); | < < < < | 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 | } Tcl_ListObjAppendElement (interp, cmdPtr, (href ? Tcl_NewStringObj (href, strlen (href)) : Tcl_NewStringObj ("", 0))); Tcl_ListObjAppendElement (interp, cmdPtr, Tcl_NewStringObj ("", 0)); result = Tcl_EvalObjEx (interp, cmdPtr, TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL); Tcl_DecrRefCount (cmdPtr); resultObj = Tcl_GetObjResult (interp); Tcl_IncrRefCount (resultObj); if (result != TCL_OK) { goto wrongScriptResult; |
︙ | ︙ | |||
6016 6017 6018 6019 6020 6021 6022 | Tcl_ResetResult (interp); if (xsltDoc->extResolver) { extResolver = Tcl_NewStringObj(xsltDoc->extResolver, -1); Tcl_IncrRefCount (extResolver); } /* keep white space, no fiddling with the encoding (is this a good idea?) */ | | | 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 | Tcl_ResetResult (interp); if (xsltDoc->extResolver) { extResolver = Tcl_NewStringObj(xsltDoc->extResolver, -1); Tcl_IncrRefCount (extResolver); } /* keep white space, no fiddling with the encoding (is this a good idea?) */ doc = domReadDocument (parser, xmlstring, len, 0, 0, storeLineColumn, 0, 0, NULL, chan, extbase, extResolver, 0, (int) XML_PARAM_ENTITY_PARSING_ALWAYS, interp, &resultcode); if (xsltDoc->extResolver) { Tcl_DecrRefCount (extResolver); } if (doc == NULL) { |
︙ | ︙ | |||
6347 6348 6349 6350 6351 6352 6353 | df = df->next; } if (df == NULL) { df = (xsltDecimalFormat*)MALLOC(sizeof(xsltDecimalFormat)); memset (df, 0, sizeof (xsltDecimalFormat)); newdf = 1; /* initialize to defaults */ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 | df = df->next; } if (df == NULL) { df = (xsltDecimalFormat*)MALLOC(sizeof(xsltDecimalFormat)); memset (df, 0, sizeof (xsltDecimalFormat)); newdf = 1; /* initialize to defaults */ df->decimalSeparator = 46; df->groupingSeparator = 44; df->infinity = "Infinity"; df->minusSign = 45; df->NaN = "NaN"; df->percent = 37; df->perMille = 0x2030; df->zeroDigit = 48; df->digit = 35; df->patternSeparator = 59; df->name = tdomstrdup(str); if (ns) df->uri = tdomstrdup(ns->uri); else df->uri = NULL; /* prepend into list of decimal format after the default one */ df->next = xs->decimalFormats->next; xs->decimalFormats->next = df; } } else { /* definitions for default decimal format */ df = xs->decimalFormats; } str = getAttr(node, "decimal-separator", a_decimalSeparator); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "decimal-separator has to be a" " single char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->decimalSeparator); } str = getAttr(node, "grouping-separator", a_groupingSeparator); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "groupingSeparator has to be a" " single char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->groupingSeparator); } str = getAttr(node, "infinity", a_infinity); if (str) df->infinity = str; str = getAttr(node, "minus-sign", a_minusSign); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "minus-sign has to be a single" " char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->minusSign); } str = getAttr(node, "NaN", a_nan); if (str) df->NaN = str; str = getAttr(node, "percent", a_percent); if (str) { if (str[1] != '\0') { reportError (node, "percent has to be a single" " char", errMsg); return -1; } df->percent = str[0]; clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "percent has to be a single" " char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->percent); } str = getAttr(node, "per-mille", a_perMille); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "per-mille has to be a single" " char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->perMille); } str = getAttr(node, "zero-digit", a_zeroDigit); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "zero-digit has to be a single" " char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->zeroDigit); } str = getAttr(node, "digit", a_digit); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "digit has to be a single char", errMsg); if (newdf) FREE((char*)df); return -1; } Tcl_UtfToUniChar (str, &df->digit); } str = getAttr(node, "pattern-separator", a_patternSeparator); if (str) { clen = UTF8_CHAR_LEN (str[0]); if (str[clen] != '\0') { reportError (node, "pattern-separator has to be a" " single char", errMsg); return -1; } Tcl_UtfToUniChar (str, &df->patternSeparator); } break; case import: if (nonImportElemSeen) { reportError (node, "xsl:import elements must come first", errMsg); |
︙ | ︙ | |||
7333 7334 7335 7336 7337 7338 7339 | Tcl_InitHashTable ( &(xs->xpaths), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->pattern), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->formats), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->topLevelVars), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->keyInfos), TCL_STRING_KEYS); xs->decimalFormats->name = NULL; xs->decimalFormats->uri = NULL; | < < < < < < < < < < | 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 | Tcl_InitHashTable ( &(xs->xpaths), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->pattern), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->formats), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->topLevelVars), TCL_STRING_KEYS); Tcl_InitHashTable ( &(xs->keyInfos), TCL_STRING_KEYS); xs->decimalFormats->name = NULL; xs->decimalFormats->uri = NULL; xs->decimalFormats->decimalSeparator = 46; xs->decimalFormats->groupingSeparator = 44; xs->decimalFormats->minusSign = 45; xs->decimalFormats->percent = 37; xs->decimalFormats->perMille = 0x2030; xs->decimalFormats->zeroDigit = 48; xs->decimalFormats->digit = 35; xs->decimalFormats->patternSeparator = 59; xs->decimalFormats->infinity = "Infinity"; xs->decimalFormats->NaN = "NaN"; xs->decimalFormats->next = NULL; xs->indentOutput = 0; memset (&xs->doctype, 0, sizeof (domDocInfo)); node = xsltDoc->documentElement; |
︙ | ︙ |
Deleted generic/encodings.inc.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to generic/tcldom.c.
︙ | ︙ | |||
38 39 40 41 42 43 44 | /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include <tcl.h> | < < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | /*---------------------------------------------------------------------------- | Includes | \---------------------------------------------------------------------------*/ #include <tcl.h> #include <dom.h> #include <domxpath.h> #include <domxslt.h> #include <xmlsimple.h> #include <domjson.h> #include <domhtml.h> #include <domhtml5.h> |
︙ | ︙ | |||
144 145 146 147 148 149 150 | #define CheckPIValue(interp, text) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_PIValueCheck(interp, text)) {\ return TCL_ERROR; \ } \ } | < < < < < < < < | 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 | #define CheckPIValue(interp, text) \ if (!TSD(dontCheckCharData)) { \ if (!tcldom_PIValueCheck(interp, text)) {\ return TCL_ERROR; \ } \ } #define writeChars(var,chan,buf,len) (chan) ? \ ((void)Tcl_WriteChars ((chan), (buf), (len) )) : \ (Tcl_AppendToObj ((var), (buf), (len) )); #define DOM_CREATECMDMODE_AUTO 0 #define DOM_CREATECMDMODE_CMDS 1 #define DOM_CREATECMDMODE_TOKENS 2 /*---------------------------------------------------------------------------- | Module Globals | \---------------------------------------------------------------------------*/ #ifndef TCL_THREADS static int storeLineColumn = 0; static int dontCreateObjCommands = 0; static int dontCheckCharData = 0; static int dontCheckName = 0; static int domCreateCmdMode = 0; # define TSD(x) x # define GetTcldomTSD() #else typedef struct ThreadSpecificData { int storeLineColumn; int dontCreateObjCommands; int dontCheckCharData; int dontCheckName; int domCreateCmdMode; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; |
︙ | ︙ | |||
212 213 214 215 216 217 218 | " createDocumentNS uri docElemName ?objVar? \n" " createDocumentNode ?objVar? \n" TDomThreaded( " attachDocument domDoc ?objVar? \n" " detachDocument domDoc \n" ) " createNodeCmd ?-returnNodeCmd? ?-tagName name? ?-jsonType jsonType? ?-namespace URI? (element|comment|text|cdata|pi)Node cmdName \n" | < | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | " createDocumentNS uri docElemName ?objVar? \n" " createDocumentNode ?objVar? \n" TDomThreaded( " attachDocument domDoc ?objVar? \n" " detachDocument domDoc \n" ) " createNodeCmd ?-returnNodeCmd? ?-tagName name? ?-jsonType jsonType? ?-namespace URI? (element|comment|text|cdata|pi)Node cmdName \n" " setStoreLineColumn ?boolean? \n" " setNameCheck ?boolean? \n" " setTextCheck ?boolean? \n" " setObjectCommands ?(automatic|token|command)? \n" " isCharData string \n" " isComment string \n" " isCDATA string \n" |
︙ | ︙ | |||
1226 1227 1228 1229 1230 1231 1232 | } doc = domReadDocument(parser, xml_string, xml_string_len, 1, 0, | < | 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 | } doc = domReadDocument(parser, xml_string, xml_string_len, 1, 0, TSD(storeLineColumn), ignorexmlns, 0, NULL, NULL, NULL, extResolver, |
︙ | ︙ | |||
2209 2210 2211 2212 2213 2214 2215 | ) { #define APESC_BUF_SIZE 512 #define AP(c) *b++ = c; #define AE(s) pc1 = s; while(*pc1) *b++ = *pc1++; char buf[APESC_BUF_SIZE+80], *b, *bLimit, *pc, *pc1, *pEnd, charRef[10]; int charDone, i; | < < | 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 | ) { #define APESC_BUF_SIZE 512 #define AP(c) *b++ = c; #define AE(s) pc1 = s; while(*pc1) *b++ = *pc1++; char buf[APESC_BUF_SIZE+80], *b, *bLimit, *pc, *pc1, *pEnd, charRef[10]; int charDone, i; int clen = 0; int unicode; Tcl_UniChar uniChar; b = buf; bLimit = b + APESC_BUF_SIZE; pc = pEnd = value; if (value_length != -1) { pEnd = pc + value_length; } |
︙ | ︙ | |||
2239 2240 2241 2242 2243 2244 2245 | } else if (forAttr && (*pc == '\n')) { AP('&') AP('#') AP('x') AP('A') AP(';') } else { charDone = 0; if (htmlEntities) { charDone = 1; | < < < < | 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 | } else if (forAttr && (*pc == '\n')) { AP('&') AP('#') AP('x') AP('A') AP(';') } else { charDone = 0; if (htmlEntities) { charDone = 1; Tcl_UtfToUniChar(pc, &uniChar); switch (uniChar) { case 0240: AE(" "); break; case 0241: AE("¡"); break; case 0242: AE("¢"); break; case 0243: AE("£"); break; case 0244: AE("¤"); break; case 0245: AE("¥"); break; |
︙ | ︙ | |||
2342 2343 2344 2345 2346 2347 2348 | case 0371: AE("ù"); break; case 0372: AE("ú"); break; case 0373: AE("û"); break; case 0374: AE("ü"); break; case 0375: AE("ý"); break; case 0376: AE("þ"); break; case 0377: AE("ÿ"); break; | < | 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 | case 0371: AE("ù"); break; case 0372: AE("ú"); break; case 0373: AE("û"); break; case 0374: AE("ü"); break; case 0375: AE("ý"); break; case 0376: AE("þ"); break; case 0377: AE("ÿ"); break; /* "Special" chars, according to XHTML xhtml-special.ent */ case 338: AE("Œ"); break; case 339: AE("œ"); break; case 352: AE("Š"); break; case 353: AE("š"); break; case 376: AE("Ÿ"); break; case 710: AE("ˆ"); break; |
︙ | ︙ | |||
2497 2498 2499 2500 2501 2502 2503 | case 9001: AE("⟨"); break; case 9002: AE("⟩"); break; case 9674: AE("◊"); break; case 9824: AE("♠"); break; case 9827: AE("♣"); break; case 9829: AE("♥"); break; case 9830: AE("♦"); break; | < < < < < < < < < < < < < < < < < | 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 | case 9001: AE("⟨"); break; case 9002: AE("⟩"); break; case 9674: AE("◊"); break; case 9824: AE("♠"); break; case 9827: AE("♣"); break; case 9829: AE("♥"); break; case 9830: AE("♦"); break; default: charDone = 0; } if (charDone) { clen = UTF8_CHAR_LEN(*pc); pc += (clen - 1); } } if (!charDone) { if ((unsigned char)*pc > 127) { clen = UTF8_CHAR_LEN(*pc); if (!clen) { domPanic("tcldom_AppendEscaped: can only handle " "UTF-8 chars up to 4 bytes length"); |
︙ | ︙ | |||
2557 2558 2559 2560 2561 2562 2563 | } pc--; } } else { AP(*pc); } } | < | 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 | } pc--; } } else { AP(*pc); } } } if (b >= bLimit) { writeChars(xmlString, chan, buf, b - buf); b = buf; } pc++; } |
︙ | ︙ | |||
6094 6095 6096 6097 6098 6099 6100 | } else { doc = domCreateDocument (uri, Tcl_GetString(objv[2])); } return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1, 0); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 | } else { doc = domCreateDocument (uri, Tcl_GetString(objv[2])); } return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1, 0); } /*---------------------------------------------------------------------------- | tcldom_parse | \---------------------------------------------------------------------------*/ static int tcldom_parse ( ClientData clientData, |
︙ | ︙ | |||
6579 6580 6581 6582 6583 6584 6585 | parser = XML_ParserCreate_MM(NULL, MEM_SUITE, NULL); Tcl_ResetResult(interp); doc = domReadDocument(parser, xml_string, xml_string_len, ignoreWhiteSpaces, keepCDATA, | < | 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 | parser = XML_ParserCreate_MM(NULL, MEM_SUITE, NULL); Tcl_ResetResult(interp); doc = domReadDocument(parser, xml_string, xml_string_len, ignoreWhiteSpaces, keepCDATA, TSD(storeLineColumn), ignorexmlns, feedbackAfter, feedbackCmd, chan, baseURI, extResolver, |
︙ | ︙ | |||
6791 6792 6793 6794 6795 6796 6797 | char * method, tmp[300]; int methodIndex, result, i, bool; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; static const char *domMethods[] = { "createDocument", "createDocumentNS", "createNodeCmd", | | | | 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 | char * method, tmp[300]; int methodIndex, result, i, bool; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; static const char *domMethods[] = { "createDocument", "createDocumentNS", "createNodeCmd", "parse", "setStoreLineColumn", "isCharData", "isName", "isPIName", "isQName", "isComment", "isCDATA", "isPIValue", "isNCName", "createDocumentNode", "setNameCheck", "setTextCheck", "setObjectCommands", "featureinfo", "isBMPCharData", #ifdef TCL_THREADS "attachDocument", "detachDocument", #endif NULL }; enum domMethod { m_createDocument, m_createDocumentNS, m_createNodeCmd, m_parse, m_setStoreLineColumn, m_isCharData, m_isName, m_isPIName, m_isQName, m_isComment, m_isCDATA, m_isPIValue, m_isNCName, m_createDocumentNode, m_setNameCheck, m_setTextCheck, m_setObjectCommands, m_featureinfo, m_isBMPCharData #ifdef TCL_THREADS ,m_attachDocument, m_detachDocument |
︙ | ︙ | |||
6925 6926 6927 6928 6929 6930 6931 | } SetResult(""); return TCL_OK; } break; #endif | < < < | 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 | } SetResult(""); return TCL_OK; } break; #endif case m_setStoreLineColumn: if (objc == 3) { if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) { return TCL_ERROR; } TSD(storeLineColumn) = bool; } |
︙ | ︙ |
Changes to generic/tclexpat.c.
︙ | ︙ | |||
895 896 897 898 899 900 901 | int result, mode, done; size_t bytesread; char s[255], buf[8*1024]; int fd; XML_Parser parser; Tcl_Channel channel = NULL; CHandlerSet *activeCHandlerSet; | < < | 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | int result, mode, done; size_t bytesread; char s[255], buf[8*1024]; int fd; XML_Parser parser; Tcl_Channel channel = NULL; CHandlerSet *activeCHandlerSet; Tcl_Obj *bufObj = NULL; Tcl_DString dStr; int useBinary; char *str; if (expat->finished) { if ((result = TclExpatInitializeParser (interp, expat, 0)) != TCL_OK) return TCL_ERROR; } if (!expat->parsingState) { |
︙ | ︙ | |||
949 950 951 952 953 954 955 | } if (!(mode & TCL_READABLE)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "channel \"", data, "wasn't opened for reading", (char *) NULL); return TCL_ERROR; } | < | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | } if (!(mode & TCL_READABLE)) { Tcl_ResetResult (interp); Tcl_AppendResult (interp, "channel \"", data, "wasn't opened for reading", (char *) NULL); return TCL_ERROR; } Tcl_DStringInit (&dStr); if (Tcl_GetChannelOption (interp, channel, "-encoding", &dStr) != TCL_OK) { return TCL_ERROR; } if (strcmp (Tcl_DStringValue (&dStr), "binary")==0 ) useBinary = 1; else useBinary = 0; |
︙ | ︙ | |||
985 986 987 988 989 990 991 | bufObj until the error reporting is done (otherwise, calling XML_GetCurrentLineNumber() results in invalid mem reads */ if (result) { Tcl_DecrRefCount (bufObj); } } | < < < < < < < < < | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 | bufObj until the error reporting is done (otherwise, calling XML_GetCurrentLineNumber() results in invalid mem reads */ if (result) { Tcl_DecrRefCount (bufObj); } } expat->parsingState = 1; break; case EXPAT_INPUT_FILENAME: fd = open(data, O_BINARY|O_RDONLY); if (fd < 0) { Tcl_ResetResult (interp); |
︙ | ︙ | |||
1049 1050 1051 1052 1053 1054 1055 | sprintf(s, "%ld", XML_GetCurrentLineNumber(expat->parser)); Tcl_AppendResult(interp, "error \"", XML_ErrorString(XML_GetErrorCode(expat->parser)), "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(expat->parser)); Tcl_AppendResult(interp, s, NULL); } | < < | 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 | sprintf(s, "%ld", XML_GetCurrentLineNumber(expat->parser)); Tcl_AppendResult(interp, "error \"", XML_ErrorString(XML_GetErrorCode(expat->parser)), "\" at line ", s, " character ", NULL); sprintf(s, "%ld", XML_GetCurrentColumnNumber(expat->parser)); Tcl_AppendResult(interp, s, NULL); } if (bufObj) { Tcl_DecrRefCount (bufObj); } return TCL_ERROR; } switch (expat->status) { case TCL_OK: case TCL_BREAK: case TCL_CONTINUE: case TCL_RETURN: |
︙ | ︙ |
Deleted generic/utf8conv.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted generic/utf8conv.h.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to generic/xmlsimple.c.
︙ | ︙ | |||
169 170 171 172 173 174 175 | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, | < < < < | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | \---------------------------------------------------------------------------*/ static Er er_sequences[] = { { "amp", "&", 0 }, { "lt", "<", 0 }, { "gt", ">", 0 }, { "apos", "'", 0 }, { "quot", "\"", 0 }, { "nbsp", "\xC2\xA0", 0 }, }; /*---------------------------------------------------------------------------- | ErInit -- | | Initialize the entity reference hash table |
︙ | ︙ | |||
283 284 285 286 287 288 289 | } } if (!z[i] || (z[i]!=';')) { return 0; /* error */ } from = i+1; | < < < < | 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 | } } if (!z[i] || (z[i]!=';')) { return 0; /* error */ } from = i+1; if (value < 0x80) { z[to++] = value; } else if (value <= 0x7FF) { z[to++] = (char) ((value >> 6) | 0xC0); z[to++] = (char) ((value | 0x80) & 0xBF); } else if (value <= 0xFFFF) { z[to++] = (char) ((value >> 12) | 0xE0); z[to++] = (char) (((value >> 6) | 0x80) & 0xBF); z[to++] = (char) ((value | 0x80) & 0xBF); } else { /* error */ return 0; } } else { while (z[i] && isalpha((unsigned char)z[i])) { i++; } if (!z[i] || (z[i]!=';')) { return 0; } |
︙ | ︙ |
Changes to tests/OASIS-suite.tcl.
1 2 3 4 5 6 7 8 9 10 11 | # Helper script to run xslt 1.0 conformance test suite created by the # OASIS XSLT / XPath Conformance Technical Committee. catch {source uri.tcl} package require uri package require tdom # The following is not needed, given, that tDOM is correctly # installed. This code only ensures, that the tDOM script library gets # sourced, if the script is called with a tcldomsh out of the build # dir of a complete tDOM source installation. | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Helper script to run xslt 1.0 conformance test suite created by the # OASIS XSLT / XPath Conformance Technical Committee. catch {source uri.tcl} package require uri package require tdom # The following is not needed, given, that tDOM is correctly # installed. This code only ensures, that the tDOM script library gets # sourced, if the script is called with a tcldomsh out of the build # dir of a complete tDOM source installation. if {[info commands ::tDOM::xmlReadFile] == ""} { # tcldomsh without the script library. Source the lib. source [file join [file dir [info script]] ../lib tdom.tcl] } # Import the tDOM helper procs namespace import tDOM::* |
︙ | ︙ |