File
doc/expatapi.html
— part of check-in
[9eb5979f33]
at
2018-04-07 00:51:22
on branch deCONST
— Builds now with 8.4 (and maybe even with 8.3) until (current) 9.0. Test suite needs some more updates to work w/ 9.0 without errors.
(user:
rolf
size: 12885)
[more...]
0000: 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 0a 3c 6c <html>.<head>.<l
0010: 69 6e 6b 20 72 65 6c 3d 22 73 74 79 6c 65 73 68 ink rel="stylesh
0020: 65 65 74 22 20 68 72 65 66 3d 22 6d 61 6e 70 61 eet" href="manpa
0030: 67 65 2e 63 73 73 22 3e 3c 74 69 74 6c 65 3e 74 ge.css"><title>t
0040: 44 4f 4d 20 6d 61 6e 75 61 6c 3a 20 65 78 70 61 DOM manual: expa
0050: 74 61 70 69 3c 2f 74 69 74 6c 65 3e 3c 6d 65 74 tapi</title><met
0060: 61 20 6e 61 6d 65 3d 22 78 73 6c 2d 70 72 6f 63 a name="xsl-proc
0070: 65 73 73 6f 72 22 20 63 6f 6e 74 65 6e 74 3d 22 essor" content="
0080: 4a 6f 63 68 65 6e 20 4c 6f 65 77 65 72 20 28 6c Jochen Loewer (l
0090: 6f 65 77 65 72 6a 40 68 6f 74 6d 61 69 6c 2e 63 oewerj@hotmail.c
00a0: 6f 6d 29 2c 20 52 6f 6c 66 20 41 64 65 20 28 72 om), Rolf Ade (r
00b0: 6f 6c 66 40 70 6f 69 6e 74 73 6d 61 6e 2e 64 65 olf@pointsman.de
00c0: 29 20 65 74 2e 20 61 6c 2e 22 3e 3c 6d 65 74 61 ) et. al."><meta
00d0: 20 6e 61 6d 65 3d 22 67 65 6e 65 72 61 74 6f 72 name="generator
00e0: 22 20 63 6f 6e 74 65 6e 74 3d 22 24 52 43 53 66 " content="$RCSf
00f0: 69 6c 65 3a 20 74 6d 6d 6c 2d 68 74 6d 6c 2e 78 ile: tmml-html.x
0100: 73 6c 2c 76 20 24 20 24 52 65 76 69 73 69 6f 6e sl,v $ $Revision
0110: 3a 20 31 2e 31 31 20 24 22 3e 3c 6d 65 74 61 20 : 1.11 $"><meta
0120: 63 68 61 72 73 65 74 3d 22 75 74 66 2d 38 22 3e charset="utf-8">
0130: 0a 3c 2f 68 65 61 64 3e 3c 62 6f 64 79 3e 0a 3c .</head><body>.<
0140: 64 69 76 20 63 6c 61 73 73 3d 22 68 65 61 64 65 div class="heade
0150: 72 22 3e 0a 3c 64 69 76 20 63 6c 61 73 73 3d 22 r">.<div class="
0160: 6e 61 76 62 61 72 22 20 61 6c 69 67 6e 3d 22 63 navbar" align="c
0170: 65 6e 74 65 72 22 3e 0a 3c 61 20 68 72 65 66 3d enter">.<a href=
0180: 22 23 53 45 43 54 69 64 30 78 31 65 37 62 39 32 "#SECTid0x1e7b92
0190: 30 22 3e 4e 41 4d 45 3c 2f 61 3e 20 c2 b7 20 3c 0">NAME</a> · <
01a0: 61 20 68 72 65 66 3d 22 23 53 45 43 54 69 64 30 a href="#SECTid0
01b0: 78 31 64 39 30 39 35 30 22 3e 53 59 4e 4f 50 53 x1d90950">SYNOPS
01c0: 49 53 3c 2f 61 3e 20 c2 b7 20 3c 61 20 68 72 65 IS</a> · <a hre
01d0: 66 3d 22 23 53 45 43 54 69 64 30 78 31 65 65 66 f="#SECTid0x1eef
01e0: 35 37 30 22 3e 41 52 47 55 4d 45 4e 54 53 3c 2f 570">ARGUMENTS</
01f0: 61 3e 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22 23 a> · <a href="#
0200: 53 45 43 54 69 64 30 78 31 65 66 31 36 36 30 22 SECTid0x1ef1660"
0210: 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e >DESCRIPTION</a>
0220: 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22 23 53 45 · <a href="#SE
0230: 43 54 69 64 30 78 31 65 61 36 30 38 30 22 3e 53 CTid0x1ea6080">S
0240: 45 45 20 41 4c 53 4f 3c 2f 61 3e 20 c2 b7 20 3c EE ALSO</a> · <
0250: 61 20 68 72 65 66 3d 22 23 53 45 43 54 69 64 30 a href="#SECTid0
0260: 78 31 65 61 36 33 32 30 22 3e 4b 45 59 57 4f 52 x1ea6320">KEYWOR
0270: 44 53 3c 2f 61 3e 0a 3c 2f 64 69 76 3e 3c 68 72 DS</a>.</div><hr
0280: 20 63 6c 61 73 73 3d 22 6e 61 76 73 65 70 22 3e class="navsep">
0290: 0a 3c 2f 64 69 76 3e 3c 64 69 76 20 63 6c 61 73 .</div><div clas
02a0: 73 3d 22 62 6f 64 79 22 3e 0a 20 20 20 20 3c 68 s="body">. <h
02b0: 32 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 43 54 69 2><a name="SECTi
02c0: 64 30 78 31 65 37 62 39 32 30 22 3e 4e 41 4d 45 d0x1e7b920">NAME
02d0: 3c 2f 61 3e 3c 2f 68 32 3e 3c 70 20 63 6c 61 73 </a></h2><p clas
02e0: 73 3d 22 6e 61 6d 65 73 65 63 74 69 6f 6e 22 3e s="namesection">
02f0: 0a 3c 62 20 63 6c 61 73 73 3d 22 6e 61 6d 65 73 .<b class="names
0300: 22 3e 43 68 65 63 6b 45 78 70 61 74 50 61 72 73 ">CheckExpatPars
0310: 65 72 4f 62 6a 2c 20 43 48 61 6e 64 6c 65 72 53 erObj, CHandlerS
0320: 65 74 49 6e 73 74 61 6c 6c 2c 20 43 48 61 6e 64 etInstall, CHand
0330: 6c 65 72 53 65 74 52 65 6d 6f 76 65 2c 0a 20 20 lerSetRemove,.
0340: 20 20 20 20 20 20 20 43 48 61 6e 64 6c 65 72 53 CHandlerS
0350: 65 74 43 72 65 61 74 65 2c 20 43 48 61 6e 64 6c etCreate, CHandl
0360: 65 72 53 65 74 47 65 74 55 73 65 72 44 61 74 61 erSetGetUserData
0370: 2c 20 47 65 74 45 78 70 61 74 49 6e 66 6f 20 2d , GetExpatInfo -
0380: 20 3c 2f 62 3e 3c 62 72 3e 46 75 6e 63 74 69 6f </b><br>Functio
0390: 6e 73 20 74 6f 20 63 72 65 61 74 65 2c 20 69 6e ns to create, in
03a0: 73 74 61 6c 6c 20 61 6e 64 20 72 65 6d 6f 76 65 stall and remove
03b0: 20 65 78 70 61 74 20 70 61 72 73 65 72 20 6f 62 expat parser ob
03c0: 6a 65 63 74 0a 65 78 74 65 6e 73 69 6f 6e 73 2e ject.extensions.
03d0: 3c 2f 70 3e 0a 20 20 3c 68 32 3e 3c 61 20 6e 61 </p>. <h2><a na
03e0: 6d 65 3d 22 53 45 43 54 69 64 30 78 31 64 39 30 me="SECTid0x1d90
03f0: 39 35 30 22 3e 53 59 4e 4f 50 53 49 53 3c 2f 61 950">SYNOPSIS</a
0400: 3e 3c 2f 68 32 3e 3c 70 72 65 20 63 6c 61 73 73 ></h2><pre class
0410: 3d 22 73 79 6e 74 61 78 22 3e 23 69 6e 63 6c 75 ="syntax">#inclu
0420: 64 65 20 26 6c 74 3b 74 63 6c 65 78 70 61 74 2e de <tclexpat.
0430: 68 26 67 74 3b 0a 0a 69 6e 74 20 0a 3c 62 20 63 h>..int .<b c
0440: 6c 61 73 73 3d 22 66 75 6e 22 3e 43 68 65 63 6b lass="fun">Check
0450: 45 78 70 61 74 50 61 72 73 65 72 4f 62 6a 3c 2f ExpatParserObj</
0460: 62 3e 20 28 3c 61 20 68 72 65 66 3d 22 23 41 52 b> (<a href="#AR
0470: 47 2d 69 6e 74 65 72 70 22 3e 3c 69 3e 69 6e 74 G-interp"><i>int
0480: 65 72 70 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c 61 20 erp</i></a>, <a
0490: 68 72 65 66 3d 22 23 41 52 47 2d 6e 61 6d 65 4f href="#ARG-nameO
04a0: 62 6a 22 3e 3c 69 3e 6e 61 6d 65 4f 62 6a 3c 2f bj"><i>nameObj</
04b0: 69 3e 3c 2f 61 3e 29 20 20 0a 0a 69 6e 74 0a 3c i></a>) ..int.<
04c0: 62 20 63 6c 61 73 73 3d 22 66 75 6e 22 3e 43 48 b class="fun">CH
04d0: 61 6e 64 6c 65 72 53 65 74 49 6e 73 74 61 6c 6c andlerSetInstall
04e0: 3c 2f 62 3e 20 28 3c 61 20 68 72 65 66 3d 22 23 </b> (<a href="#
04f0: 41 52 47 2d 69 6e 74 65 72 70 22 3e 3c 69 3e 69 ARG-interp"><i>i
0500: 6e 74 65 72 70 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c nterp</i></a>, <
0510: 61 20 68 72 65 66 3d 22 23 41 52 47 2d 65 78 70 a href="#ARG-exp
0520: 61 74 4f 62 6a 22 3e 3c 69 3e 65 78 70 61 74 4f atObj"><i>expatO
0530: 62 6a 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c 61 20 68 bj</i></a>, <a h
0540: 72 65 66 3d 22 23 41 52 47 2d 68 61 6e 64 6c 65 ref="#ARG-handle
0550: 72 53 65 74 22 3e 3c 69 3e 68 61 6e 64 6c 65 72 rSet"><i>handler
0560: 53 65 74 3c 2f 69 3e 3c 2f 61 3e 29 0a 0a 69 6e Set</i></a>)..in
0570: 74 20 0a 3c 62 20 63 6c 61 73 73 3d 22 66 75 6e t .<b class="fun
0580: 22 3e 43 48 61 6e 64 6c 65 72 53 65 74 52 65 6d ">CHandlerSetRem
0590: 6f 76 65 3c 2f 62 3e 20 28 3c 61 20 68 72 65 66 ove</b> (<a href
05a0: 3d 22 23 41 52 47 2d 69 6e 74 65 72 70 22 3e 3c ="#ARG-interp"><
05b0: 69 3e 69 6e 74 65 72 70 3c 2f 69 3e 3c 2f 61 3e i>interp</i></a>
05c0: 2c 20 3c 61 20 68 72 65 66 3d 22 23 41 52 47 2d , <a href="#ARG-
05d0: 65 78 70 61 74 4f 62 6a 22 3e 3c 69 3e 65 78 70 expatObj"><i>exp
05e0: 61 74 4f 62 6a 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c atObj</i></a>, <
05f0: 61 20 68 72 65 66 3d 22 23 41 52 47 2d 68 61 6e a href="#ARG-han
0600: 64 6c 65 72 53 65 74 4e 61 6d 65 22 3e 3c 69 3e dlerSetName"><i>
0610: 68 61 6e 64 6c 65 72 53 65 74 4e 61 6d 65 3c 2f handlerSetName</
0620: 69 3e 3c 2f 61 3e 29 0a 0a 43 48 61 6e 64 6c 65 i></a>)..CHandle
0630: 72 53 65 74 2a 0a 3c 62 20 63 6c 61 73 73 3d 22 rSet*.<b class="
0640: 66 75 6e 22 3e 43 48 61 6e 64 6c 65 72 53 65 74 fun">CHandlerSet
0650: 43 72 65 61 74 65 3c 2f 62 3e 20 28 3c 61 20 68 Create</b> (<a h
0660: 72 65 66 3d 22 23 41 52 47 2d 68 61 6e 64 6c 65 ref="#ARG-handle
0670: 72 53 65 74 4e 61 6d 65 22 3e 3c 69 3e 68 61 6e rSetName"><i>han
0680: 64 6c 65 72 53 65 74 4e 61 6d 65 3c 2f 69 3e 3c dlerSetName</i><
0690: 2f 61 3e 29 0a 0a 43 48 61 6e 64 6c 65 72 53 65 /a>)..CHandlerSe
06a0: 74 2a 0a 3c 62 20 63 6c 61 73 73 3d 22 66 75 6e t*.<b class="fun
06b0: 22 3e 43 48 61 6e 64 6c 65 72 53 65 74 47 65 74 ">CHandlerSetGet
06c0: 3c 2f 62 3e 20 28 3c 61 20 68 72 65 66 3d 22 23 </b> (<a href="#
06d0: 41 52 47 2d 69 6e 74 65 72 70 22 3e 3c 69 3e 69 ARG-interp"><i>i
06e0: 6e 74 65 72 70 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c nterp</i></a>, <
06f0: 61 20 68 72 65 66 3d 22 23 41 52 47 2d 65 78 70 a href="#ARG-exp
0700: 61 74 4f 62 6a 22 3e 3c 69 3e 65 78 70 61 74 4f atObj"><i>expatO
0710: 62 6a 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c 61 20 68 bj</i></a>, <a h
0720: 72 65 66 3d 22 23 41 52 47 2d 68 61 6e 64 6c 65 ref="#ARG-handle
0730: 72 53 65 74 4e 61 6d 65 22 3e 3c 69 3e 68 61 6e rSetName"><i>han
0740: 64 6c 65 72 53 65 74 4e 61 6d 65 3c 2f 69 3e 3c dlerSetName</i><
0750: 2f 61 3e 29 0a 0a 76 6f 69 64 2a 0a 3c 62 20 63 /a>)..void*.<b c
0760: 6c 61 73 73 3d 22 66 75 6e 22 3e 43 48 61 6e 64 lass="fun">CHand
0770: 6c 65 72 53 65 74 47 65 74 55 73 65 72 44 61 74 lerSetGetUserDat
0780: 61 3c 2f 62 3e 20 28 3c 61 20 68 72 65 66 3d 22 a</b> (<a href="
0790: 23 41 52 47 2d 69 6e 74 65 72 70 22 3e 3c 69 3e #ARG-interp"><i>
07a0: 69 6e 74 65 72 70 3c 2f 69 3e 3c 2f 61 3e 2c 20 interp</i></a>,
07b0: 3c 61 20 68 72 65 66 3d 22 23 41 52 47 2d 65 78 <a href="#ARG-ex
07c0: 70 61 74 4f 62 6a 22 3e 3c 69 3e 65 78 70 61 74 patObj"><i>expat
07d0: 4f 62 6a 3c 2f 69 3e 3c 2f 61 3e 2c 20 3c 61 20 Obj</i></a>, <a
07e0: 68 72 65 66 3d 22 23 41 52 47 2d 68 61 6e 64 6c href="#ARG-handl
07f0: 65 72 53 65 74 4e 61 6d 65 22 3e 3c 69 3e 68 61 erSetName"><i>ha
0800: 6e 64 6c 65 72 53 65 74 4e 61 6d 65 3c 2f 69 3e ndlerSetName</i>
0810: 3c 2f 61 3e 29 0a 0a 54 63 6c 47 65 6e 45 78 70 </a>)..TclGenExp
0820: 61 74 49 6e 66 6f 2a 0a 3c 62 20 63 6c 61 73 73 atInfo*.<b class
0830: 3d 22 66 75 6e 22 3e 47 65 74 45 78 70 61 74 49 ="fun">GetExpatI
0840: 6e 66 6f 3c 2f 62 3e 20 28 3c 61 20 68 72 65 66 nfo</b> (<a href
0850: 3d 22 23 41 52 47 2d 69 6e 74 65 72 70 22 3e 3c ="#ARG-interp"><
0860: 69 3e 69 6e 74 65 72 70 3c 2f 69 3e 3c 2f 61 3e i>interp</i></a>
0870: 2c 20 3c 61 20 68 72 65 66 3d 22 23 41 52 47 2d , <a href="#ARG-
0880: 65 78 70 61 74 4f 62 6a 22 3e 3c 69 3e 65 78 70 expatObj"><i>exp
0890: 61 74 4f 62 6a 3c 2f 69 3e 3c 2f 61 3e 29 0a 3c atObj</i></a>).<
08a0: 2f 70 72 65 3e 0a 0a 20 20 3c 68 32 3e 3c 61 20 /pre>.. <h2><a
08b0: 6e 61 6d 65 3d 22 53 45 43 54 69 64 30 78 31 65 name="SECTid0x1e
08c0: 65 66 35 37 30 22 3e 41 52 47 55 4d 45 4e 54 53 ef570">ARGUMENTS
08d0: 3c 2f 61 3e 3c 2f 68 32 3e 3c 64 69 76 20 63 6c </a></h2><div cl
08e0: 61 73 73 3d 22 61 72 67 6c 69 73 74 22 3e 3c 74 ass="arglist"><t
08f0: 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 able width="100%
0900: 22 20 72 75 6c 65 73 3d 22 6e 6f 6e 65 22 20 63 " rules="none" c
0910: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 35 25 22 3e ellpadding="5%">
0920: 0a 3c 74 68 65 61 64 3e 3c 74 72 20 63 6c 61 73 .<thead><tr clas
0930: 73 3d 22 68 65 61 64 69 6e 67 22 3e 0a 3c 74 68 s="heading">.<th
0940: 20 77 69 64 74 68 3d 22 32 30 25 22 3e 54 79 70 width="20%">Typ
0950: 65 3c 2f 74 68 3e 3c 74 68 20 77 69 64 74 68 3d e</th><th width=
0960: 22 37 30 25 22 3e 4e 61 6d 65 3c 2f 74 68 3e 3c "70%">Name</th><
0970: 74 68 20 77 69 64 74 68 3d 22 31 30 25 22 3e 4d th width="10%">M
0980: 6f 64 65 3c 2f 74 68 3e 0a 3c 2f 74 72 3e 3c 2f ode</th>.</tr></
0990: 74 68 65 61 64 3e 3c 74 72 20 63 6c 61 73 73 3d thead><tr class=
09a0: 22 73 79 6e 74 61 78 22 3e 0a 3c 74 64 20 63 6c "syntax">.<td cl
09b0: 61 73 73 3d 22 74 79 70 65 22 20 77 69 64 74 68 ass="type" width
09c0: 3d 22 32 30 25 22 20 61 6c 69 67 6e 3d 22 6c 65 ="20%" align="le
09d0: 66 74 22 3e 54 63 6c 5f 49 6e 74 65 72 70 3c 2f ft">Tcl_Interp</
09e0: 74 64 3e 3c 74 64 20 63 6c 61 73 73 3d 22 6e 61 td><td class="na
09f0: 6d 65 22 20 77 69 64 74 68 3d 22 37 30 25 22 20 me" width="70%"
0a00: 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 3c 61 20 align="left"><a
0a10: 6e 61 6d 65 3d 22 41 52 47 2d 69 6e 74 65 72 70 name="ARG-interp
0a20: 22 3e 2a 69 6e 74 65 72 70 3c 2f 61 3e 3c 2f 74 ">*interp</a></t
0a30: 64 3e 3c 74 64 20 63 6c 61 73 73 3d 22 6d 6f 64 d><td class="mod
0a40: 65 22 20 77 69 64 74 68 3d 22 31 30 25 22 20 61 e" width="10%" a
0a50: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 69 6e lign="center">in
0a60: 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 3c 74 72 20 63 </td>.</tr><tr c
0a70: 6c 61 73 73 3d 22 64 65 73 63 22 3e 0a 3c 74 64 lass="desc">.<td
0a80: 20 63 6c 61 73 73 3d 22 70 61 64 64 69 6e 67 22 class="padding"
0a90: 20 77 69 64 74 68 3d 22 32 30 25 22 3e c2 a0 3c width="20%"> <
0aa0: 2f 74 64 3e 3c 74 64 20 63 6c 61 73 73 3d 22 61 /td><td class="a
0ab0: 72 67 64 65 73 63 22 20 77 69 64 74 68 3d 22 38 rgdesc" width="8
0ac0: 30 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 0%" align="left"
0ad0: 20 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 49 6e 74 colspan="2">Int
0ae0: 65 72 70 72 65 74 65 72 20 77 69 74 68 20 74 68 erpreter with th
0af0: 65 20 65 78 70 61 74 20 70 61 72 73 65 72 20 6f e expat parser o
0b00: 62 6a 65 63 74 2e 3c 2f 74 64 3e 0a 3c 2f 74 72 bject.</td>.</tr
0b10: 3e 3c 74 72 20 63 6c 61 73 73 3d 22 73 79 6e 74 ><tr class="synt
0b20: 61 78 22 3e 0a 3c 74 64 20 63 6c 61 73 73 3d 22 ax">.<td class="
0b30: 74 79 70 65 22 20 77 69 64 74 68 3d 22 32 30 25 type" width="20%
0b40: 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 54 " align="left">T
0b50: 63 6c 5f 4f 62 6a 3c 2f 74 64 3e 3c 74 64 20 63 cl_Obj</td><td c
0b60: 6c 61 73 73 3d 22 6e 61 6d 65 22 20 77 69 64 74 lass="name" widt
0b70: 68 3d 22 37 30 25 22 20 61 6c 69 67 6e 3d 22 6c h="70%" align="l
0b80: 65 66 74 22 3e 3c 61 20 6e 61 6d 65 3d 22 41 52 eft"><a name="AR
0b90: 47 2d 65 78 70 61 74 4f 62 6a 22 3e 2a 65 78 70 G-expatObj">*exp
0ba0: 61 74 4f 62 6a 3c 2f 61 3e 3c 2f 74 64 3e 3c 74 atObj</a></td><t
0bb0: 64 20 63 6c 61 73 73 3d 22 6d 6f 64 65 22 20 77 d class="mode" w
0bc0: 69 64 74 68 3d 22 31 30 25 22 20 61 6c 69 67 6e idth="10%" align
0bd0: 3d 22 63 65 6e 74 65 72 22 3e 69 6e 3c 2f 74 64 ="center">in</td
0be0: 3e 0a 3c 2f 74 72 3e 3c 74 72 20 63 6c 61 73 73 >.</tr><tr class
0bf0: 3d 22 64 65 73 63 22 3e 0a 3c 74 64 20 63 6c 61 ="desc">.<td cla
0c00: 73 73 3d 22 70 61 64 64 69 6e 67 22 20 77 69 64 ss="padding" wid
0c10: 74 68 3d 22 32 30 25 22 3e c2 a0 3c 2f 74 64 3e th="20%"> </td>
0c20: 3c 74 64 20 63 6c 61 73 73 3d 22 61 72 67 64 65 <td class="argde
0c30: 73 63 22 20 77 69 64 74 68 3d 22 38 30 25 22 20 sc" width="80%"
0c40: 61 6c 69 67 6e 3d 22 6c 65 66 74 22 20 63 6f 6c align="left" col
0c50: 73 70 61 6e 3d 22 32 22 3e 41 20 54 63 6c 20 4f span="2">A Tcl O
0c60: 62 6a 65 63 74 20 63 6f 6e 74 61 69 6e 69 6e 67 bject containing
0c70: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6e 61 6d the command nam
0c80: 65 20 6f 66 20 74 68 65 20 65 78 70 61 74 20 70 e of the expat p
0c90: 61 72 73 65 72 20 6f 62 6a 65 63 74 20 74 6f 20 arser object to
0ca0: 62 65 20 71 75 65 72 69 65 64 20 6f 72 20 6d 6f be queried or mo
0cb0: 64 69 66 69 65 64 2e 3c 2f 74 64 3e 0a 3c 2f 74 dified.</td>.</t
0cc0: 72 3e 3c 74 72 20 63 6c 61 73 73 3d 22 73 79 6e r><tr class="syn
0cd0: 74 61 78 22 3e 0a 3c 74 64 20 63 6c 61 73 73 3d tax">.<td class=
0ce0: 22 74 79 70 65 22 20 77 69 64 74 68 3d 22 32 30 "type" width="20
0cf0: 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e %" align="left">
0d00: 63 68 61 72 3c 2f 74 64 3e 3c 74 64 20 63 6c 61 char</td><td cla
0d10: 73 73 3d 22 6e 61 6d 65 22 20 77 69 64 74 68 3d ss="name" width=
0d20: 22 37 30 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 "70%" align="lef
0d30: 74 22 3e 3c 61 20 6e 61 6d 65 3d 22 41 52 47 2d t"><a name="ARG-
0d40: 68 61 6e 64 6c 65 72 53 65 74 4e 61 6d 65 22 3e handlerSetName">
0d50: 2a 68 61 6e 64 6c 65 72 53 65 74 4e 61 6d 65 3c *handlerSetName<
0d60: 2f 61 3e 3c 2f 74 64 3e 3c 74 64 20 63 6c 61 73 /a></td><td clas
0d70: 73 3d 22 6d 6f 64 65 22 20 77 69 64 74 68 3d 22 s="mode" width="
0d80: 31 30 25 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 10%" align="cent
0d90: 65 72 22 3e 69 6e 3c 2f 74 64 3e 0a 3c 2f 74 72 er">in</td>.</tr
0da0: 3e 3c 74 72 20 63 6c 61 73 73 3d 22 64 65 73 63 ><tr class="desc
0db0: 22 3e 0a 3c 74 64 20 63 6c 61 73 73 3d 22 70 61 ">.<td class="pa
0dc0: 64 64 69 6e 67 22 20 77 69 64 74 68 3d 22 32 30 dding" width="20
0dd0: 25 22 3e c2 a0 3c 2f 74 64 3e 3c 74 64 20 63 6c %"> </td><td cl
0de0: 61 73 73 3d 22 61 72 67 64 65 73 63 22 20 77 69 ass="argdesc" wi
0df0: 64 74 68 3d 22 38 30 25 22 20 61 6c 69 67 6e 3d dth="80%" align=
0e00: 22 6c 65 66 74 22 20 63 6f 6c 73 70 61 6e 3d 22 "left" colspan="
0e10: 32 22 3e 49 64 65 6e 74 69 66 69 65 72 20 6f 66 2">Identifier of
0e20: 20 74 68 65 20 68 61 6e 64 6c 65 72 20 73 65 74 the handler set
0e30: 2e 3c 2f 74 64 3e 0a 3c 2f 74 72 3e 3c 74 72 20 .</td>.</tr><tr
0e40: 63 6c 61 73 73 3d 22 73 79 6e 74 61 78 22 3e 0a class="syntax">.
0e50: 3c 74 64 20 63 6c 61 73 73 3d 22 74 79 70 65 22 <td class="type"
0e60: 20 77 69 64 74 68 3d 22 32 30 25 22 20 61 6c 69 width="20%" ali
0e70: 67 6e 3d 22 6c 65 66 74 22 3e 43 48 61 6e 64 6c gn="left">CHandl
0e80: 65 72 53 65 74 3c 2f 74 64 3e 3c 74 64 20 63 6c erSet</td><td cl
0e90: 61 73 73 3d 22 6e 61 6d 65 22 20 77 69 64 74 68 ass="name" width
0ea0: 3d 22 37 30 25 22 20 61 6c 69 67 6e 3d 22 6c 65 ="70%" align="le
0eb0: 66 74 22 3e 3c 61 20 6e 61 6d 65 3d 22 41 52 47 ft"><a name="ARG
0ec0: 2d 68 61 6e 64 6c 65 72 53 65 74 22 3e 2a 68 61 -handlerSet">*ha
0ed0: 6e 64 6c 65 72 53 65 74 3c 2f 61 3e 3c 2f 74 64 ndlerSet</a></td
0ee0: 3e 3c 74 64 20 63 6c 61 73 73 3d 22 6d 6f 64 65 ><td class="mode
0ef0: 22 20 77 69 64 74 68 3d 22 31 30 25 22 20 61 6c " width="10%" al
0f00: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 69 6e 3c ign="center">in<
0f10: 2f 74 64 3e 0a 3c 2f 74 72 3e 3c 74 72 20 63 6c /td>.</tr><tr cl
0f20: 61 73 73 3d 22 64 65 73 63 22 3e 0a 3c 74 64 20 ass="desc">.<td
0f30: 63 6c 61 73 73 3d 22 70 61 64 64 69 6e 67 22 20 class="padding"
0f40: 77 69 64 74 68 3d 22 32 30 25 22 3e c2 a0 3c 2f width="20%"> </
0f50: 74 64 3e 3c 74 64 20 63 6c 61 73 73 3d 22 61 72 td><td class="ar
0f60: 67 64 65 73 63 22 20 77 69 64 74 68 3d 22 38 30 gdesc" width="80
0f70: 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 20 %" align="left"
0f80: 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 50 6f 69 6e colspan="2">Poin
0f90: 74 65 72 20 74 6f 20 61 20 43 20 68 61 6e 64 6c ter to a C handl
0fa0: 65 72 20 73 65 74 2e 3c 2f 74 64 3e 0a 3c 2f 74 er set.</td>.</t
0fb0: 72 3e 3c 74 72 20 63 6c 61 73 73 3d 22 73 79 6e r><tr class="syn
0fc0: 74 61 78 22 3e 0a 3c 74 64 20 63 6c 61 73 73 3d tax">.<td class=
0fd0: 22 74 79 70 65 22 20 77 69 64 74 68 3d 22 32 30 "type" width="20
0fe0: 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e %" align="left">
0ff0: 54 63 6c 5f 4f 62 6a 3c 2f 74 64 3e 3c 74 64 20 Tcl_Obj</td><td
1000: 63 6c 61 73 73 3d 22 6e 61 6d 65 22 20 77 69 64 class="name" wid
1010: 74 68 3d 22 37 30 25 22 20 61 6c 69 67 6e 3d 22 th="70%" align="
1020: 6c 65 66 74 22 3e 3c 61 20 6e 61 6d 65 3d 22 41 left"><a name="A
1030: 52 47 2d 6e 61 6d 65 4f 62 6a 22 3e 2a 6e 61 6d RG-nameObj">*nam
1040: 65 4f 62 6a 3c 2f 61 3e 3c 2f 74 64 3e 3c 74 64 eObj</a></td><td
1050: 20 63 6c 61 73 73 3d 22 6d 6f 64 65 22 20 77 69 class="mode" wi
1060: 64 74 68 3d 22 31 30 25 22 20 61 6c 69 67 6e 3d dth="10%" align=
1070: 22 63 65 6e 74 65 72 22 3e 3c 2f 74 64 3e 0a 3c "center"></td>.<
1080: 2f 74 72 3e 3c 74 72 20 63 6c 61 73 73 3d 22 64 /tr><tr class="d
1090: 65 73 63 22 3e 0a 3c 74 64 20 63 6c 61 73 73 3d esc">.<td class=
10a0: 22 70 61 64 64 69 6e 67 22 20 77 69 64 74 68 3d "padding" width=
10b0: 22 32 30 25 22 3e c2 a0 3c 2f 74 64 3e 3c 74 64 "20%"> </td><td
10c0: 20 63 6c 61 73 73 3d 22 61 72 67 64 65 73 63 22 class="argdesc"
10d0: 20 77 69 64 74 68 3d 22 38 30 25 22 20 61 6c 69 width="80%" ali
10e0: 67 6e 3d 22 6c 65 66 74 22 20 63 6f 6c 73 70 61 gn="left" colspa
10f0: 6e 3d 22 32 22 3e 41 20 54 63 6c 20 4f 62 6a 65 n="2">A Tcl Obje
1100: 63 74 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 ct containing th
1110: 65 20 6e 61 6d 65 20 6f 66 20 61 20 65 78 70 61 e name of a expa
1120: 74 20 70 61 72 73 65 72 20 6f 62 6a 65 63 74 3c t parser object<
1130: 2f 74 64 3e 0a 3c 2f 74 72 3e 0a 3c 2f 74 61 62 /td>.</tr>.</tab
1140: 6c 65 3e 3c 2f 64 69 76 3e 0a 0a 20 20 3c 68 32 le></div>.. <h2
1150: 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 43 54 69 64 ><a name="SECTid
1160: 30 78 31 65 66 31 36 36 30 22 3e 44 45 53 43 52 0x1ef1660">DESCR
1170: 49 50 54 49 4f 4e 3c 2f 61 3e 3c 2f 68 32 3e 3c IPTION</a></h2><
1180: 70 3e 54 68 65 20 66 75 6e 63 74 69 6f 6e 73 20 p>The functions
1190: 64 65 73 63 72 69 62 65 64 20 69 6e 20 74 68 69 described in thi
11a0: 73 20 6d 61 6e 75 61 6c 20 61 6c 6c 6f 77 73 20 s manual allows
11b0: 6f 6e 65 20 74 6f 20 61 64 64 20 43 20 6c 65 76 one to add C lev
11c0: 65 6c 20 63 6f 64 65 64 20 65 76 65 6e 74 0a 68 el coded event.h
11d0: 61 6e 64 6c 65 72 20 74 6f 20 61 6e 20 74 44 4f andler to an tDO
11e0: 4d 20 54 63 6c 20 65 78 70 61 74 20 70 61 72 73 M Tcl expat pars
11f0: 65 72 20 6f 62 6a 65 63 74 73 2e 20 41 20 74 44 er objects. A tD
1200: 4f 4d 20 54 63 6c 20 65 78 70 61 74 20 70 61 72 OM Tcl expat par
1210: 73 65 72 20 6f 62 6a 65 63 74 20 69 73 0a 61 62 ser object is.ab
1220: 6c 65 20 74 6f 20 68 61 76 65 20 73 65 76 65 72 le to have sever
1230: 61 6c 20 54 63 6c 20 73 63 72 69 70 74 73 20 61 al Tcl scripts a
1240: 6e 64 20 43 20 66 75 6e 63 74 69 6f 6e 73 20 61 nd C functions a
1250: 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 61 ssociated with a
1260: 6e 20 73 70 65 63 69 66 69 63 0a 65 76 65 6e 74 n specific.event
1270: 2e 20 49 66 20 74 68 65 20 65 76 65 6e 74 20 6f . If the event o
1280: 63 63 75 72 73 2c 20 66 69 72 73 74 20 74 68 65 ccurs, first the
1290: 20 54 63 6c 20 73 63 72 69 70 74 73 20 74 68 65 Tcl scripts the
12a0: 6e 20 74 68 65 20 43 20 66 75 6e 63 74 69 6f 6e n the C function
12b0: 73 0a 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 s.associated wit
12c0: 68 20 74 68 65 20 65 76 65 6e 74 20 61 72 65 20 h the event are
12d0: 63 61 6c 6c 65 64 20 69 6e 20 74 75 72 6e 2e 3c called in turn.<
12e0: 2f 70 3e 3c 70 3e 41 20 74 44 4f 4d 20 54 63 6c /p><p>A tDOM Tcl
12f0: 20 65 78 70 61 74 20 70 61 72 73 65 72 20 65 78 expat parser ex
1300: 74 65 6e 73 69 6f 6e 20 69 73 20 61 6e 20 6f 72 tension is an or
1310: 64 69 6e 61 72 79 20 54 63 6c 20 65 78 74 65 6e dinary Tcl exten
1320: 73 69 6f 6e 20 61 6e 64 20 6c 6f 61 64 65 64 0a sion and loaded.
1330: 6c 69 6b 65 20 65 76 65 72 79 20 6f 74 68 65 72 like every other
1340: 20 54 63 6c 20 65 78 74 65 6e 73 69 6f 6e 2e 20 Tcl extension.
1350: 49 74 20 6d 75 73 74 20 69 6e 73 74 61 6c 6c 20 It must install
1360: 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 6e 65 77 at least one new
1370: 20 54 63 6c 20 4c 65 76 65 6c 0a 63 6f 6d 6d 61 Tcl Level.comma
1380: 6e 64 2c 20 74 68 61 74 20 6d 61 6e 69 70 75 6c nd, that manipul
1390: 61 74 65 73 20 61 20 74 44 4f 4d 20 54 63 6c 20 ates a tDOM Tcl
13a0: 65 78 70 61 74 20 70 61 72 73 65 72 20 6f 62 6a expat parser obj
13b0: 65 63 74 2e 3c 2f 70 3e 3c 70 3e 41 20 43 20 6c ect.</p><p>A C l
13c0: 65 76 65 6c 20 68 61 6e 64 6c 65 72 20 73 65 74 evel handler set
13d0: 20 69 73 20 61 20 64 61 74 61 20 73 74 72 75 63 is a data struc
13e0: 74 75 72 65 20 6c 69 6b 65 20 74 68 69 73 3a 3c ture like this:<
13f0: 2f 70 3e 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 /p><pre class="e
1400: 78 61 6d 70 6c 65 22 3e 0a 74 79 70 65 64 65 66 xample">.typedef
1410: 20 73 74 72 75 63 74 20 43 48 61 6e 64 6c 65 72 struct CHandler
1420: 53 65 74 20 7b 0a 20 20 20 20 73 74 72 75 63 74 Set {. struct
1430: 20 43 48 61 6e 64 6c 65 72 53 65 74 20 2a 6e 65 CHandlerSet *ne
1440: 78 74 48 61 6e 64 6c 65 72 53 65 74 3b 0a 20 20 xtHandlerSet;.
1450: 20 20 63 68 61 72 20 2a 6e 61 6d 65 3b 20 20 20 char *name;
1460: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1470: 20 20 2f 2a 20 72 65 66 6e 61 6d 65 20 6f 66 20 /* refname of
1480: 74 68 65 20 68 61 6e 64 6c 65 72 20 73 65 74 20 the handler set
1490: 2a 2f 0a 20 20 20 20 69 6e 74 20 69 67 6e 6f 72 */. int ignor
14a0: 65 57 68 69 74 65 43 44 41 54 41 73 3b 20 20 20 eWhiteCDATAs;
14b0: 20 20 20 20 20 20 20 2f 2a 20 69 67 6e 6f 72 65 /* ignore
14c0: 20 27 77 68 69 74 65 27 20 43 44 41 54 41 20 73 'white' CDATA s
14d0: 65 63 74 69 6f 6e 73 20 2a 2f 0a 0a 20 20 20 20 ections */..
14e0: 76 6f 69 64 20 2a 75 73 65 72 44 61 74 61 3b 20 void *userData;
14f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1500: 2f 2a 20 48 61 6e 64 6c 65 72 20 73 65 74 20 73 /* Handler set s
1510: 70 65 63 69 66 69 63 20 44 61 74 61 20 53 74 72 pecific Data Str
1520: 75 63 74 75 72 65 3b 0a 20 20 20 20 20 20 20 20 ucture;.
1530: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1540: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 t
1550: 68 65 20 43 20 68 61 6e 64 6c 65 72 20 73 65 74 he C handler set
1560: 20 65 78 74 65 6e 73 69 6f 6e 20 68 61 73 20 74 extension has t
1570: 6f 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 o.
1580: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1590: 20 20 20 20 20 20 20 20 20 6d 61 6c 6c 6f 63 20 malloc
15a0: 74 68 65 20 6e 65 65 64 65 64 20 73 74 72 75 63 the needed struc
15b0: 74 75 72 65 20 69 6e 20 68 69 73 0a 20 20 20 20 ture in his.
15c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
15d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
15e0: 20 20 20 69 6e 69 74 20 66 75 6e 63 20 61 6e 64 init func and
15f0: 20 68 61 73 20 74 6f 20 70 72 6f 76 69 64 65 20 has to provide
1600: 61 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 a.
1610: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1620: 20 20 20 20 20 20 20 20 20 63 6c 65 61 6e 75 70 cleanup
1630: 20 66 75 6e 63 20 28 74 6f 20 66 72 65 65 20 69 func (to free i
1640: 74 29 2e 20 2a 2f 0a 0a 20 20 20 20 43 48 61 6e t). */.. CHan
1650: 64 6c 65 72 53 65 74 5f 75 73 65 72 44 61 74 61 dlerSet_userData
1660: 52 65 73 65 74 20 20 20 20 20 20 20 20 72 65 73 Reset res
1670: 65 74 50 72 6f 63 3b 0a 20 20 20 20 43 48 61 6e etProc;. CHan
1680: 64 6c 65 72 53 65 74 5f 75 73 65 72 44 61 74 61 dlerSet_userData
1690: 46 72 65 65 20 20 20 20 20 20 20 20 20 66 72 65 Free fre
16a0: 65 50 72 6f 63 3b 0a 0a 20 20 20 20 2f 2a 20 43 eProc;.. /* C
16b0: 20 66 75 6e 63 20 66 6f 72 20 65 6c 65 6d 65 6e func for elemen
16c0: 74 20 73 74 61 72 74 20 2a 2f 0a 20 20 20 20 58 t start */. X
16d0: 4d 4c 5f 53 74 61 72 74 45 6c 65 6d 65 6e 74 48 ML_StartElementH
16e0: 61 6e 64 6c 65 72 20 20 20 20 20 20 20 20 20 20 andler
16f0: 65 6c 65 6d 65 6e 74 73 74 61 72 74 63 6f 6d 6d elementstartcomm
1700: 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 and;. /* C fu
1710: 6e 63 20 66 6f 72 20 65 6c 65 6d 65 6e 74 20 65 nc for element e
1720: 6e 64 20 2a 2f 0a 20 20 20 20 58 4d 4c 5f 45 6e nd */. XML_En
1730: 64 45 6c 65 6d 65 6e 74 48 61 6e 64 6c 65 72 20 dElementHandler
1740: 20 20 20 20 20 20 20 20 20 20 20 65 6c 65 6d 65 eleme
1750: 6e 74 65 6e 64 63 6f 6d 6d 61 6e 64 3b 0a 20 20 ntendcommand;.
1760: 20 20 2f 2a 20 43 20 66 75 6e 63 20 66 6f 72 20 /* C func for
1770: 63 68 61 72 61 63 74 65 72 20 64 61 74 61 20 2a character data *
1780: 2f 0a 20 20 20 20 58 4d 4c 5f 43 68 61 72 61 63 /. XML_Charac
1790: 74 65 72 44 61 74 61 48 61 6e 64 6c 65 72 20 20 terDataHandler
17a0: 20 20 20 20 20 20 20 64 61 74 61 63 6f 6d 6d 61 datacomma
17b0: 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 6e nd;. /* C fun
17c0: 63 20 66 6f 72 20 6e 61 6d 65 73 70 61 63 65 20 c for namespace
17d0: 64 65 63 6c 20 73 74 61 72 74 20 2a 2f 0a 20 20 decl start */.
17e0: 20 20 58 4d 4c 5f 53 74 61 72 74 4e 61 6d 65 73 XML_StartNames
17f0: 70 61 63 65 44 65 63 6c 48 61 6e 64 6c 65 72 20 paceDeclHandler
1800: 20 20 20 73 74 61 72 74 6e 73 64 65 63 6c 63 6f startnsdeclco
1810: 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 mmand;. /* C
1820: 66 75 6e 63 20 66 6f 72 20 6e 61 6d 65 73 70 61 func for namespa
1830: 63 65 20 64 65 63 6c 20 65 6e 64 20 2a 2f 0a 20 ce decl end */.
1840: 20 20 20 58 4d 4c 5f 45 6e 64 4e 61 6d 65 73 70 XML_EndNamesp
1850: 61 63 65 44 65 63 6c 48 61 6e 64 6c 65 72 20 20 aceDeclHandler
1860: 20 20 20 20 65 6e 64 6e 73 64 65 63 6c 63 6f 6d endnsdeclcom
1870: 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 mand;. /* C f
1880: 75 6e 63 20 66 6f 72 20 70 72 6f 63 65 73 73 69 unc for processi
1890: 6e 67 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 2a ng instruction *
18a0: 2f 0a 20 20 20 20 58 4d 4c 5f 50 72 6f 63 65 73 /. XML_Proces
18b0: 73 69 6e 67 49 6e 73 74 72 75 63 74 69 6f 6e 48 singInstructionH
18c0: 61 6e 64 6c 65 72 20 70 69 63 6f 6d 6d 61 6e 64 andler picommand
18d0: 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 6e 63 20 ;. /* C func
18e0: 66 6f 72 20 64 65 66 61 75 6c 74 20 64 61 74 61 for default data
18f0: 20 2a 2f 0a 20 20 20 20 58 4d 4c 5f 44 65 66 61 */. XML_Defa
1900: 75 6c 74 48 61 6e 64 6c 65 72 20 20 20 20 20 20 ultHandler
1910: 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 default
1920: 63 6f 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 command;. /*
1930: 43 20 66 75 6e 63 20 66 6f 72 20 75 6e 70 61 72 C func for unpar
1940: 73 65 64 20 65 6e 74 69 74 79 20 64 65 63 6c 61 sed entity decla
1950: 72 61 74 69 6f 6e 20 2a 2f 0a 20 20 20 20 58 4d ration */. XM
1960: 4c 5f 4e 6f 74 61 74 69 6f 6e 44 65 63 6c 48 61 L_NotationDeclHa
1970: 6e 64 6c 65 72 20 20 20 20 20 20 20 20 20 20 6e ndler n
1980: 6f 74 61 74 69 6f 6e 63 6f 6d 6d 61 6e 64 3b 0a otationcommand;.
1990: 20 20 20 20 2f 2a 20 43 20 66 75 6e 63 20 66 6f /* C func fo
19a0: 72 20 65 78 74 65 72 6e 61 6c 20 65 6e 74 69 74 r external entit
19b0: 79 20 2a 2f 0a 20 20 20 20 58 4d 4c 5f 45 78 74 y */. XML_Ext
19c0: 65 72 6e 61 6c 45 6e 74 69 74 79 52 65 66 48 61 ernalEntityRefHa
19d0: 6e 64 6c 65 72 20 20 20 20 20 65 78 74 65 72 6e ndler extern
19e0: 61 6c 65 6e 74 69 74 79 63 6f 6d 6d 61 6e 64 3b alentitycommand;
19f0: 0a 20 20 20 20 2f 2a 20 43 20 66 75 6e 63 20 66 . /* C func f
1a00: 6f 72 20 75 6e 6b 6e 6f 77 6e 20 65 6e 63 6f 64 or unknown encod
1a10: 69 6e 67 20 2a 2f 0a 20 20 20 20 58 4d 4c 5f 55 ing */. XML_U
1a20: 6e 6b 6e 6f 77 6e 45 6e 63 6f 64 69 6e 67 48 61 nknownEncodingHa
1a30: 6e 64 6c 65 72 20 20 20 20 20 20 20 75 6e 6b 6e ndler unkn
1a40: 6f 77 6e 65 6e 63 6f 64 69 6e 67 63 6f 6d 6d 61 ownencodingcomma
1a50: 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 6e nd;. /* C fun
1a60: 63 20 66 6f 72 20 63 6f 6d 6d 65 6e 74 73 20 2a c for comments *
1a70: 2f 0a 20 20 20 20 58 4d 4c 5f 43 6f 6d 6d 65 6e /. XML_Commen
1a80: 74 48 61 6e 64 6c 65 72 20 20 20 20 20 20 20 20 tHandler
1a90: 20 20 20 20 20 20 20 63 6f 6d 6d 65 6e 74 43 6f commentCo
1aa0: 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 mmand;. /* C
1ab0: 66 75 6e 63 20 66 6f 72 20 22 6e 6f 74 20 73 74 func for "not st
1ac0: 61 6e 64 61 6c 6f 6e 65 22 20 64 6f 63 73 20 2a andalone" docs *
1ad0: 2f 0a 20 20 20 20 58 4d 4c 5f 4e 6f 74 53 74 61 /. XML_NotSta
1ae0: 6e 64 61 6c 6f 6e 65 48 61 6e 64 6c 65 72 20 20 ndaloneHandler
1af0: 20 20 20 20 20 20 20 6e 6f 74 53 74 61 6e 64 61 notStanda
1b00: 6c 6f 6e 65 43 6f 6d 6d 61 6e 64 3b 0a 20 20 20 loneCommand;.
1b10: 20 2f 2a 20 43 20 66 75 6e 63 20 66 6f 72 20 43 /* C func for C
1b20: 44 41 54 41 20 73 65 63 74 69 6f 6e 20 73 74 61 DATA section sta
1b30: 72 74 20 2a 2f 0a 20 20 20 20 58 4d 4c 5f 53 74 rt */. XML_St
1b40: 61 72 74 43 64 61 74 61 53 65 63 74 69 6f 6e 48 artCdataSectionH
1b50: 61 6e 64 6c 65 72 20 20 20 20 20 73 74 61 72 74 andler start
1b60: 43 64 61 74 61 53 65 63 74 69 6f 6e 43 6f 6d 6d CdataSectionComm
1b70: 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 and;. /* C fu
1b80: 6e 63 20 66 6f 72 20 43 44 41 54 41 20 73 65 63 nc for CDATA sec
1b90: 74 69 6f 6e 20 65 6e 64 20 2a 2f 0a 20 20 20 20 tion end */.
1ba0: 58 4d 4c 5f 45 6e 64 43 64 61 74 61 53 65 63 74 XML_EndCdataSect
1bb0: 69 6f 6e 48 61 6e 64 6c 65 72 20 20 20 20 20 20 ionHandler
1bc0: 20 65 6e 64 43 64 61 74 61 53 65 63 74 69 6f 6e endCdataSection
1bd0: 43 6f 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 Command;. /*
1be0: 43 20 66 75 6e 63 20 66 6f 72 20 21 45 4c 45 4d C func for !ELEM
1bf0: 45 4e 54 20 64 65 63 6c 27 73 20 2a 2f 0a 20 20 ENT decl's */.
1c00: 20 20 58 4d 4c 5f 45 6c 65 6d 65 6e 74 44 65 63 XML_ElementDec
1c10: 6c 48 61 6e 64 6c 65 72 20 20 20 20 20 20 20 20 lHandler
1c20: 20 20 20 65 6c 65 6d 65 6e 74 44 65 63 6c 43 6f elementDeclCo
1c30: 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 mmand;. /* C
1c40: 66 75 6e 63 20 66 6f 72 20 21 41 54 54 4c 49 53 func for !ATTLIS
1c50: 54 20 64 65 63 6c 27 73 20 2a 2f 0a 20 20 20 20 T decl's */.
1c60: 58 4d 4c 5f 41 74 74 6c 69 73 74 44 65 63 6c 48 XML_AttlistDeclH
1c70: 61 6e 64 6c 65 72 20 20 20 20 20 20 20 20 20 20 andler
1c80: 20 61 74 74 6c 69 73 74 44 65 63 6c 43 6f 6d 6d attlistDeclComm
1c90: 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 20 66 75 and;. /* C fu
1ca0: 6e 63 20 66 6f 72 20 21 44 4f 43 54 59 50 45 20 nc for !DOCTYPE
1cb0: 64 65 63 6c 27 73 20 2a 2f 0a 20 20 20 20 58 4d decl's */. XM
1cc0: 4c 5f 53 74 61 72 74 44 6f 63 74 79 70 65 44 65 L_StartDoctypeDe
1cd0: 63 6c 48 61 6e 64 6c 65 72 20 20 20 20 20 20 73 clHandler s
1ce0: 74 61 72 74 44 6f 63 74 79 70 65 44 65 63 6c 43 tartDoctypeDeclC
1cf0: 6f 6d 6d 61 6e 64 3b 0a 20 20 20 20 2f 2a 20 43 ommand;. /* C
1d00: 20 66 75 6e 63 20 66 6f 72 20 21 44 4f 43 54 59 func for !DOCTY
1d10: 50 45 20 64 65 63 6c 20 65 6e 64 73 20 2a 2f 0a PE decl ends */.
1d20: 20 20 20 20 58 4d 4c 5f 45 6e 64 44 6f 63 74 79 XML_EndDocty
1d30: 70 65 44 65 63 6c 48 61 6e 64 6c 65 72 20 20 20 peDeclHandler
1d40: 20 20 20 20 20 65 6e 64 44 6f 63 74 79 70 65 44 endDoctypeD
1d50: 65 63 6c 43 6f 6d 6d 61 6e 64 3b 0a 20 20 20 20 eclCommand;.
1d60: 2f 2a 20 43 20 66 75 6e 63 20 66 6f 72 20 21 45 /* C func for !E
1d70: 4e 54 49 54 59 20 64 65 63 6c 73 27 73 20 2a 2f NTITY decls's */
1d80: 0a 20 20 20 20 58 4d 4c 5f 45 6e 74 69 74 79 44 . XML_EntityD
1d90: 65 63 6c 48 61 6e 64 6c 65 72 20 20 20 20 20 20 eclHandler
1da0: 20 20 20 20 20 20 65 6e 74 69 74 79 44 65 63 6c entityDecl
1db0: 43 6f 6d 6d 61 6e 64 3b 0a 7d 20 43 48 61 6e 64 Command;.} CHand
1dc0: 6c 65 72 53 65 74 3b 0a 3c 2f 70 72 65 3e 3c 70 lerSet;.</pre><p
1dd0: 3e 54 68 65 20 74 79 70 65 73 20 61 6e 64 20 74 >The types and t
1de0: 68 65 20 61 72 67 75 6d 65 6e 74 73 20 6f 66 20 he arguments of
1df0: 74 68 65 20 65 76 65 6e 74 20 66 75 6e 63 74 69 the event functi
1e00: 6f 6e 73 20 28 58 4d 4c 5f 2a 29 20 61 72 65 20 ons (XML_*) are
1e10: 65 78 61 63 74 6c 79 0a 74 68 65 20 73 61 6d 65 exactly.the same
1e20: 20 6c 69 6b 65 20 74 68 65 20 65 78 70 61 74 20 like the expat
1e30: 6c 69 62 20 68 61 6e 64 6c 65 72 20 66 75 6e 63 lib handler func
1e40: 74 69 6f 6e 73 20 61 6e 64 20 64 65 73 63 72 69 tions and descri
1e50: 62 65 64 20 69 6e 20 64 65 74 61 69 6c 20 69 6e bed in detail in
1e60: 0a 65 78 70 61 74 2e 68 2c 20 73 65 65 20 74 68 .expat.h, see th
1e70: 65 72 65 2e 20 54 68 65 20 65 78 74 65 6e 73 69 ere. The extensi
1e80: 6f 6e 20 68 61 73 20 6f 6e 6c 79 20 74 6f 20 70 on has only to p
1e90: 72 6f 76 69 64 65 64 20 74 68 65 20 68 61 6e 64 rovided the hand
1ea0: 6c 65 72 20 66 75 6e 63 74 69 6f 6e 73 0a 6e 65 ler functions.ne
1eb0: 65 64 65 64 3b 20 69 74 27 73 20 70 65 72 66 65 eded; it's perfe
1ec0: 63 74 6c 79 20 4f 4b 20 74 6f 20 6c 65 61 76 65 ctly OK to leave
1ed0: 20 75 6e 75 73 65 64 20 68 61 6e 64 6c 65 72 20 unused handler
1ee0: 73 6c 6f 74 73 20 61 73 20 74 68 65 20 61 72 65 slots as the are
1ef0: 20 28 74 68 65 79 20 61 72 65 0a 69 6e 69 74 69 (they are.initi
1f00: 61 6c 69 7a 65 64 20 74 6f 20 4e 55 4c 4c 20 62 alized to NULL b
1f10: 79 20 43 48 61 6e 64 6c 65 72 53 65 74 43 72 65 y CHandlerSetCre
1f20: 61 74 65 29 2e 3c 2f 70 3e 3c 70 3e 54 68 65 20 ate).</p><p>The
1f30: 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 6e 61 6d <i class="m">nam
1f40: 65 3c 2f 69 3e 20 6f 66 20 74 68 69 73 20 73 74 e</i> of this st
1f50: 72 75 63 74 75 72 65 20 69 73 20 75 73 65 64 20 ructure is used
1f60: 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 65 20 to identify the
1f70: 68 61 6e 64 6c 65 72 20 73 65 74 2e 0a 3c 2f 70 handler set..</p
1f80: 3e 3c 70 3e 49 66 20 74 68 65 20 66 6c 61 67 20 ><p>If the flag
1f90: 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 69 67 6e <i class="m">ign
1fa0: 6f 72 65 57 68 69 74 65 43 44 41 54 41 73 3c 2f oreWhiteCDATAs</
1fb0: 69 3e 20 69 73 20 73 65 74 2c 20 65 6c 65 6d 65 i> is set, eleme
1fc0: 6e 74 20 63 6f 6e 74 65 6e 74 20 77 68 69 63 68 nt content which
1fd0: 0a 63 6f 6e 74 61 69 6e 20 6f 6e 6c 79 20 77 68 .contain only wh
1fe0: 69 74 65 73 70 61 63 65 20 69 73 6e 27 74 20 72 itespace isn't r
1ff0: 65 70 6f 72 74 65 64 20 77 69 74 68 20 74 68 65 eported with the
2000: 20 64 61 74 61 63 6f 6d 6d 61 6e 64 2e 20 20 3c datacommand. <
2010: 2f 70 3e 3c 70 3e 54 68 65 20 3c 69 20 63 6c 61 /p><p>The <i cla
2020: 73 73 3d 22 6d 22 3e 75 73 65 72 44 61 74 61 3c ss="m">userData<
2030: 2f 69 3e 20 65 6c 65 6d 65 6e 74 20 70 6f 69 6e /i> element poin
2040: 74 73 20 74 6f 20 74 68 65 20 68 61 6e 64 6c 65 ts to the handle
2050: 72 20 73 65 74 20 73 70 65 63 69 66 69 63 20 64 r set specific d
2060: 61 74 61 2e 20 54 68 65 0a 65 76 65 6e 74 20 68 ata. The.event h
2070: 61 6e 64 6c 65 72 20 66 75 6e 63 74 69 6f 6e 73 andler functions
2080: 20 61 72 65 20 63 61 6c 6c 65 64 20 77 69 74 68 are called with
2090: 20 74 68 69 73 20 70 6f 69 6e 74 65 72 20 61 73 this pointer as
20a0: 20 75 73 65 72 44 61 74 61 20 61 72 67 75 6d 65 userData argume
20b0: 6e 74 2e 0a 3c 2f 70 3e 3c 70 3e 0a 3c 69 20 63 nt..</p><p>.<i c
20c0: 6c 61 73 73 3d 22 6d 22 3e 72 65 73 65 74 50 72 lass="m">resetPr
20d0: 6f 63 3c 2f 69 3e 20 61 6e 64 20 3c 69 20 63 6c oc</i> and <i cl
20e0: 61 73 73 3d 22 6d 22 3e 66 72 65 65 50 72 6f 63 ass="m">freeProc
20f0: 3c 2f 69 3e 20 6d 75 73 74 20 68 61 76 65 20 61 </i> must have a
2100: 72 67 75 6d 65 6e 74 73 20 74 68 61 74 20 6d 61 rguments that ma
2110: 74 63 68 20 74 68 65 0a 74 79 70 65 3c 2f 70 3e tch the.type</p>
2120: 3c 70 72 65 20 63 6c 61 73 73 3d 22 73 79 6e 74 <pre class="synt
2130: 61 78 22 3e 76 6f 69 64 20 28 54 63 6c 5f 49 6e ax">void (Tcl_In
2140: 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 76 6f terp *interp, vo
2150: 69 64 20 2a 75 73 65 72 44 61 74 61 29 3c 2f 70 id *userData)</p
2160: 72 65 3e 3c 70 3e 0a 3c 69 20 63 6c 61 73 73 3d re><p>.<i class=
2170: 22 6d 22 3e 72 65 73 65 74 50 72 6f 63 3c 2f 69 "m">resetProc</i
2180: 3e 20 69 73 20 63 61 6c 6c 65 64 20 69 6e 20 63 > is called in c
2190: 61 73 65 20 74 68 65 20 70 61 72 73 65 72 20 69 ase the parser i
21a0: 73 20 72 65 73 65 74 20 77 69 74 68 0a 3c 74 74 s reset with.<tt
21b0: 20 63 6c 61 73 73 3d 22 73 61 6d 70 22 3e 26 6c class="samp">&l
21c0: 74 3b 70 61 72 73 65 72 4f 62 6a 26 67 74 3b 20 t;parserObj>
21d0: 72 65 73 65 74 3c 2f 74 74 3e 20 61 6e 64 20 73 reset</tt> and s
21e0: 68 6f 75 6c 64 20 64 6f 20 61 6e 79 20 6e 65 63 hould do any nec
21f0: 65 73 73 61 72 79 20 63 6c 65 61 6e 75 70 20 61 essary cleanup a
2200: 6e 64 0a 72 65 69 6e 69 74 69 61 6c 69 7a 69 6e nd.reinitializin
2210: 67 20 74 6f 20 70 72 65 70 61 72 65 20 74 68 65 g to prepare the
2220: 20 43 20 68 61 6e 64 6c 65 72 20 73 65 74 20 66 C handler set f
2230: 6f 72 20 61 20 6e 65 77 20 58 4d 4c 20 64 6f 63 or a new XML doc
2240: 75 6d 65 6e 74 2e 20 54 68 65 0a 3c 69 20 63 6c ument. The.<i cl
2250: 61 73 73 3d 22 6d 22 3e 66 72 65 65 50 72 6f 63 ass="m">freeProc
2260: 3c 2f 69 3e 20 69 73 20 63 61 6c 6c 65 64 2c 20 </i> is called,
2270: 69 66 20 74 68 65 20 70 61 72 73 65 72 20 69 73 if the parser is
2280: 20 64 65 6c 65 74 65 64 20 61 6e 64 20 73 68 6f deleted and sho
2290: 75 6c 64 20 64 6f 20 6d 65 6d 6f 72 79 0a 63 6c uld do memory.cl
22a0: 65 61 6e 75 70 20 65 74 63 2e 20 20 3c 2f 70 3e eanup etc. </p>
22b0: 3c 70 3e 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 <p> <i class="m"
22c0: 3e 43 48 61 6e 64 6c 65 72 53 65 74 43 72 65 61 >CHandlerSetCrea
22d0: 74 65 3c 2f 69 3e 20 63 72 65 61 74 65 20 61 20 te</i> create a
22e0: 43 20 68 61 6e 64 6c 65 72 20 73 65 74 2c 20 67 C handler set, g
22f0: 69 76 65 73 20 69 74 20 74 68 65 20 6e 61 6d 65 ives it the name
2300: 0a 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 6e 61 .<i class="m">na
2310: 6d 65 3c 2f 69 3e 20 61 6e 64 20 69 6e 69 74 69 me</i> and initi
2320: 61 6c 69 7a 65 73 20 61 6e 79 20 6f 74 68 65 72 alizes any other
2330: 20 65 6c 65 6d 65 6e 74 20 77 69 74 68 20 4e 55 element with NU
2340: 4c 4c 2e 3c 2f 70 3e 3c 70 3e 20 3c 69 20 63 6c LL.</p><p> <i cl
2350: 61 73 73 3d 22 6d 22 3e 43 48 61 6e 64 6c 65 72 ass="m">CHandler
2360: 53 65 74 49 6e 73 74 61 6c 6c 3c 2f 69 3e 20 61 SetInstall</i> a
2370: 64 64 73 20 74 68 65 20 3c 69 20 63 6c 61 73 73 dds the <i class
2380: 3d 22 6d 22 3e 68 61 6e 64 6c 65 72 53 65 74 3c ="m">handlerSet<
2390: 2f 69 3e 20 74 6f 20 74 68 65 20 70 61 72 73 65 /i> to the parse
23a0: 72 0a 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 65 r.<i class="m">e
23b0: 78 70 61 74 4f 62 6a 3c 2f 69 3e 2e 20 54 68 65 xpatObj</i>. The
23c0: 20 70 61 72 73 65 72 20 68 61 73 20 74 6f 20 62 parser has to b
23d0: 65 20 61 20 74 44 4f 4d 20 54 63 6c 20 65 78 70 e a tDOM Tcl exp
23e0: 61 74 20 70 61 72 73 65 72 20 6f 62 6a 65 63 74 at parser object
23f0: 20 69 6e 20 74 68 65 0a 69 6e 74 65 72 70 72 65 in the.interpre
2400: 74 65 72 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 ter <i class="m"
2410: 3e 69 6e 74 65 72 70 3c 2f 69 3e 2e 20 54 68 65 >interp</i>. The
2420: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 43 20 68 name of the C h
2430: 61 6e 64 6c 65 72 20 73 65 74 20 68 61 73 20 74 andler set has t
2440: 6f 20 62 65 20 75 6e 69 71 75 65 20 66 6f 72 0a o be unique for.
2450: 74 68 65 20 70 61 72 73 65 72 2e 20 52 65 74 75 the parser. Retu
2460: 72 6e 73 20 30 20 69 6e 20 63 61 73 65 20 6f 66 rns 0 in case of
2470: 20 73 75 63 63 65 73 73 2e 20 52 65 74 75 72 6e success. Return
2480: 73 20 31 20 69 66 20 3c 69 20 63 6c 61 73 73 3d s 1 if <i class=
2490: 22 6d 22 3e 65 78 70 61 74 4f 62 6a 3c 2f 69 3e "m">expatObj</i>
24a0: 20 69 73 6e 27 74 20 61 0a 70 61 72 73 65 72 20 isn't a.parser
24b0: 6f 62 6a 65 63 74 20 69 6e 20 74 68 65 20 69 6e object in the in
24c0: 74 65 72 70 72 65 74 65 72 20 3c 69 20 63 6c 61 terpreter <i cla
24d0: 73 73 3d 22 6d 22 3e 69 6e 74 65 72 70 3c 2f 69 ss="m">interp</i
24e0: 3e 2e 20 52 65 74 75 72 6e 73 20 32 20 69 66 20 >. Returns 2 if
24f0: 74 68 69 73 20 70 61 72 73 65 72 20 68 61 73 0a this parser has.
2500: 61 6c 72 65 61 64 79 20 61 20 43 20 68 61 6e 64 already a C hand
2510: 6c 65 72 20 73 65 74 20 77 69 74 68 20 74 68 65 ler set with the
2520: 20 68 61 6e 64 6c 65 72 53 65 74 20 6e 61 6d 65 handlerSet name
2530: 2e 3c 2f 70 3e 3c 70 3e 20 3c 69 20 63 6c 61 73 .</p><p> <i clas
2540: 73 3d 22 6d 22 3e 43 48 61 6e 64 6c 65 72 53 65 s="m">CHandlerSe
2550: 74 52 65 6d 6f 76 65 3c 2f 69 3e 20 72 65 6d 6f tRemove</i> remo
2560: 76 65 73 20 74 68 65 20 43 20 68 61 6e 64 6c 65 ves the C handle
2570: 72 20 73 65 74 20 72 65 66 65 72 65 6e 63 65 64 r set referenced
2580: 20 62 79 20 74 68 65 0a 3c 69 20 63 6c 61 73 73 by the.<i class
2590: 3d 22 6d 22 3e 68 61 6e 64 6c 65 72 53 65 74 4e ="m">handlerSetN
25a0: 61 6d 65 3c 2f 69 3e 20 66 72 6f 6d 20 74 68 65 ame</i> from the
25b0: 20 70 61 72 73 65 72 20 3c 69 20 63 6c 61 73 73 parser <i class
25c0: 3d 22 6d 22 3e 65 78 70 61 74 4f 62 6a 3c 2f 69 ="m">expatObj</i
25d0: 3e 2e 20 54 68 65 20 70 61 72 73 65 72 20 68 61 >. The parser ha
25e0: 73 20 74 6f 20 62 65 20 61 0a 74 44 4f 4d 20 54 s to be a.tDOM T
25f0: 63 6c 20 65 78 70 61 74 20 70 61 72 73 65 72 20 cl expat parser
2600: 6f 62 6a 65 63 74 20 69 6e 20 74 68 65 20 69 6e object in the in
2610: 74 65 72 70 72 65 74 65 72 0a 3c 69 20 63 6c 61 terpreter.<i cla
2620: 73 73 3d 22 6d 22 3e 69 6e 74 65 72 70 3c 2f 69 ss="m">interp</i
2630: 3e 2e 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e >. <i class="m">
2640: 43 48 61 6e 64 6c 65 72 53 65 74 52 65 6d 6f 76 CHandlerSetRemov
2650: 65 3c 2f 69 3e 20 63 61 6c 6c 73 20 74 68 65 20 e</i> calls the
2660: 66 72 65 65 50 72 6f 63 20 66 75 6e 63 74 69 6f freeProc functio
2670: 6e 20 6f 66 20 74 68 65 20 43 0a 68 61 6e 64 6c n of the C.handl
2680: 65 72 20 73 65 74 20 73 74 72 75 63 74 75 72 65 er set structure
2690: 2c 20 72 65 6d 6f 76 65 73 20 74 68 65 20 68 61 , removes the ha
26a0: 6e 64 6c 65 72 20 73 65 74 20 66 72 6f 6d 20 74 ndler set from t
26b0: 68 65 20 43 20 68 61 6e 64 6c 65 72 20 73 65 74 he C handler set
26c0: 20 6c 69 73 74 20 61 6e 64 0a 66 72 65 65 73 20 list and.frees
26d0: 74 68 65 20 68 61 6e 64 6c 65 72 20 73 74 72 75 the handler stru
26e0: 63 74 75 72 65 2e 20 52 65 74 75 72 6e 73 20 30 cture. Returns 0
26f0: 20 69 6e 20 63 61 73 65 20 6f 66 20 73 75 63 63 in case of succ
2700: 65 73 73 2e 20 52 65 74 75 72 6e 73 20 31 20 69 ess. Returns 1 i
2710: 66 0a 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 65 f.<i class="m">e
2720: 78 70 61 74 4f 62 6a 3c 2f 69 3e 20 69 73 6e 27 xpatObj</i> isn'
2730: 74 20 61 20 70 61 72 73 65 72 20 6f 62 6a 65 63 t a parser objec
2740: 74 20 69 6e 20 74 68 65 20 69 6e 74 65 72 70 72 t in the interpr
2750: 65 74 65 72 20 3c 69 20 63 6c 61 73 73 3d 22 6d eter <i class="m
2760: 22 3e 69 6e 74 65 72 70 3c 2f 69 3e 2e 20 52 65 ">interp</i>. Re
2770: 74 75 72 6e 73 0a 32 20 69 66 20 74 68 69 73 20 turns.2 if this
2780: 70 61 72 73 65 72 20 68 61 73 6e 27 74 20 61 20 parser hasn't a
2790: 43 20 68 61 6e 64 6c 65 72 20 73 65 74 20 6e 61 C handler set na
27a0: 6d 65 64 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 med <i class="m"
27b0: 3e 68 61 6e 64 6c 65 72 53 65 74 4e 61 6d 65 3c >handlerSetName<
27c0: 2f 69 3e 2e 3c 2f 70 3e 3c 70 3e 0a 3c 69 20 63 /i>.</p><p>.<i c
27d0: 6c 61 73 73 3d 22 6d 22 3e 43 68 65 63 6b 45 78 lass="m">CheckEx
27e0: 70 61 74 50 61 72 73 65 72 4f 62 6a 3c 2f 69 3e patParserObj</i>
27f0: 20 72 65 74 75 72 6e 73 20 31 2c 20 69 66 20 3c returns 1, if <
2800: 69 20 63 6c 61 73 73 3d 22 6d 22 3e 6e 61 6d 65 i class="m">name
2810: 4f 62 6a 3c 2f 69 3e 20 69 73 20 61 20 74 44 4f Obj</i> is a tDO
2820: 4d 20 54 63 6c 20 65 78 70 61 74 0a 70 61 72 73 M Tcl expat.pars
2830: 65 72 20 6f 62 6a 65 63 74 20 69 6e 20 74 68 65 er object in the
2840: 20 69 6e 74 65 72 70 72 65 74 65 72 20 3c 69 20 interpreter <i
2850: 63 6c 61 73 73 3d 22 6d 22 3e 69 6e 74 65 72 70 class="m">interp
2860: 3c 2f 69 3e 2c 20 6f 74 68 65 72 77 69 73 65 20 </i>, otherwise
2870: 69 74 20 72 65 74 75 72 6e 73 0a 30 2e 20 45 78 it returns.0. Ex
2880: 61 6d 70 6c 65 3a 3c 2f 70 3e 3c 70 72 65 20 63 ample:</p><pre c
2890: 6c 61 73 73 3d 22 65 78 61 6d 70 6c 65 22 3e 0a lass="example">.
28a0: 69 6e 74 0a 54 63 6c 45 78 61 6d 70 6c 65 4f 62 int.TclExampleOb
28b0: 6a 43 6d 64 28 64 75 6d 6d 79 2c 20 69 6e 74 65 jCmd(dummy, inte
28c0: 72 70 2c 20 6f 62 6a 63 2c 20 6f 62 6a 76 29 0a rp, objc, objv).
28d0: 20 20 20 20 20 43 6c 69 65 6e 74 44 61 74 61 20 ClientData
28e0: 64 75 6d 6d 79 3b 0a 20 20 20 20 20 54 63 6c 5f dummy;. Tcl_
28f0: 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 3b 0a Interp *interp;.
2900: 20 20 20 20 20 69 6e 74 20 6f 62 6a 63 3b 0a 20 int objc;.
2910: 20 20 20 20 54 63 6c 5f 4f 62 6a 20 2a 63 6f 6e Tcl_Obj *con
2920: 73 74 20 6f 62 6a 76 5b 5d 3b 0a 7b 0a 20 20 20 st objv[];.{.
2930: 20 63 68 61 72 20 20 20 20 20 20 20 20 20 20 2a char *
2940: 6d 65 74 68 6f 64 3b 0a 20 20 20 20 43 48 61 6e method;. CHan
2950: 64 6c 65 72 53 65 74 20 20 20 2a 68 61 6e 64 6c dlerSet *handl
2960: 65 72 53 65 74 3b 0a 20 20 20 20 69 6e 74 20 20 erSet;. int
2970: 20 20 20 20 20 20 20 20 20 20 6d 65 74 68 6f 64 method
2980: 49 6e 64 65 78 2c 20 72 65 73 75 6c 74 3b 0a 20 Index, result;.
2990: 20 20 20 73 69 6d 70 6c 65 43 6f 75 6e 74 65 72 simpleCounter
29a0: 20 2a 63 6f 75 6e 74 65 72 3b 0a 20 20 20 20 0a *counter;. .
29b0: 0a 20 20 20 20 73 74 61 74 69 63 20 63 68 61 72 . static char
29c0: 20 2a 65 78 61 6d 70 6c 65 4d 65 74 68 6f 64 73 *exampleMethods
29d0: 5b 5d 20 3d 20 7b 0a 20 20 20 20 20 20 20 20 22 [] = {. "
29e0: 65 6e 61 62 6c 65 22 2c 20 22 67 65 74 72 65 73 enable", "getres
29f0: 75 6c 74 22 2c 20 22 72 65 6d 6f 76 65 22 2c 0a ult", "remove",.
2a00: 20 20 20 20 20 20 20 20 4e 55 4c 4c 0a 20 20 20 NULL.
2a10: 20 7d 3b 0a 20 20 20 20 65 6e 75 6d 20 65 78 61 };. enum exa
2a20: 6d 70 6c 65 4d 65 74 68 6f 64 20 7b 0a 20 20 20 mpleMethod {.
2a30: 20 20 20 20 20 6d 5f 65 6e 61 62 6c 65 2c 20 6d m_enable, m
2a40: 5f 67 65 74 72 65 73 75 6c 74 2c 20 6d 5f 72 65 _getresult, m_re
2a50: 6d 6f 76 65 0a 20 20 20 20 7d 3b 0a 0a 20 20 20 move. };..
2a60: 20 69 66 20 28 6f 62 6a 63 20 21 3d 20 33 29 20 if (objc != 3)
2a70: 7b 0a 20 20 20 20 20 20 20 20 54 63 6c 5f 57 72 {. Tcl_Wr
2a80: 6f 6e 67 4e 75 6d 41 72 67 73 20 28 69 6e 74 65 ongNumArgs (inte
2a90: 72 70 2c 20 31 2c 20 6f 62 6a 76 2c 20 65 78 61 rp, 1, objv, exa
2aa0: 6d 70 6c 65 5f 75 73 61 67 65 29 3b 0a 20 20 20 mple_usage);.
2ab0: 20 20 20 20 20 72 65 74 75 72 6e 20 54 43 4c 5f return TCL_
2ac0: 45 52 52 4f 52 3b 0a 20 20 20 20 7d 0a 0a 20 20 ERROR;. }..
2ad0: 20 20 69 66 20 28 21 43 68 65 63 6b 45 78 70 61 if (!CheckExpa
2ae0: 74 50 61 72 73 65 72 4f 62 6a 20 28 69 6e 74 65 tParserObj (inte
2af0: 72 70 2c 20 6f 62 6a 76 5b 31 5d 29 29 20 7b 0a rp, objv[1])) {.
2b00: 20 20 20 20 20 20 20 20 54 63 6c 5f 53 65 74 52 Tcl_SetR
2b10: 65 73 75 6c 74 20 28 69 6e 74 65 72 70 2c 20 22 esult (interp, "
2b20: 46 69 72 73 74 20 61 72 67 75 6d 65 6e 74 20 68 First argument h
2b30: 61 73 20 74 6f 20 62 65 20 61 20 65 78 70 61 74 as to be a expat
2b40: 20 70 61 72 73 65 72 20 6f 62 6a 65 63 74 22 2c parser object",
2b50: 20 4e 55 4c 4c 29 3b 0a 20 20 20 20 20 20 20 20 NULL);.
2b60: 72 65 74 75 72 6e 20 54 43 4c 5f 45 52 52 4f 52 return TCL_ERROR
2b70: 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2a 20 2e ;. }. /* .
2b80: 2e 2e 20 2a 2f 0a 3c 2f 70 72 65 3e 3c 70 3e 20 .. */.</pre><p>
2b90: 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 43 48 61 <i class="m">CHa
2ba0: 6e 64 6c 65 72 53 65 74 47 65 74 3c 2f 69 3e 20 ndlerSetGet</i>
2bb0: 72 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 returns a pointe
2bc0: 72 20 74 6f 20 74 68 65 20 43 20 68 61 6e 64 6c r to the C handl
2bd0: 65 72 20 53 65 74 20 72 65 66 65 72 65 6e 63 65 er Set reference
2be0: 64 0a 62 79 20 74 68 65 20 6e 61 6d 65 20 3c 69 d.by the name <i
2bf0: 20 63 6c 61 73 73 3d 22 6d 22 3e 68 61 6e 64 6c class="m">handl
2c00: 65 72 53 65 74 4e 61 6d 65 3c 2f 69 3e 20 6f 66 erSetName</i> of
2c10: 20 74 68 65 20 70 61 72 73 65 72 20 6f 62 6a 65 the parser obje
2c20: 63 74 0a 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e ct.<i class="m">
2c30: 65 78 70 61 74 4f 62 6a 3c 2f 69 3e 2e 20 3c 69 expatObj</i>. <i
2c40: 20 63 6c 61 73 73 3d 22 6d 22 3e 65 78 70 61 74 class="m">expat
2c50: 4f 62 6a 3c 2f 69 3e 20 68 61 73 20 74 6f 20 62 Obj</i> has to b
2c60: 65 20 61 6e 20 65 78 70 61 74 20 70 61 72 73 65 e an expat parse
2c70: 72 20 6f 62 6a 65 63 74 20 69 6e 20 74 68 65 0a r object in the.
2c80: 69 6e 74 65 72 70 72 65 74 65 72 20 3c 69 20 63 interpreter <i c
2c90: 6c 61 73 73 3d 22 6d 22 3e 69 6e 74 65 72 70 3c lass="m">interp<
2ca0: 2f 69 3e 2e 20 52 65 74 75 72 6e 73 20 4e 55 4c /i>. Returns NUL
2cb0: 4c 20 69 6e 20 63 61 73 65 20 6f 66 20 65 72 72 L in case of err
2cc0: 6f 72 2e 3c 2f 70 3e 3c 70 3e 0a 3c 69 20 63 6c or.</p><p>.<i cl
2cd0: 61 73 73 3d 22 6d 22 3e 43 48 61 6e 64 6c 65 72 ass="m">CHandler
2ce0: 53 65 74 47 65 74 55 73 65 72 44 61 74 61 3c 2f SetGetUserData</
2cf0: 69 3e 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69 i> returns a poi
2d00: 6e 74 65 72 20 74 6f 20 74 68 65 20 75 73 65 72 nter to the user
2d10: 44 61 74 61 20 6f 66 20 74 68 65 20 43 0a 68 61 Data of the C.ha
2d20: 6e 64 6c 65 72 20 73 65 74 20 72 65 66 65 72 65 ndler set refere
2d30: 6e 63 65 64 20 62 79 20 74 68 65 20 6e 61 6d 65 nced by the name
2d40: 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 68 61 <i class="m">ha
2d50: 6e 64 6c 65 72 53 65 74 4e 61 6d 65 3c 2f 69 3e ndlerSetName</i>
2d60: 20 6f 66 20 74 68 65 20 70 61 72 73 65 72 20 6f of the parser o
2d70: 62 6a 65 63 74 0a 3c 69 20 63 6c 61 73 73 3d 22 bject.<i class="
2d80: 6d 22 3e 65 78 70 61 74 4f 62 6a 3c 2f 69 3e 2e m">expatObj</i>.
2d90: 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 65 78 <i class="m">ex
2da0: 70 61 74 4f 62 6a 3c 2f 69 3e 20 68 61 73 20 74 patObj</i> has t
2db0: 6f 20 62 65 20 61 6e 20 65 78 70 61 74 20 70 61 o be an expat pa
2dc0: 72 73 65 72 20 6f 62 6a 65 63 74 20 69 6e 20 74 rser object in t
2dd0: 68 65 0a 69 6e 74 65 72 70 72 65 74 65 72 20 3c he.interpreter <
2de0: 69 20 63 6c 61 73 73 3d 22 6d 22 3e 69 6e 74 65 i class="m">inte
2df0: 72 70 3c 2f 69 3e 2e 20 52 65 74 75 72 6e 73 20 rp</i>. Returns
2e00: 4e 55 4c 4c 20 69 6e 20 63 61 73 65 20 6f 66 20 NULL in case of
2e10: 65 72 72 6f 72 2e 3c 2f 70 3e 3c 70 3e 20 3c 69 error.</p><p> <i
2e20: 20 63 6c 61 73 73 3d 22 6d 22 3e 47 65 74 45 78 class="m">GetEx
2e30: 70 61 74 49 6e 66 6f 3c 2f 69 3e 20 49 73 20 61 patInfo</i> Is a
2e40: 20 68 65 6c 70 65 72 20 66 75 6e 63 74 69 6f 6e helper function
2e50: 20 74 68 61 74 20 72 65 74 75 72 6e 73 20 61 20 that returns a
2e60: 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 0a 54 pointer to the.T
2e70: 63 6c 47 65 6e 45 78 70 61 74 49 6e 66 6f 20 73 clGenExpatInfo s
2e80: 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20 tructure of the
2e90: 74 44 4f 4d 20 54 63 6c 20 65 78 70 61 74 20 70 tDOM Tcl expat p
2ea0: 61 72 73 65 72 20 6f 62 6a 65 63 74 0a 3c 69 20 arser object.<i
2eb0: 63 6c 61 73 73 3d 22 6d 22 3e 65 78 70 61 74 4f class="m">expatO
2ec0: 62 6a 3c 2f 69 3e 2e 20 54 68 65 20 3c 69 20 63 bj</i>. The <i c
2ed0: 6c 61 73 73 3d 22 6d 22 3e 65 78 70 61 74 4f 62 lass="m">expatOb
2ee0: 6a 3c 2f 69 3e 20 68 61 73 20 74 6f 20 62 65 20 j</i> has to be
2ef0: 61 20 74 44 4f 4d 20 54 63 6c 20 65 78 70 61 74 a tDOM Tcl expat
2f00: 20 70 61 72 73 65 72 20 6f 62 6a 65 63 74 0a 69 parser object.i
2f10: 6e 20 74 68 65 20 69 6e 74 65 72 70 72 65 74 65 n the interprete
2f20: 72 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 69 r <i class="m">i
2f30: 6e 74 65 72 70 3c 2f 69 3e 2e 20 54 68 69 73 20 nterp</i>. This
2f40: 69 73 20 6d 6f 73 74 20 75 73 65 66 75 6c 2c 20 is most useful,
2f50: 74 6f 20 73 65 74 20 74 68 65 20 61 70 70 6c 69 to set the appli
2f60: 63 61 74 69 6f 6e 0a 73 74 61 74 75 73 20 6f 66 cation.status of
2f70: 20 74 68 65 20 70 61 72 73 65 72 20 6f 62 6a 65 the parser obje
2f80: 63 74 2e 3c 2f 70 3e 3c 70 3e 53 65 65 20 74 68 ct.</p><p>See th
2f90: 65 20 73 69 6d 70 6c 65 20 62 75 74 20 66 75 6c e simple but ful
2fa0: 6c 20 66 75 6e 63 74 69 6f 6e 61 6c 6c 79 20 65 l functionally e
2fb0: 78 61 6d 70 6c 65 20 69 6e 20 74 68 65 20 65 78 xample in the ex
2fc0: 74 65 6e 73 69 6f 6e 73 2f 65 78 61 6d 70 6c 65 tensions/example
2fd0: 0a 64 69 72 20 6f 72 20 74 68 65 20 6d 6f 72 65 .dir or the more
2fe0: 20 63 6f 6d 70 6c 65 78 20 65 78 61 6d 70 6c 65 complex example
2ff0: 20 74 6e 63 20 69 6e 20 74 68 65 20 65 78 74 65 tnc in the exte
3000: 6e 73 69 6f 6e 73 2f 74 6e 63 20 64 69 72 20 28 nsions/tnc dir (
3010: 61 20 73 69 6d 70 6c 65 20 44 54 44 0a 76 61 6c a simple DTD.val
3020: 69 64 61 74 69 6f 6e 20 65 78 74 65 6e 73 69 6f idation extensio
3030: 6e 29 2e 3c 2f 70 3e 0a 0a 20 20 3c 68 32 3e 3c n).</p>.. <h2><
3040: 61 20 6e 61 6d 65 3d 22 53 45 43 54 69 64 30 78 a name="SECTid0x
3050: 31 65 61 36 30 38 30 22 3e 53 45 45 20 41 4c 53 1ea6080">SEE ALS
3060: 4f 3c 2f 61 3e 3c 2f 68 32 3e 3c 70 20 63 6c 61 O</a></h2><p cla
3070: 73 73 3d 22 73 65 65 61 6c 73 6f 22 3e 65 78 70 ss="seealso">exp
3080: 61 74 3c 2f 70 3e 0a 0a 20 20 3c 68 32 3e 3c 61 at</p>.. <h2><a
3090: 20 6e 61 6d 65 3d 22 53 45 43 54 69 64 30 78 31 name="SECTid0x1
30a0: 65 61 36 33 32 30 22 3e 4b 45 59 57 4f 52 44 53 ea6320">KEYWORDS
30b0: 3c 2f 61 3e 3c 2f 68 32 3e 3c 70 20 63 6c 61 73 </a></h2><p clas
30c0: 73 3d 22 6b 65 79 77 6f 72 64 73 22 3e 3c 61 20 s="keywords"><a
30d0: 63 6c 61 73 73 3d 22 6b 65 79 77 6f 72 64 22 20 class="keyword"
30e0: 68 72 65 66 3d 22 6b 65 79 77 6f 72 64 2d 69 6e href="keyword-in
30f0: 64 65 78 2e 68 74 6d 6c 23 4b 57 2d 43 68 61 6e dex.html#KW-Chan
3100: 64 6c 65 72 73 65 74 22 3e 43 20 68 61 6e 64 6c dlerset">C handl
3110: 65 72 20 73 65 74 3c 2f 61 3e 3c 2f 70 3e 0a 3c er set</a></p>.<
3120: 2f 64 69 76 3e 3c 68 72 20 63 6c 61 73 73 3d 22 /div><hr class="
3130: 6e 61 76 73 65 70 22 3e 3c 64 69 76 20 63 6c 61 navsep"><div cla
3140: 73 73 3d 22 6e 61 76 62 61 72 22 20 61 6c 69 67 ss="navbar" alig
3150: 6e 3d 22 63 65 6e 74 65 72 22 3e 0a 3c 61 20 63 n="center">.<a c
3160: 6c 61 73 73 3d 22 6e 61 76 61 69 64 22 20 68 72 lass="navaid" hr
3170: 65 66 3d 22 69 6e 64 65 78 2e 68 74 6d 6c 22 3e ef="index.html">
3180: 43 6f 6e 74 65 6e 74 73 3c 2f 61 3e 20 c2 b7 20 Contents</a> ·
3190: 3c 61 20 63 6c 61 73 73 3d 22 6e 61 76 61 69 64 <a class="navaid
31a0: 22 20 68 72 65 66 3d 22 63 61 74 65 67 6f 72 79 " href="category
31b0: 2d 69 6e 64 65 78 2e 68 74 6d 6c 22 3e 49 6e 64 -index.html">Ind
31c0: 65 78 3c 2f 61 3e 20 c2 b7 20 3c 61 20 63 6c 61 ex</a> · <a cla
31d0: 73 73 3d 22 6e 61 76 61 69 64 22 20 68 72 65 66 ss="navaid" href
31e0: 3d 22 6b 65 79 77 6f 72 64 2d 69 6e 64 65 78 2e ="keyword-index.
31f0: 68 74 6d 6c 22 3e 4b 65 79 77 6f 72 64 73 3c 2f html">Keywords</
3200: 61 3e 20 c2 b7 20 3c 61 20 63 6c 61 73 73 3d 22 a> · <a class="
3210: 6e 61 76 61 69 64 22 20 68 72 65 66 3d 22 68 74 navaid" href="ht
3220: 74 70 3a 2f 2f 74 64 6f 6d 2e 6f 72 67 22 3e 52 tp://tdom.org">R
3230: 65 70 6f 73 69 74 6f 72 79 3c 2f 61 3e 0a 3c 2f epository</a>.</
3240: 64 69 76 3e 0a 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 div>.</body>.</h
3250: 74 6d 6c 3e 0a tml>.