tDOM

Hex Artifact Content
Login

Hex Artifact Content

Artifact e7b5071878f8e3d9f818054e00dac627b82c40ec60a9aa362b8a3b1be763598e:


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 3c 2f 74 69 74 6c 65 3e 3c 6d 65 74 61 20 6e  t</title><meta n
0060: 61 6d 65 3d 22 78 73 6c 2d 70 72 6f 63 65 73 73  ame="xsl-process
0070: 6f 72 22 20 63 6f 6e 74 65 6e 74 3d 22 4a 6f 63  or" content="Joc
0080: 68 65 6e 20 4c 6f 65 77 65 72 20 28 6c 6f 65 77  hen Loewer (loew
0090: 65 72 6a 40 68 6f 74 6d 61 69 6c 2e 63 6f 6d 29  erj@hotmail.com)
00a0: 2c 20 52 6f 6c 66 20 41 64 65 20 28 72 6f 6c 66  , Rolf Ade (rolf
00b0: 40 70 6f 69 6e 74 73 6d 61 6e 2e 64 65 29 20 65  @pointsman.de) e
00c0: 74 2e 20 61 6c 2e 22 3e 3c 6d 65 74 61 20 6e 61  t. al."><meta na
00d0: 6d 65 3d 22 67 65 6e 65 72 61 74 6f 72 22 20 63  me="generator" c
00e0: 6f 6e 74 65 6e 74 3d 22 24 52 43 53 66 69 6c 65  ontent="$RCSfile
00f0: 3a 20 74 6d 6d 6c 2d 68 74 6d 6c 2e 78 73 6c 2c  : tmml-html.xsl,
0100: 76 20 24 20 24 52 65 76 69 73 69 6f 6e 3a 20 31  v $ $Revision: 1
0110: 2e 31 31 20 24 22 3e 3c 6d 65 74 61 20 63 68 61  .11 $"><meta cha
0120: 72 73 65 74 3d 22 75 74 66 2d 38 22 3e 0a 3c 2f  rset="utf-8">.</
0130: 68 65 61 64 3e 3c 62 6f 64 79 3e 0a 3c 64 69 76  head><body>.<div
0140: 20 63 6c 61 73 73 3d 22 68 65 61 64 65 72 22 3e   class="header">
0150: 0a 3c 64 69 76 20 63 6c 61 73 73 3d 22 6e 61 76  .<div class="nav
0160: 62 61 72 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74  bar" align="cent
0170: 65 72 22 3e 0a 3c 61 20 68 72 65 66 3d 22 23 53  er">.<a href="#S
0180: 45 43 54 69 64 30 78 31 37 30 38 39 36 30 22 3e  ECTid0x1708960">
0190: 4e 41 4d 45 3c 2f 61 3e 20 c2 b7 20 3c 61 20 68  NAME</a> · <a h
01a0: 72 65 66 3d 22 23 53 45 43 54 69 64 30 78 31 36  ref="#SECTid0x16
01b0: 30 62 66 30 30 22 3e 53 59 4e 4f 50 53 49 53 3c  0bf00">SYNOPSIS<
01c0: 2f 61 3e 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22  /a> · <a href="
01d0: 23 53 45 43 54 69 64 30 78 31 36 65 65 30 32 30  #SECTid0x16ee020
01e0: 22 3e 44 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61  ">DESCRIPTION</a
01f0: 3e 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22 23 53  > · <a href="#S
0200: 45 43 54 69 64 30 78 31 36 65 65 64 36 30 22 3e  ECTid0x16eed60">
0210: 43 4f 4d 4d 41 4e 44 20 4f 50 54 49 4f 4e 53 3c  COMMAND OPTIONS<
0220: 2f 61 3e 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22  /a> · <a href="
0230: 23 53 45 43 54 69 64 30 78 31 37 34 36 62 38 30  #SECTid0x1746b80
0240: 22 3e 20 43 4f 4d 4d 41 4e 44 20 4d 45 54 48 4f  "> COMMAND METHO
0250: 44 53 20 3c 2f 61 3e 20 c2 b7 20 3c 61 20 68 72  DS </a> · <a hr
0260: 65 66 3d 22 23 53 45 43 54 69 64 30 78 31 37 34  ef="#SECTid0x174
0270: 64 36 36 30 22 3e 43 61 6c 6c 62 61 63 6b 20 43  d660">Callback C
0280: 6f 6d 6d 61 6e 64 20 52 65 74 75 72 6e 20 43 6f  ommand Return Co
0290: 64 65 73 3c 2f 61 3e 20 c2 b7 20 3c 61 20 68 72  des</a> · <a hr
02a0: 65 66 3d 22 23 53 45 43 54 69 64 30 78 31 37 34  ef="#SECTid0x174
02b0: 65 31 66 30 22 3e 53 45 45 20 41 4c 53 4f 3c 2f  e1f0">SEE ALSO</
02c0: 61 3e 20 c2 b7 20 3c 61 20 68 72 65 66 3d 22 23  a> · <a href="#
02d0: 53 45 43 54 69 64 30 78 31 37 34 65 35 62 30 22  SECTid0x174e5b0"
02e0: 3e 4b 45 59 57 4f 52 44 53 3c 2f 61 3e 0a 3c 2f  >KEYWORDS</a>.</
02f0: 64 69 76 3e 3c 68 72 20 63 6c 61 73 73 3d 22 6e  div><hr class="n
0300: 61 76 73 65 70 22 3e 0a 3c 2f 64 69 76 3e 3c 64  avsep">.</div><d
0310: 69 76 20 63 6c 61 73 73 3d 22 62 6f 64 79 22 3e  iv class="body">
0320: 0a 20 20 20 20 3c 68 32 3e 3c 61 20 6e 61 6d 65  .    <h2><a name
0330: 3d 22 53 45 43 54 69 64 30 78 31 37 30 38 39 36  ="SECTid0x170896
0340: 30 22 3e 4e 41 4d 45 3c 2f 61 3e 3c 2f 68 32 3e  0">NAME</a></h2>
0350: 3c 70 20 63 6c 61 73 73 3d 22 6e 61 6d 65 73 65  <p class="namese
0360: 63 74 69 6f 6e 22 3e 0a 3c 62 20 63 6c 61 73 73  ction">.<b class
0370: 3d 22 6e 61 6d 65 73 22 3e 65 78 70 61 74 20 2d  ="names">expat -
0380: 20 3c 2f 62 3e 3c 62 72 3e 43 72 65 61 74 65 73   </b><br>Creates
0390: 20 61 6e 20 69 6e 73 74 61 6e 63 65 20 6f 66 20   an instance of 
03a0: 61 6e 20 65 78 70 61 74 20 70 61 72 73 65 72 20  an expat parser 
03b0: 6f 62 6a 65 63 74 3c 2f 70 3e 0a 0a 0a 0a 20 20  object</p>....  
03c0: 20 20 3c 68 32 3e 3c 61 20 6e 61 6d 65 3d 22 53    <h2><a name="S
03d0: 45 43 54 69 64 30 78 31 36 30 62 66 30 30 22 3e  ECTid0x160bf00">
03e0: 53 59 4e 4f 50 53 49 53 3c 2f 61 3e 3c 2f 68 32  SYNOPSIS</a></h2
03f0: 3e 3c 70 72 65 20 63 6c 61 73 73 3d 22 73 79 6e  ><pre class="syn
0400: 74 61 78 22 3e 70 61 63 6b 61 67 65 20 72 65 71  tax">package req
0410: 75 69 72 65 20 74 64 6f 6d 0a 0a 3c 62 20 63 6c  uire tdom..<b cl
0420: 61 73 73 3d 22 63 6d 64 22 3e 65 78 70 61 74 3c  ass="cmd">expat<
0430: 2f 62 3e 20 3f 3c 69 20 63 6c 61 73 73 3d 22 6d  /b> ?<i class="m
0440: 22 3e 70 61 72 73 65 72 6e 61 6d 65 3c 2f 69 3e  ">parsername</i>
0450: 3f 20 3f 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e  ? ?<i class="m">
0460: 2d 6e 61 6d 65 73 70 61 63 65 3c 2f 69 3e 3f 20  -namespace</i>? 
0470: 3f 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 61 72  ?<i class="m">ar
0480: 67 20 61 72 67 20 2e 2e 3c 2f 69 3e 0a 0a 3c 62  g arg ..</i>..<b
0490: 20 63 6c 61 73 73 3d 22 63 6d 64 22 3e 78 6d 6c   class="cmd">xml
04a0: 3a 3a 70 61 72 73 65 72 3c 2f 62 3e 20 3f 3c 69  ::parser</b> ?<i
04b0: 20 63 6c 61 73 73 3d 22 6d 22 3e 70 61 72 73 65   class="m">parse
04c0: 72 6e 61 6d 65 3c 2f 69 3e 3f 20 3f 3c 69 20 63  rname</i>? ?<i c
04d0: 6c 61 73 73 3d 22 6d 22 3e 2d 6e 61 6d 65 73 70  lass="m">-namesp
04e0: 61 63 65 3c 2f 69 3e 3f 20 3f 3c 69 20 63 6c 61  ace</i>? ?<i cla
04f0: 73 73 3d 22 6d 22 3e 61 72 67 20 61 72 67 20 2e  ss="m">arg arg .
0500: 2e 3c 2f 69 3e 0a 3c 2f 70 72 65 3e 0a 20 20 20  .</i>.</pre>.   
0510: 20 3c 68 32 3e 3c 61 20 6e 61 6d 65 3d 22 53 45   <h2><a name="SE
0520: 43 54 69 64 30 78 31 36 65 65 30 32 30 22 3e 44  CTid0x16ee020">D
0530: 45 53 43 52 49 50 54 49 4f 4e 3c 2f 61 3e 3c 2f  ESCRIPTION</a></
0540: 68 32 3e 3c 70 3e 54 68 65 20 70 61 72 73 65 72  h2><p>The parser
0550: 20 63 72 65 61 74 65 64 20 77 69 74 68 20 3c 69   created with <i
0560: 20 63 6c 61 73 73 3d 22 6d 22 3e 65 78 70 61 74   class="m">expat
0570: 3c 2f 69 3e 20 6f 72 20 3c 69 20 63 6c 61 73 73  </i> or <i class
0580: 3d 22 6d 22 3e 78 6d 6c 3a 3a 70 61 72 73 65 72  ="m">xml::parser
0590: 3c 2f 69 3e 0a 28 77 68 69 63 68 20 69 73 20 6a  </i>.(which is j
05a0: 75 73 74 20 61 6e 6f 74 68 65 72 20 6e 61 6d 65  ust another name
05b0: 20 66 6f 72 20 74 68 65 20 73 61 6d 65 20 63 6f   for the same co
05c0: 6d 6d 61 6e 64 20 69 6e 20 61 6e 20 6f 77 6e 20  mmand in an own 
05d0: 6e 61 6d 65 73 70 61 63 65 29 20 61 72 65 20 61  namespace) are a
05e0: 62 6c 65 0a 74 6f 20 70 61 72 73 65 20 61 6e 79  ble.to parse any
05f0: 20 6b 69 6e 64 20 6f 66 20 77 65 6c 6c 2d 66 6f   kind of well-fo
0600: 72 6d 65 64 20 58 4d 4c 2e 20 54 68 65 20 70 61  rmed XML. The pa
0610: 72 73 65 72 73 20 61 72 65 20 73 74 72 65 61 6d  rsers are stream
0620: 20 6f 72 69 65 6e 74 65 64 20 58 4d 4c 0a 70 61   oriented XML.pa
0630: 72 73 65 72 2e 20 54 68 69 73 20 6d 65 61 6e 73  rser. This means
0640: 20 74 68 61 74 20 79 6f 75 20 72 65 67 69 73 74   that you regist
0650: 65 72 20 68 61 6e 64 6c 65 72 20 73 63 72 69 70  er handler scrip
0660: 74 73 20 77 69 74 68 20 74 68 65 20 70 61 72 73  ts with the pars
0670: 65 72 20 70 72 69 6f 72 20 74 6f 0a 73 74 61 72  er prior to.star
0680: 74 69 6e 67 20 74 68 65 20 70 61 72 73 65 2e 20  ting the parse. 
0690: 54 68 65 73 65 20 68 61 6e 64 6c 65 72 20 73 63  These handler sc
06a0: 72 69 70 74 73 20 61 72 65 20 63 61 6c 6c 65 64  ripts are called
06b0: 20 77 68 65 6e 20 74 68 65 20 70 61 72 73 65 72   when the parser
06c0: 20 64 69 73 63 6f 76 65 72 73 0a 74 68 65 20 61   discovers.the a
06d0: 73 73 6f 63 69 61 74 65 64 20 73 74 72 75 63 74  ssociated struct
06e0: 75 72 65 73 20 69 6e 20 74 68 65 20 64 6f 63 75  ures in the docu
06f0: 6d 65 6e 74 20 62 65 69 6e 67 20 70 61 72 73 65  ment being parse
0700: 64 2e 20 20 41 20 73 74 61 72 74 20 74 61 67 20  d.  A start tag 
0710: 69 73 20 61 6e 0a 65 78 61 6d 70 6c 65 20 6f 66  is an.example of
0720: 20 74 68 65 20 6b 69 6e 64 20 6f 66 20 73 74 72   the kind of str
0730: 75 63 74 75 72 65 73 20 66 6f 72 20 77 68 69 63  uctures for whic
0740: 68 20 79 6f 75 20 6d 61 79 20 72 65 67 69 73 74  h you may regist
0750: 65 72 20 61 20 68 61 6e 64 6c 65 72 0a 73 63 72  er a handler.scr
0760: 69 70 74 2e 3c 2f 70 3e 3c 70 3e 54 68 65 20 70  ipt.</p><p>The p
0770: 61 72 73 65 72 73 20 64 6f 20 6e 6f 74 20 76 61  arsers do not va
0780: 6c 69 64 61 74 65 20 74 68 65 20 58 4d 4c 20 64  lidate the XML d
0790: 6f 63 75 6d 65 6e 74 2e 20 54 68 65 79 20 64 6f  ocument. They do
07a0: 20 70 61 72 73 65 20 74 68 65 20 69 6e 74 65 72   parse the inter
07b0: 6e 61 6c 20 44 54 44 0a 61 6e 64 2c 20 61 74 20  nal DTD.and, at 
07c0: 72 65 71 75 65 73 74 2c 20 65 78 74 65 72 6e 61  request, externa
07d0: 6c 20 44 54 44 20 61 6e 64 20 65 78 74 65 72 6e  l DTD and extern
07e0: 61 6c 20 65 6e 74 69 74 69 65 73 2c 20 69 66 20  al entities, if 
07f0: 79 6f 75 20 72 65 73 6f 6c 76 65 20 74 68 65 0a  you resolve the.
0800: 69 64 65 6e 74 69 66 69 65 72 20 6f 66 20 74 68  identifier of th
0810: 65 20 65 78 74 65 72 6e 61 6c 20 65 6e 74 69 74  e external entit
0820: 69 65 73 20 77 69 74 68 20 74 68 65 20 2d 65 78  ies with the -ex
0830: 74 65 72 6e 61 6c 65 6e 74 69 74 79 63 6f 6d 6d  ternalentitycomm
0840: 61 6e 64 20 73 63 72 69 70 74 20 28 73 65 65 0a  and script (see.
0850: 74 68 65 72 65 29 2e 3c 2f 70 3e 3c 70 3e 41 64  there).</p><p>Ad
0860: 64 69 74 69 6f 6e 6c 79 2c 20 74 68 65 20 54 63  ditionly, the Tc
0870: 6c 20 65 78 74 65 6e 73 69 6f 6e 20 63 6f 64 65  l extension code
0880: 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 73   that implements
0890: 20 74 68 69 73 20 63 6f 6d 6d 61 6e 64 20 70 72   this command pr
08a0: 6f 76 69 64 65 73 20 61 6e 0a 41 50 49 20 66 6f  ovides an.API fo
08b0: 72 20 61 64 64 69 6e 67 20 43 20 6c 65 76 65 6c  r adding C level
08c0: 20 63 6f 64 65 64 20 68 61 6e 64 6c 65 72 73 2e   coded handlers.
08d0: 20 55 70 20 74 6f 20 6e 6f 77 2c 20 74 68 65 72   Up to now, ther
08e0: 65 20 65 78 69 73 74 73 20 74 68 65 20 70 61 72  e exists the par
08f0: 73 65 72 0a 65 78 74 65 6e 73 69 6f 6e 20 63 6f  ser.extension co
0900: 6d 6d 61 6e 64 20 22 74 64 6f 6d 22 2e 20 54 68  mmand "tdom". Th
0910: 65 20 68 61 6e 64 6c 65 72 20 73 65 74 20 69 6e  e handler set in
0920: 73 74 61 6c 6c 65 64 20 62 79 20 74 68 69 73 20  stalled by this 
0930: 65 78 74 65 6e 73 69 6f 6e 20 62 75 69 6c 64 20  extension build 
0940: 61 6e 0a 69 6e 20 6d 65 6d 6f 72 79 20 22 74 44  an.in memory "tD
0950: 4f 4d 22 20 44 4f 4d 20 74 72 65 65 2c 20 77 68  OM" DOM tree, wh
0960: 69 6c 65 20 74 68 65 20 70 61 72 73 65 72 20 69  ile the parser i
0970: 73 20 70 61 72 73 69 6e 67 20 74 68 65 20 69 6e  s parsing the in
0980: 70 75 74 2e 3c 2f 70 3e 3c 70 3e 49 74 20 69 73  put.</p><p>It is
0990: 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 72 65 67   possible to reg
09a0: 69 73 74 65 72 20 61 6e 20 61 72 62 69 74 72 61  ister an arbitra
09b0: 72 79 20 61 6d 6f 75 6e 74 20 6f 66 20 64 69 66  ry amount of dif
09c0: 66 65 72 65 6e 74 20 68 61 6e 64 6c 65 72 20 73  ferent handler s
09d0: 63 72 69 70 74 73 0a 61 6e 64 20 43 20 6c 65 76  cripts.and C lev
09e0: 65 6c 20 68 61 6e 64 6c 65 72 73 20 66 6f 72 20  el handlers for 
09f0: 6d 6f 73 74 20 6f 66 20 74 68 65 20 65 76 65 6e  most of the even
0a00: 74 73 2e 20 49 66 20 74 68 65 20 65 76 65 6e 74  ts. If the event
0a10: 20 6f 63 63 75 72 73 2c 20 74 68 65 79 20 61 72   occurs, they ar
0a20: 65 0a 63 61 6c 6c 65 64 20 69 6e 20 74 75 72 6e  e.called in turn
0a30: 2e 3c 2f 70 3e 0a 0a 20 20 20 20 3c 68 32 3e 3c  .</p>..    <h2><
0a40: 61 20 6e 61 6d 65 3d 22 53 45 43 54 69 64 30 78  a name="SECTid0x
0a50: 31 36 65 65 64 36 30 22 3e 43 4f 4d 4d 41 4e 44  16eed60">COMMAND
0a60: 20 4f 50 54 49 4f 4e 53 3c 2f 61 3e 3c 2f 68 32   OPTIONS</a></h2
0a70: 3e 3c 64 6c 20 63 6c 61 73 73 3d 22 6f 70 74 6c  ><dl class="optl
0a80: 69 73 74 22 3e 0a 20 20 20 20 20 20 20 20 0a 20  ist">.        . 
0a90: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 3c 62 3e           <dt><b>
0aa0: 2d 6e 61 6d 65 73 70 61 63 65 3c 2f 62 3e 3c 2f  -namespace</b></
0ab0: 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 3c  dt>..          <
0ac0: 64 64 3e 0a 3c 70 3e 45 6e 61 62 6c 65 73 20 6e  dd>.<p>Enables n
0ad0: 61 6d 65 73 70 61 63 65 20 70 61 72 73 69 6e 67  amespace parsing
0ae0: 2e 20 59 6f 75 20 6d 75 73 74 20 75 73 65 20 74  . You must use t
0af0: 68 69 73 20 6f 70 74 69 6f 6e 20 77 68 69 6c 65  his option while
0b00: 0a 63 72 65 61 74 69 6e 67 20 74 68 65 20 70 61  .creating the pa
0b10: 72 73 65 72 20 77 69 74 68 20 74 68 65 20 3c 74  rser with the <t
0b20: 74 20 63 6c 61 73 73 3d 22 73 61 6d 70 22 3e 65  t class="samp">e
0b30: 78 70 61 74 3c 2f 74 74 3e 20 6f 72 20 3c 74 74  xpat</tt> or <tt
0b40: 20 63 6c 61 73 73 3d 22 73 61 6d 70 22 3e 78 6d   class="samp">xm
0b50: 6c 3a 3a 70 61 72 73 65 72 3c 2f 74 74 3e 0a 63  l::parser</tt>.c
0b60: 6f 6d 6d 61 6e 64 2e 20 59 6f 75 20 63 61 6e 27  ommand. You can'
0b70: 74 20 65 6e 61 62 6c 65 20 28 6e 6f 72 20 64 69  t enable (nor di
0b80: 73 61 62 6c 65 29 20 6e 61 6d 65 73 70 61 63 65  sable) namespace
0b90: 20 70 61 72 73 69 6e 67 20 77 69 74 68 0a 3c 74   parsing with.<t
0ba0: 74 20 63 6c 61 73 73 3d 22 73 61 6d 70 22 3e 26  t class="samp">&
0bb0: 6c 74 3b 70 61 72 73 65 72 6f 62 6a 26 67 74 3b  lt;parserobj&gt;
0bc0: 20 63 6f 6e 66 69 67 75 72 65 20 2e 2e 2e 3c 2f   configure ...</
0bd0: 74 74 3e 2e 3c 2f 70 3e 0a 3c 2f 64 64 3e 0a 20  tt>.</p>.</dd>. 
0be0: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
0bf0: 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e   .          <dt>
0c00: 0a 3c 62 3e 2d 66 69 6e 61 6c 3c 2f 62 3e 20 3c  .<b>-final</b> <
0c10: 69 3e 62 6f 6f 6c 65 61 6e 3c 2f 69 3e 0a 3c 2f  i>boolean</i>.</
0c20: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
0c30: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 0a 3c            <dd>.<
0c40: 70 3e 54 68 69 73 20 6f 70 74 69 6f 6e 20 69 6e  p>This option in
0c50: 64 69 63 61 74 65 73 20 77 68 65 74 68 65 72 20  dicates whether 
0c60: 74 68 65 20 64 6f 63 75 6d 65 6e 74 20 64 61 74  the document dat
0c70: 61 20 6e 65 78 74 0a 70 72 65 73 65 6e 74 65 64  a next.presented
0c80: 20 74 6f 20 74 68 65 20 70 61 72 73 65 20 6d 65   to the parse me
0c90: 74 68 6f 64 20 69 73 20 74 68 65 20 66 69 6e 61  thod is the fina
0ca0: 6c 20 70 61 72 74 20 6f 66 20 74 68 65 20 64 6f  l part of the do
0cb0: 63 75 6d 65 6e 74 2e 20 41 20 76 61 6c 75 65 20  cument. A value 
0cc0: 6f 66 20 22 30 22 0a 69 6e 64 69 63 61 74 65 73  of "0".indicates
0cd0: 20 74 68 61 74 20 6d 6f 72 65 20 64 61 74 61 20   that more data 
0ce0: 69 73 20 65 78 70 65 63 74 65 64 2e 20 41 20 76  is expected. A v
0cf0: 61 6c 75 65 20 6f 66 20 22 31 22 20 69 6e 64 69  alue of "1" indi
0d00: 63 61 74 65 73 20 74 68 61 74 20 6e 6f 20 6d 6f  cates that no mo
0d10: 72 65 20 69 73 0a 65 78 70 65 63 74 65 64 2e 20  re is.expected. 
0d20: 20 54 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c   The default val
0d30: 75 65 20 69 73 20 22 31 22 2e 3c 2f 70 3e 0a 0a  ue is "1".</p>..
0d40: 3c 70 3e 49 66 20 74 68 69 73 20 6f 70 74 69 6f  <p>If this optio
0d50: 6e 20 69 73 20 73 65 74 20 74 6f 20 22 30 22 20  n is set to "0" 
0d60: 74 68 65 6e 20 74 68 65 20 70 61 72 73 65 72 20  then the parser 
0d70: 77 69 6c 6c 20 6e 6f 74 20 72 65 70 6f 72 74 20  will not report 
0d80: 63 65 72 74 61 69 6e 20 65 72 72 6f 72 73 0a 69  certain errors.i
0d90: 66 20 74 68 65 20 58 4d 4c 20 64 61 74 61 20 69  f the XML data i
0da0: 73 20 6e 6f 74 20 77 65 6c 6c 2d 66 6f 72 6d 65  s not well-forme
0db0: 64 20 75 70 6f 6e 20 65 6e 64 20 6f 66 20 69 6e  d upon end of in
0dc0: 70 75 74 2c 20 73 75 63 68 20 61 73 20 75 6e 63  put, such as unc
0dd0: 6c 6f 73 65 64 20 6f 72 0a 75 6e 62 61 6c 61 6e  losed or.unbalan
0de0: 63 65 64 20 73 74 61 72 74 20 6f 72 20 65 6e 64  ced start or end
0df0: 20 74 61 67 73 2e 20 49 6e 73 74 65 61 64 20 73   tags. Instead s
0e00: 6f 6d 65 20 64 61 74 61 20 6d 61 79 20 62 65 20  ome data may be 
0e10: 73 61 76 65 64 20 62 79 20 74 68 65 20 70 61 72  saved by the par
0e20: 73 65 72 0a 75 6e 74 69 6c 20 74 68 65 20 6e 65  ser.until the ne
0e30: 78 74 20 63 61 6c 6c 20 74 6f 20 74 68 65 20 70  xt call to the p
0e40: 61 72 73 65 20 6d 65 74 68 6f 64 2c 20 74 68 75  arse method, thu
0e50: 73 20 64 65 6c 61 79 69 6e 67 20 74 68 65 20 72  s delaying the r
0e60: 65 70 6f 72 74 69 6e 67 20 6f 66 20 73 6f 6d 65  eporting of some
0e70: 20 6f 66 0a 74 68 65 20 64 61 74 61 2e 3c 2f 70   of.the data.</p
0e80: 3e 0a 0a 3c 70 3e 49 66 20 74 68 69 73 20 6f 70  >..<p>If this op
0e90: 74 69 6f 6e 20 69 73 20 73 65 74 20 74 6f 20 22  tion is set to "
0ea0: 31 22 20 74 68 65 6e 20 64 6f 63 75 6d 65 6e 74  1" then document
0eb0: 73 20 77 68 69 63 68 20 61 72 65 20 6e 6f 74 20  s which are not 
0ec0: 77 65 6c 6c 2d 66 6f 72 6d 65 64 20 75 70 6f 6e  well-formed upon
0ed0: 0a 65 6e 64 20 6f 66 20 69 6e 70 75 74 20 77 69  .end of input wi
0ee0: 6c 6c 20 67 65 6e 65 72 61 74 65 20 61 6e 20 65  ll generate an e
0ef0: 72 72 6f 72 2e 3c 2f 70 3e 0a 3c 2f 64 64 3e 0a  rror.</p>.</dd>.
0f00: 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20          ..      
0f10: 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74    .          <dt
0f20: 3e 0a 3c 62 3e 2d 62 61 73 65 75 72 6c 3c 2f 62  >.<b>-baseurl</b
0f30: 3e 20 3c 69 3e 75 72 6c 3c 2f 69 3e 0a 3c 2f 64  > <i>url</i>.</d
0f40: 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a 20  t>.          .. 
0f50: 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e           <dd><p>
0f60: 52 65 70 6f 72 74 73 20 74 68 65 20 62 61 73 65  Reports the base
0f70: 20 75 72 6c 20 6f 66 20 74 68 65 20 64 6f 63 75   url of the docu
0f80: 6d 65 6e 74 20 74 6f 20 74 68 65 0a 70 61 72 73  ment to the.pars
0f90: 65 72 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20  er.</p></dd>.   
0fa0: 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a       ..        .
0fb0: 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c            <dt>.<
0fc0: 62 3e 2d 65 6c 65 6d 65 6e 74 73 74 61 72 74 63  b>-elementstartc
0fd0: 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63  ommand</b> <i>sc
0fe0: 72 69 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20  ript</i>.</dt>. 
0ff0: 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20           ..     
1000: 20 20 20 20 20 3c 64 64 3e 0a 3c 70 3e 53 70 65       <dd>.<p>Spe
1010: 63 69 66 69 65 73 20 61 20 54 63 6c 20 63 6f 6d  cifies a Tcl com
1020: 6d 61 6e 64 20 74 6f 20 61 73 73 6f 63 69 61 74  mand to associat
1030: 65 20 77 69 74 68 20 74 68 65 20 73 74 61 72 74  e with the start
1040: 20 74 61 67 20 6f 66 0a 61 6e 20 65 6c 65 6d 65   tag of.an eleme
1050: 6e 74 2e 20 54 68 65 20 61 63 74 75 61 6c 20 63  nt. The actual c
1060: 6f 6d 6d 61 6e 64 20 63 6f 6e 73 69 73 74 73 20  ommand consists 
1070: 6f 66 20 74 68 69 73 20 6f 70 74 69 6f 6e 20 66  of this option f
1080: 6f 6c 6c 6f 77 65 64 20 62 79 20 61 74 20 6c 65  ollowed by at le
1090: 61 73 74 20 74 77 6f 0a 61 72 67 75 6d 65 6e 74  ast two.argument
10a0: 73 3a 20 74 68 65 20 65 6c 65 6d 65 6e 74 20 74  s: the element t
10b0: 79 70 65 20 6e 61 6d 65 20 61 6e 64 20 74 68 65  ype name and the
10c0: 20 61 74 74 72 69 62 75 74 65 20 6c 69 73 74 2e   attribute list.
10d0: 3c 2f 70 3e 0a 0a 3c 70 3e 54 68 65 20 61 74 74  </p>..<p>The att
10e0: 72 69 62 75 74 65 20 6c 69 73 74 20 69 73 20 61  ribute list is a
10f0: 20 54 63 6c 20 6c 69 73 74 20 63 6f 6e 73 69 73   Tcl list consis
1100: 74 69 6e 67 20 6f 66 20 6e 61 6d 65 2f 76 61 6c  ting of name/val
1110: 75 65 20 70 61 69 72 73 2c 20 73 75 69 74 61 62  ue pairs, suitab
1120: 6c 65 0a 66 6f 72 20 70 61 73 73 69 6e 67 20 74  le.for passing t
1130: 6f 20 74 68 65 20 61 72 72 61 79 20 73 65 74 20  o the array set 
1140: 54 63 6c 20 63 6f 6d 6d 61 6e 64 2e 3c 2f 70 3e  Tcl command.</p>
1150: 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 3a 3c 2f 70  ..<p>Example:</p
1160: 3e 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78  >.<pre class="ex
1170: 61 6d 70 6c 65 22 3e 70 72 6f 63 20 48 61 6e 64  ample">proc Hand
1180: 6c 65 53 74 61 72 74 20 7b 6e 61 6d 65 20 61 74  leStart {name at
1190: 74 6c 69 73 74 7d 20 7b 0a 20 20 20 20 70 75 74  tlist} {.    put
11a0: 73 20 73 74 64 65 72 72 20 22 45 6c 65 6d 65 6e  s stderr "Elemen
11b0: 74 20 73 74 61 72 74 20 3d 3d 26 67 74 3b 20 24  t start ==&gt; $
11c0: 6e 61 6d 65 20 68 61 73 20 61 74 74 72 69 62 75  name has attribu
11d0: 74 65 73 20 24 61 74 74 6c 69 73 74 22 0a 7d 0a  tes $attlist".}.
11e0: 0a 24 70 61 72 73 65 72 20 63 6f 6e 66 69 67 75  .$parser configu
11f0: 72 65 20 2d 65 6c 65 6d 65 6e 74 73 74 61 72 74  re -elementstart
1200: 63 6f 6d 6d 61 6e 64 20 48 61 6e 64 6c 65 53 74  command HandleSt
1210: 61 72 74 0a 0a 24 70 61 72 73 65 72 20 70 61 72  art..$parser par
1220: 73 65 20 7b 26 6c 74 3b 74 65 73 74 20 69 64 3d  se {&lt;test id=
1230: 22 31 32 33 22 26 67 74 3b 26 6c 74 3b 2f 74 65  "123"&gt;&lt;/te
1240: 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a 0a  st&gt;}.</pre>..
1250: 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64 20 72 65  <p>This would re
1260: 73 75 6c 74 20 69 6e 20 74 68 65 20 66 6f 6c 6c  sult in the foll
1270: 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 20 62 65  owing command be
1280: 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70 3e  ing invoked:</p>
1290: 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61  .<pre class="exa
12a0: 6d 70 6c 65 22 3e 48 61 6e 64 6c 65 53 74 61 72  mple">HandleStar
12b0: 74 20 74 65 78 74 20 7b 69 64 20 31 32 33 7d 3c  t text {id 123}<
12c0: 2f 70 72 65 3e 0a 3c 2f 64 64 3e 0a 20 20 20 20  /pre>.</dd>.    
12d0: 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20      ..        . 
12e0: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62           <dt>.<b
12f0: 3e 2d 65 6c 65 6d 65 6e 74 65 6e 64 63 6f 6d 6d  >-elementendcomm
1300: 61 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69 70  and</b> <i>scrip
1310: 74 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20  t</i>.</dt>.    
1320: 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20        ..        
1330: 20 20 3c 64 64 3e 0a 3c 70 3e 53 70 65 63 69 66    <dd>.<p>Specif
1340: 69 65 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e  ies a Tcl comman
1350: 64 20 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77  d to associate w
1360: 69 74 68 20 74 68 65 20 65 6e 64 20 74 61 67 20  ith the end tag 
1370: 6f 66 20 61 6e 0a 65 6c 65 6d 65 6e 74 2e 20 54  of an.element. T
1380: 68 65 20 61 63 74 75 61 6c 20 63 6f 6d 6d 61 6e  he actual comman
1390: 64 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68  d consists of th
13a0: 69 73 20 6f 70 74 69 6f 6e 20 66 6f 6c 6c 6f 77  is option follow
13b0: 65 64 20 62 79 20 61 74 20 6c 65 61 73 74 20 6f  ed by at least o
13c0: 6e 65 0a 61 72 67 75 6d 65 6e 74 3a 20 74 68 65  ne.argument: the
13d0: 20 65 6c 65 6d 65 6e 74 20 74 79 70 65 20 6e 61   element type na
13e0: 6d 65 2e 20 49 6e 20 61 64 64 69 74 69 6f 6e 2c  me. In addition,
13f0: 20 69 66 20 74 68 65 20 2d 72 65 70 6f 72 74 65   if the -reporte
1400: 6d 70 74 79 20 6f 70 74 69 6f 6e 20 69 73 20 73  mpty option is s
1410: 65 74 0a 74 68 65 6e 20 74 68 65 20 63 6f 6d 6d  et.then the comm
1420: 61 6e 64 20 6d 61 79 20 62 65 20 69 6e 76 6f 6b  and may be invok
1430: 65 64 20 77 69 74 68 20 74 68 65 20 2d 65 6d 70  ed with the -emp
1440: 74 79 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e  ty configuration
1450: 20 6f 70 74 69 6f 6e 20 74 6f 0a 69 6e 64 69 63   option to.indic
1460: 61 74 65 20 77 68 65 74 68 65 72 20 69 74 20 69  ate whether it i
1470: 73 20 61 6e 20 65 6d 70 74 79 20 65 6c 65 6d 65  s an empty eleme
1480: 6e 74 2e 20 53 65 65 20 74 68 65 20 64 65 73 63  nt. See the desc
1490: 72 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 0a 2d  ription of the.-
14a0: 72 65 70 6f 72 74 65 6d 70 74 79 20 6f 70 74 69  reportempty opti
14b0: 6f 6e 20 66 6f 72 20 61 6e 20 65 78 61 6d 70 6c  on for an exampl
14c0: 65 2e 20 3c 2f 70 3e 0a 0a 3c 70 3e 45 78 61 6d  e. </p>..<p>Exam
14d0: 70 6c 65 3a 20 3c 2f 70 3e 0a 3c 70 72 65 20 63  ple: </p>.<pre c
14e0: 6c 61 73 73 3d 22 65 78 61 6d 70 6c 65 22 3e 70  lass="example">p
14f0: 72 6f 63 20 48 61 6e 64 6c 65 45 6e 64 20 7b 6e  roc HandleEnd {n
1500: 61 6d 65 7d 20 7b 0a 20 20 20 20 70 75 74 73 20  ame} {.    puts 
1510: 73 74 64 65 72 72 20 22 45 6c 65 6d 65 6e 74 20  stderr "Element 
1520: 65 6e 64 20 3d 3d 26 67 74 3b 20 24 6e 61 6d 65  end ==&gt; $name
1530: 22 0a 7d 0a 0a 24 70 61 72 73 65 72 20 63 6f 6e  ".}..$parser con
1540: 66 69 67 75 72 65 20 2d 65 6c 65 6d 65 6e 74 65  figure -elemente
1550: 6e 64 63 6f 6d 6d 61 6e 64 20 48 61 6e 64 6c 65  ndcommand Handle
1560: 45 6e 64 0a 0a 24 70 61 72 73 65 72 20 70 61 72  End..$parser par
1570: 73 65 20 7b 26 6c 74 3b 74 65 73 74 20 69 64 3d  se {&lt;test id=
1580: 22 31 32 33 22 26 67 74 3b 26 6c 74 3b 2f 74 65  "123"&gt;&lt;/te
1590: 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a 0a  st&gt;}.</pre>..
15a0: 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64 20 72 65  <p>This would re
15b0: 73 75 6c 74 20 69 6e 20 74 68 65 20 66 6f 6c 6c  sult in the foll
15c0: 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 20 62 65  owing command be
15d0: 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70 3e  ing invoked:</p>
15e0: 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61  .<pre class="exa
15f0: 6d 70 6c 65 22 3e 0a 48 61 6e 64 6c 65 45 6e 64  mple">.HandleEnd
1600: 20 74 65 73 74 0a 3c 2f 70 72 65 3e 0a 3c 2f 64   test.</pre>.</d
1610: 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a 0a 20 20  d>.        ...  
1620: 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 20        .         
1630: 20 3c 64 74 3e 0a 3c 62 3e 2d 63 68 61 72 61 63   <dt>.<b>-charac
1640: 74 65 72 64 61 74 61 63 6f 6d 6d 61 6e 64 3c 2f  terdatacommand</
1650: 62 3e 20 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e  b> <i>script</i>
1660: 0a 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 20  .</dt>.         
1670: 20 0a 0a 20 20 20 20 20 20 20 20 20 20 3c 64 64   ..          <dd
1680: 3e 0a 3c 70 3e 53 70 65 63 69 66 69 65 73 20 61  >.<p>Specifies a
1690: 20 54 63 6c 20 63 6f 6d 6d 61 6e 64 20 74 6f 20   Tcl command to 
16a0: 61 73 73 6f 63 69 61 74 65 20 77 69 74 68 20 63  associate with c
16b0: 68 61 72 61 63 74 65 72 20 64 61 74 61 20 69 6e  haracter data in
16c0: 0a 74 68 65 20 64 6f 63 75 6d 65 6e 74 2c 20 69  .the document, i
16d0: 65 2e 20 74 65 78 74 2e 20 54 68 65 20 61 63 74  e. text. The act
16e0: 75 61 6c 20 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73  ual command cons
16f0: 69 73 74 73 20 6f 66 20 74 68 69 73 20 6f 70 74  ists of this opt
1700: 69 6f 6e 20 66 6f 6c 6c 6f 77 65 64 20 62 79 0a  ion followed by.
1710: 6f 6e 65 20 61 72 67 75 6d 65 6e 74 3a 20 74 68  one argument: th
1720: 65 20 74 65 78 74 2e 3c 2f 70 3e 0a 0a 3c 70 3e  e text.</p>..<p>
1730: 49 74 20 69 73 20 6e 6f 74 20 67 75 61 72 61 6e  It is not guaran
1740: 74 65 65 64 20 74 68 61 74 20 63 68 61 72 61 63  teed that charac
1750: 74 65 72 20 64 61 74 61 20 77 69 6c 6c 20 62 65  ter data will be
1760: 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 61   passed to the a
1770: 70 70 6c 69 63 61 74 69 6f 6e 0a 69 6e 20 61 20  pplication.in a 
1780: 73 69 6e 67 6c 65 20 63 61 6c 6c 20 74 6f 20 74  single call to t
1790: 68 69 73 20 63 6f 6d 6d 61 6e 64 2e 20 54 68 61  his command. Tha
17a0: 74 20 69 73 2c 20 74 68 65 20 61 70 70 6c 69 63  t is, the applic
17b0: 61 74 69 6f 6e 20 73 68 6f 75 6c 64 20 62 65 20  ation should be 
17c0: 70 72 65 70 61 72 65 64 0a 74 6f 20 72 65 63 65  prepared.to rece
17d0: 69 76 65 20 6d 75 6c 74 69 70 6c 65 20 69 6e 76  ive multiple inv
17e0: 6f 63 61 74 69 6f 6e 73 20 6f 66 20 74 68 69 73  ocations of this
17f0: 20 63 61 6c 6c 62 61 63 6b 20 77 69 74 68 20 6e   callback with n
1800: 6f 20 69 6e 74 65 72 76 65 6e 69 6e 67 20 63 61  o intervening ca
1810: 6c 6c 62 61 63 6b 73 0a 66 72 6f 6d 20 6f 74 68  llbacks.from oth
1820: 65 72 20 66 65 61 74 75 72 65 73 2e 3c 2f 70 3e  er features.</p>
1830: 0a 0a 3c 70 3e 45 78 61 6d 70 6c 65 3a 20 3c 2f  ..<p>Example: </
1840: 70 3e 0a 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22  p>..<pre class="
1850: 65 78 61 6d 70 6c 65 22 3e 70 72 6f 63 20 48 61  example">proc Ha
1860: 6e 64 6c 65 54 65 78 74 20 7b 64 61 74 61 7d 20  ndleText {data} 
1870: 7b 0a 20 20 20 20 70 75 74 73 20 73 74 64 65 72  {.    puts stder
1880: 72 20 22 43 68 61 72 61 63 74 65 72 20 64 61 74  r "Character dat
1890: 61 20 3d 3d 26 67 74 3b 20 24 64 61 74 61 22 0a  a ==&gt; $data".
18a0: 7d 0a 0a 24 70 61 72 73 65 72 20 63 6f 6e 66 69  }..$parser confi
18b0: 67 75 72 65 20 2d 63 68 61 72 61 63 74 65 72 64  gure -characterd
18c0: 61 74 61 63 6f 6d 6d 61 6e 64 20 48 61 6e 64 6c  atacommand Handl
18d0: 65 54 65 78 74 0a 0a 24 70 61 72 73 65 72 20 70  eText..$parser p
18e0: 61 72 73 65 20 7b 26 6c 74 3b 74 65 73 74 26 67  arse {&lt;test&g
18f0: 74 3b 74 68 69 73 20 69 73 20 61 20 74 65 73 74  t;this is a test
1900: 20 64 6f 63 75 6d 65 6e 74 26 6c 74 3b 2f 74 65   document&lt;/te
1910: 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a 0a  st&gt;}.</pre>..
1920: 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64 20 72 65  <p>This would re
1930: 73 75 6c 74 20 69 6e 20 74 68 65 20 66 6f 6c 6c  sult in the foll
1940: 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 20 62 65  owing command be
1950: 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70 3e  ing invoked:</p>
1960: 0a 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78  ..<pre class="ex
1970: 61 6d 70 6c 65 22 3e 48 61 6e 64 6c 65 54 65 78  ample">HandleTex
1980: 74 20 7b 74 68 69 73 20 69 73 20 61 20 74 65 73  t {this is a tes
1990: 74 20 64 6f 63 75 6d 65 6e 74 7d 3c 2f 70 72 65  t document}</pre
19a0: 3e 0a 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  >.</dd>.        
19b0: 0a 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20  ...        .    
19c0: 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 2d 70        <dt>.<b>-p
19d0: 72 6f 63 65 73 73 69 6e 67 69 6e 73 74 72 75 63  rocessinginstruc
19e0: 74 69 6f 6e 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20  tioncommand</b> 
19f0: 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f  <i>script</i>.</
1a00: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
1a10: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 0a 3c            <dd>.<
1a20: 70 3e 53 70 65 63 69 66 69 65 73 20 61 20 54 63  p>Specifies a Tc
1a30: 6c 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 61 73 73  l command to ass
1a40: 6f 63 69 61 74 65 20 77 69 74 68 20 70 72 6f 63  ociate with proc
1a50: 65 73 73 69 6e 67 0a 69 6e 73 74 72 75 63 74 69  essing.instructi
1a60: 6f 6e 73 20 69 6e 20 74 68 65 20 64 6f 63 75 6d  ons in the docum
1a70: 65 6e 74 2e 20 54 68 65 20 61 63 74 75 61 6c 20  ent. The actual 
1a80: 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73 69 73 74 73  command consists
1a90: 20 6f 66 20 74 68 69 73 20 6f 70 74 69 6f 6e 0a   of this option.
1aa0: 66 6f 6c 6c 6f 77 65 64 20 62 79 20 74 77 6f 20  followed by two 
1ab0: 61 72 67 75 6d 65 6e 74 73 3a 20 74 68 65 20 50  arguments: the P
1ac0: 49 20 74 61 72 67 65 74 20 61 6e 64 20 74 68 65  I target and the
1ad0: 20 50 49 20 64 61 74 61 2e 3c 2f 70 3e 0a 0a 3c   PI data.</p>..<
1ae0: 70 3e 45 78 61 6d 70 6c 65 3a 20 3c 2f 70 3e 0a  p>Example: </p>.
1af0: 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61  .<pre class="exa
1b00: 6d 70 6c 65 22 3e 70 72 6f 63 20 48 61 6e 64 6c  mple">proc Handl
1b10: 65 50 49 20 7b 74 61 72 67 65 74 20 64 61 74 61  ePI {target data
1b20: 7d 20 7b 0a 20 20 20 20 70 75 74 73 20 73 74 64  } {.    puts std
1b30: 65 72 72 20 22 50 72 6f 63 65 73 73 69 6e 67 20  err "Processing 
1b40: 69 6e 73 74 72 75 63 74 69 6f 6e 20 3d 3d 26 67  instruction ==&g
1b50: 74 3b 20 24 74 61 72 67 65 74 20 24 64 61 74 61  t; $target $data
1b60: 22 0a 7d 0a 0a 24 70 61 72 73 65 72 20 63 6f 6e  ".}..$parser con
1b70: 66 69 67 75 72 65 20 2d 70 72 6f 63 65 73 73 69  figure -processi
1b80: 6e 67 69 6e 73 74 72 75 63 74 69 6f 6e 63 6f 6d  nginstructioncom
1b90: 6d 61 6e 64 20 48 61 6e 64 6c 65 50 49 0a 0a 24  mand HandlePI..$
1ba0: 70 61 72 73 65 72 20 70 61 72 73 65 20 7b 26 6c  parser parse {&l
1bb0: 74 3b 74 65 73 74 26 67 74 3b 26 6c 74 3b 3f 73  t;test&gt;&lt;?s
1bc0: 70 65 63 69 61 6c 20 74 68 69 73 20 69 73 20 61  pecial this is a
1bd0: 20 70 72 6f 63 65 73 73 69 6e 67 20 69 6e 73 74   processing inst
1be0: 72 75 63 74 69 6f 6e 3f 26 67 74 3b 26 6c 74 3b  ruction?&gt;&lt;
1bf0: 2f 74 65 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65  /test&gt;}.</pre
1c00: 3e 0a 0a 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64  >..<p>This would
1c10: 20 72 65 73 75 6c 74 20 69 6e 20 74 68 65 20 66   result in the f
1c20: 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64  ollowing command
1c30: 20 62 65 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 20   being invoked: 
1c40: 3c 2f 70 3e 0a 0a 3c 70 72 65 20 63 6c 61 73 73  </p>..<pre class
1c50: 3d 22 65 78 61 6d 70 6c 65 22 3e 0a 48 61 6e 64  ="example">.Hand
1c60: 6c 65 50 49 20 73 70 65 63 69 61 6c 20 7b 74 68  lePI special {th
1c70: 69 73 20 69 73 20 61 20 70 72 6f 63 65 73 73 69  is is a processi
1c80: 6e 67 20 69 6e 73 74 72 75 63 74 69 6f 6e 7d 0a  ng instruction}.
1c90: 3c 2f 70 72 65 3e 0a 20 20 20 20 20 20 20 20 20  </pre>.         
1ca0: 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20     </dd>.       
1cb0: 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20   ..        .    
1cc0: 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 20 2d        <dt>.<b> -
1cd0: 6e 6f 74 61 74 69 6f 6e 64 65 63 6c 63 6f 6d 6d  notationdeclcomm
1ce0: 61 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69 70  and</b> <i>scrip
1cf0: 74 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20  t</i>.</dt>.    
1d00: 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20        ..        
1d10: 20 20 3c 64 64 3e 3c 70 3e 53 70 65 63 69 66 69    <dd><p>Specifi
1d20: 65 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e 64  es a Tcl command
1d30: 20 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77 69   to associate wi
1d40: 74 68 20 6e 6f 74 61 74 69 6f 6e 0a 64 65 63 6c  th notation.decl
1d50: 61 72 61 74 69 6f 6e 20 69 6e 20 74 68 65 20 64  aration in the d
1d60: 6f 63 75 6d 65 6e 74 2e 20 54 68 65 20 61 63 74  ocument. The act
1d70: 75 61 6c 20 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73  ual command cons
1d80: 69 73 74 73 20 6f 66 20 74 68 69 73 20 6f 70 74  ists of this opt
1d90: 69 6f 6e 0a 66 6f 6c 6c 6f 77 65 64 20 62 79 20  ion.followed by 
1da0: 66 6f 75 72 20 61 72 67 75 6d 65 6e 74 73 3a 20  four arguments: 
1db0: 74 68 65 20 6e 6f 74 61 74 69 6f 6e 20 6e 61 6d  the notation nam
1dc0: 65 2c 20 74 68 65 20 62 61 73 65 20 75 72 69 20  e, the base uri 
1dd0: 6f 66 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 0a  of the document.
1de0: 28 74 68 69 73 20 6d 65 61 6e 73 2c 20 77 68 61  (this means, wha
1df0: 74 65 76 65 72 20 77 61 73 20 73 65 74 20 62 79  tever was set by
1e00: 20 74 68 65 20 2d 62 61 73 65 75 72 6c 20 6f 70   the -baseurl op
1e10: 74 69 6f 6e 29 2c 20 74 68 65 20 73 79 73 74 65  tion), the syste
1e20: 6d 20 69 64 65 6e 74 69 66 69 65 72 0a 61 6e 64  m identifier.and
1e30: 20 74 68 65 20 70 75 62 6c 69 63 20 69 64 65 6e   the public iden
1e40: 74 69 66 69 65 72 2e 20 54 68 65 20 6e 6f 74 61  tifier. The nota
1e50: 74 69 6f 6e 20 6e 61 6d 65 20 69 73 20 6e 65 76  tion name is nev
1e60: 65 72 20 65 6d 70 74 79 2c 20 74 68 65 20 6f 74  er empty, the ot
1e70: 68 65 72 0a 61 72 67 75 6d 65 6e 74 73 20 6d 61  her.arguments ma
1e80: 79 20 62 65 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20  y be.</p></dd>. 
1e90: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
1ea0: 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e   .          <dt>
1eb0: 0a 3c 62 3e 20 2d 65 78 74 65 72 6e 61 6c 65 6e  .<b> -externalen
1ec0: 74 69 74 79 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20  titycommand</b> 
1ed0: 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f  <i>script</i>.</
1ee0: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
1ef0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 0a 3c            <dd>.<
1f00: 70 3e 53 70 65 63 69 66 69 65 73 20 61 20 54 63  p>Specifies a Tc
1f10: 6c 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 61 73 73  l command to ass
1f20: 6f 63 69 61 74 65 20 77 69 74 68 20 72 65 66 65  ociate with refe
1f30: 72 65 6e 63 65 73 20 74 6f 0a 65 78 74 65 72 6e  rences to.extern
1f40: 61 6c 20 65 6e 74 69 74 69 65 73 20 69 6e 20 74  al entities in t
1f50: 68 65 20 64 6f 63 75 6d 65 6e 74 2e 20 54 68 65  he document. The
1f60: 20 61 63 74 75 61 6c 20 63 6f 6d 6d 61 6e 64 20   actual command 
1f70: 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68 69 73  consists of this
1f80: 20 6f 70 74 69 6f 6e 0a 66 6f 6c 6c 6f 77 65 64   option.followed
1f90: 20 62 79 20 74 68 72 65 65 20 61 72 67 75 6d 65   by three argume
1fa0: 6e 74 73 3a 20 74 68 65 20 62 61 73 65 20 75 72  nts: the base ur
1fb0: 69 2c 20 74 68 65 20 73 79 73 74 65 6d 20 69 64  i, the system id
1fc0: 65 6e 74 69 66 69 65 72 20 6f 66 20 74 68 65 20  entifier of the 
1fd0: 65 6e 74 69 74 79 0a 61 6e 64 20 74 68 65 20 70  entity.and the p
1fe0: 75 62 6c 69 63 20 69 64 65 6e 74 69 66 69 65 72  ublic identifier
1ff0: 20 6f 66 20 74 68 65 20 65 6e 74 69 74 79 2e 20   of the entity. 
2000: 54 68 65 20 62 61 73 65 20 75 72 69 20 61 6e 64  The base uri and
2010: 20 74 68 65 20 70 75 62 6c 69 63 20 69 64 65 6e   the public iden
2020: 74 69 66 69 65 72 0a 6d 61 79 20 62 65 20 74 68  tifier.may be th
2030: 65 20 65 6d 70 74 79 20 6c 69 73 74 2e 3c 2f 70  e empty list.</p
2040: 3e 0a 0a 3c 70 3e 54 68 69 73 20 68 61 6e 64 6c  >..<p>This handl
2050: 65 72 20 73 63 72 69 70 74 20 68 61 73 20 74 6f  er script has to
2060: 20 72 65 74 75 72 6e 20 61 20 74 63 6c 20 6c 69   return a tcl li
2070: 73 74 20 63 6f 6e 73 69 73 74 69 6e 67 20 6f 66  st consisting of
2080: 20 74 68 72 65 65 0a 65 6c 65 6d 65 6e 74 73 2e   three.elements.
2090: 20 54 68 65 20 66 69 72 73 74 20 65 6c 65 6d 65   The first eleme
20a0: 6e 74 20 6f 66 20 74 68 69 73 20 6c 69 73 74 20  nt of this list 
20b0: 73 69 67 6e 61 6c 73 2c 20 68 6f 77 20 74 68 65  signals, how the
20c0: 20 65 78 74 65 72 6e 61 6c 20 65 6e 74 69 74 79   external entity
20d0: 20 69 73 0a 72 65 74 75 72 6e 65 64 20 74 6f 20   is.returned to 
20e0: 74 68 65 20 70 72 6f 63 65 73 73 6f 72 2e 20 41  the processor. A
20f0: 74 20 74 68 65 20 6d 6f 6d 65 6e 74 2c 20 74 68  t the moment, th
2100: 65 20 74 68 72 65 65 20 61 6c 6c 6f 77 65 64 20  e three allowed 
2110: 74 79 70 65 73 20 61 72 65 0a 22 73 74 72 69 6e  types are."strin
2120: 67 22 2c 20 22 63 68 61 6e 6e 65 6c 22 20 61 6e  g", "channel" an
2130: 64 20 22 66 69 6c 65 6e 61 6d 65 22 2e 20 54 68  d "filename". Th
2140: 65 20 73 65 63 6f 6e 64 0a 65 6c 65 6d 65 6e 74  e second.element
2150: 20 6f 66 20 74 68 65 20 6c 69 73 74 20 68 61 73   of the list has
2160: 20 74 6f 20 62 65 20 74 68 65 20 28 61 62 73 6f   to be the (abso
2170: 6c 75 74 65 29 20 62 61 73 65 20 55 52 49 20 6f  lute) base URI o
2180: 66 20 74 68 65 20 65 78 74 65 72 6e 61 6c 20 65  f the external e
2190: 6e 74 69 74 79 20 74 6f 0a 62 65 20 70 61 72 73  ntity to.be pars
21a0: 65 64 2e 20 20 54 68 65 20 74 68 69 72 64 20 65  ed.  The third e
21b0: 6c 65 6d 65 6e 74 20 6f 66 20 74 68 65 20 6c 69  lement of the li
21c0: 73 74 20 61 72 65 20 64 61 74 61 2c 20 65 69 74  st are data, eit
21d0: 68 65 72 20 74 68 65 20 61 6c 72 65 61 64 79 20  her the already 
21e0: 72 65 61 64 0a 64 61 74 61 20 6f 75 74 20 6f 66  read.data out of
21f0: 20 74 68 65 20 65 78 74 65 72 6e 61 6c 20 65 6e   the external en
2200: 74 69 74 79 20 61 73 20 73 74 72 69 6e 67 20 69  tity as string i
2210: 6e 20 74 68 65 20 63 61 73 65 20 6f 66 20 74 79  n the case of ty
2220: 70 65 0a 22 73 74 72 69 6e 67 22 2c 20 6f 72 20  pe."string", or 
2230: 74 68 65 20 6e 61 6d 65 20 6f 66 20 61 20 74 63  the name of a tc
2240: 6c 20 63 68 61 6e 6e 65 6c 2c 20 69 6e 20 74 68  l channel, in th
2250: 65 20 63 61 73 65 20 6f 66 20 74 79 70 65 0a 22  e case of type."
2260: 63 68 61 6e 6e 65 6c 22 2c 20 6f 72 20 74 68 65  channel", or the
2270: 20 70 61 74 68 20 74 6f 20 74 68 65 20 65 78 74   path to the ext
2280: 65 72 6e 61 6c 20 65 6e 74 69 74 79 20 74 6f 20  ernal entity to 
2290: 62 65 20 72 65 61 64 20 69 6e 20 63 61 73 65 20  be read in case 
22a0: 6f 66 0a 74 79 70 65 20 22 66 69 6c 65 6e 61 6d  of.type "filenam
22b0: 65 22 2e 20 42 65 68 69 6e 64 20 74 68 65 20 73  e". Behind the s
22c0: 63 65 6e 65 2c 20 74 68 65 20 65 78 74 65 72 6e  cene, the extern
22d0: 61 6c 20 65 6e 74 69 74 79 20 72 65 66 65 72 65  al entity refere
22e0: 6e 63 65 64 20 62 79 0a 74 68 65 20 72 65 74 75  nced by.the retu
22f0: 72 6e 65 64 20 54 63 6c 20 63 68 61 6e 6e 65 6c  rned Tcl channel
2300: 2c 20 73 74 72 69 6e 67 20 6f 72 20 66 69 6c 65  , string or file
2310: 20 6e 61 6d 65 20 77 69 6c 6c 20 62 65 20 70 61   name will be pa
2320: 72 73 65 64 20 77 69 74 68 20 61 6e 20 65 78 70  rsed with an exp
2330: 61 74 0a 65 78 74 65 72 6e 61 6c 20 65 6e 74 69  at.external enti
2340: 74 79 20 70 61 72 73 65 72 20 77 69 74 68 20 74  ty parser with t
2350: 68 65 20 73 61 6d 65 20 68 61 6e 64 6c 65 72 20  he same handler 
2360: 73 65 74 73 20 61 73 20 74 68 65 20 6d 61 69 6e  sets as the main
2370: 20 70 61 72 73 65 72 2e 20 49 66 0a 70 61 72 73   parser. If.pars
2380: 69 6e 67 20 6f 66 20 74 68 65 20 65 78 74 65 72  ing of the exter
2390: 6e 61 6c 20 65 6e 74 69 74 79 20 66 61 69 6c 73  nal entity fails
23a0: 2c 20 74 68 65 20 77 68 6f 6c 65 20 70 61 72 73  , the whole pars
23b0: 69 6e 67 20 69 73 20 73 74 6f 70 70 65 64 20 77  ing is stopped w
23c0: 69 74 68 20 61 6e 0a 65 72 72 6f 72 20 6d 65 73  ith an.error mes
23d0: 73 61 67 65 2e 20 49 66 20 61 20 54 63 6c 20 63  sage. If a Tcl c
23e0: 6f 6d 6d 61 6e 64 20 72 65 67 69 73 74 65 72 65  ommand registere
23f0: 64 20 61 73 20 65 78 74 65 72 6e 61 6c 65 6e 74  d as externalent
2400: 69 74 79 63 6f 6d 6d 61 6e 64 20 69 73 6e 27 74  itycommand isn't
2410: 20 61 62 6c 65 0a 74 6f 20 72 65 73 6f 6c 76 65   able.to resolve
2420: 20 61 6e 20 65 78 74 65 72 6e 61 6c 20 65 6e 74   an external ent
2430: 69 74 79 20 69 74 20 69 73 20 61 6c 6c 6f 77 65  ity it is allowe
2440: 64 20 74 6f 20 72 65 74 75 72 6e 20 54 43 4c 5f  d to return TCL_
2450: 43 4f 4e 54 49 4e 55 45 2e 20 49 6e 20 74 68 69  CONTINUE. In thi
2460: 73 0a 63 61 73 65 2c 20 74 68 65 20 77 72 61 70  s.case, the wrap
2470: 70 65 72 20 67 69 76 65 20 74 68 65 20 6e 65 78  per give the nex
2480: 74 20 72 65 67 69 73 74 65 72 65 64 20 65 78 74  t registered ext
2490: 65 72 6e 61 6c 65 6e 74 69 74 79 63 6f 6d 6d 61  ernalentitycomma
24a0: 6e 64 20 61 20 74 72 79 2e 20 49 66 20 6e 6f 0a  nd a try. If no.
24b0: 65 78 74 65 72 6e 61 6c 65 6e 74 69 74 79 63 6f  externalentityco
24c0: 6d 6d 61 6e 64 20 69 73 20 61 62 6c 65 20 74 6f  mmand is able to
24d0: 20 68 61 6e 64 6c 65 20 74 68 65 20 65 78 74 65   handle the exte
24e0: 72 6e 61 6c 20 65 6e 74 69 74 79 20 70 61 72 73  rnal entity pars
24f0: 69 6e 67 20 73 74 6f 70 73 20 77 69 74 68 0a 61  ing stops with.a
2500: 6e 20 65 72 72 6f 72 2e 3c 2f 70 3e 0a 0a 3c 70  n error.</p>..<p
2510: 3e 45 78 61 6d 70 6c 65 3a 3c 2f 70 3e 0a 0a 3c  >Example:</p>..<
2520: 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61 6d 70  pre class="examp
2530: 6c 65 22 3e 70 72 6f 63 20 65 78 74 65 72 6e 61  le">proc externa
2540: 6c 45 6e 74 69 74 79 52 65 66 48 61 6e 64 6c 65  lEntityRefHandle
2550: 72 20 7b 62 61 73 65 20 73 79 73 74 65 6d 49 64  r {base systemId
2560: 20 70 75 62 6c 69 63 49 64 7d 20 7b 0a 20 20 20   publicId} {.   
2570: 20 69 66 20 7b 21 5b 72 65 67 65 78 70 20 7b 5e   if {![regexp {^
2580: 5b 61 2d 7a 41 2d 5a 5d 2b 3a 2f 7d 20 24 73 79  [a-zA-Z]+:/} $sy
2590: 73 74 65 6d 49 64 5d 7d 20 20 7b 0a 20 20 20 20  stemId]}  {.    
25a0: 20 20 20 20 72 65 67 73 75 62 20 7b 5e 5b 61 2d      regsub {^[a-
25b0: 7a 41 2d 5a 5d 2b 3a 7d 20 24 62 61 73 65 20 7b  zA-Z]+:} $base {
25c0: 7d 20 62 61 73 65 0a 20 20 20 20 20 20 20 20 73  } base.        s
25d0: 65 74 20 62 61 73 65 64 69 72 20 5b 66 69 6c 65  et basedir [file
25e0: 20 64 69 72 6e 61 6d 65 20 24 62 61 73 65 5d 0a   dirname $base].
25f0: 20 20 20 20 20 20 20 20 73 65 74 20 73 79 73 74          set syst
2600: 65 6d 49 64 20 22 5b 73 65 74 20 62 61 73 65 64  emId "[set based
2610: 69 72 5d 2f 5b 73 65 74 20 73 79 73 74 65 6d 49  ir]/[set systemI
2620: 64 5d 22 0a 20 20 20 20 7d 20 65 6c 73 65 20 7b  d]".    } else {
2630: 0a 20 20 20 20 20 20 20 20 72 65 67 73 75 62 20  .        regsub 
2640: 7b 5e 5b 61 2d 7a 41 2d 5a 5d 2b 3a 7d 20 24 73  {^[a-zA-Z]+:} $s
2650: 79 73 74 65 6d 49 64 20 73 79 73 74 65 6d 49 64  ystemId systemId
2660: 0a 20 20 20 20 7d 0a 20 20 20 20 69 66 20 7b 5b  .    }.    if {[
2670: 63 61 74 63 68 20 7b 73 65 74 20 66 64 20 5b 6f  catch {set fd [o
2680: 70 65 6e 20 24 73 79 73 74 65 6d 49 64 5d 7d 5d  pen $systemId]}]
2690: 7d 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75  } {.        retu
26a0: 72 6e 20 2d 63 6f 64 65 20 65 72 72 6f 72 20 5c  rn -code error \
26b0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
26c0: 20 2d 65 72 72 6f 72 69 6e 66 6f 20 22 46 61 69   -errorinfo "Fai
26d0: 6c 65 64 20 74 6f 20 6f 70 65 6e 20 65 78 74 65  led to open exte
26e0: 72 6e 61 6c 20 65 6e 74 69 74 79 20 24 73 79 73  rnal entity $sys
26f0: 74 65 6d 49 64 22 0a 20 20 20 20 7d 0a 20 20 20  temId".    }.   
2700: 20 72 65 74 75 72 6e 20 5b 6c 69 73 74 20 63 68   return [list ch
2710: 61 6e 6e 65 6c 20 24 73 79 73 74 65 6d 49 64 20  annel $systemId 
2720: 24 66 64 5d 0a 7d 0a 0a 73 65 74 20 70 61 72 73  $fd].}..set pars
2730: 65 72 20 5b 65 78 70 61 74 20 2d 65 78 74 65 72  er [expat -exter
2740: 6e 61 6c 65 6e 74 69 74 79 63 6f 6d 6d 61 6e 64  nalentitycommand
2750: 20 65 78 74 65 72 6e 61 6c 45 6e 74 69 74 79 52   externalEntityR
2760: 65 66 48 61 6e 64 6c 65 72 20 5c 0a 20 20 20 20  efHandler \.    
2770: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 62                -b
2780: 61 73 65 75 72 6c 20 22 66 69 6c 65 3a 2f 2f 2f  aseurl "file:///
2790: 6c 6f 63 61 6c 2f 64 6f 63 2f 64 6f 63 2e 78 6d  local/doc/doc.xm
27a0: 6c 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  l" \.           
27b0: 20 20 20 20 20 20 20 2d 70 61 72 61 6d 65 6e 74         -parament
27c0: 69 74 79 70 61 72 73 69 6e 67 20 6e 6f 74 73 74  ityparsing notst
27d0: 61 6e 64 61 6c 6f 6e 65 5d 0a 24 70 61 72 73 65  andalone].$parse
27e0: 72 20 70 61 72 73 65 20 7b 26 6c 74 3b 3f 78 6d  r parse {&lt;?xm
27f0: 6c 20 76 65 72 73 69 6f 6e 3d 27 31 2e 30 27 3f  l version='1.0'?
2800: 26 67 74 3b 0a 26 6c 74 3b 21 44 4f 43 54 59 50  &gt;.&lt;!DOCTYP
2810: 45 20 74 65 73 74 20 53 59 53 54 45 4d 20 22 74  E test SYSTEM "t
2820: 65 73 74 2e 64 74 64 22 26 67 74 3b 0a 26 6c 74  est.dtd"&gt;.&lt
2830: 3b 74 65 73 74 2f 26 67 74 3b 7d 0a 3c 2f 70 72  ;test/&gt;}.</pr
2840: 65 3e 0a 0a 3c 70 3e 54 68 69 73 20 77 6f 75 6c  e>..<p>This woul
2850: 64 20 72 65 73 75 6c 74 20 69 6e 20 74 68 65 20  d result in the 
2860: 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e  following comman
2870: 64 20 62 65 69 6e 67 20 69 6e 76 6f 6b 65 64 3a  d being invoked:
2880: 3c 2f 70 3e 0a 0a 3c 70 72 65 20 63 6c 61 73 73  </p>..<pre class
2890: 3d 22 65 78 61 6d 70 6c 65 22 3e 0a 65 78 74 65  ="example">.exte
28a0: 72 6e 61 6c 45 6e 74 69 74 79 52 65 66 48 61 6e  rnalEntityRefHan
28b0: 64 6c 65 72 20 66 69 6c 65 3a 2f 2f 2f 6c 6f 63  dler file:///loc
28c0: 61 6c 2f 64 6f 63 2f 64 6f 63 2e 78 6d 6c 20 74  al/doc/doc.xml t
28d0: 65 73 74 2e 64 74 64 20 7b 7d 0a 3c 2f 70 72 65  est.dtd {}.</pre
28e0: 3e 0a 0a 3c 70 3e 45 78 74 65 72 6e 61 6c 20 65  >..<p>External e
28f0: 6e 74 69 74 69 65 73 20 61 72 65 20 6f 6e 6c 79  ntities are only
2900: 20 74 72 69 65 64 20 74 6f 20 72 65 73 6f 6c 76   tried to resolv
2910: 65 20 76 69 61 20 74 68 69 73 20 68 61 6e 64 6c  e via this handl
2920: 65 72 20 73 63 72 69 70 74 2c 20 69 66 0a 6e 65  er script, if.ne
2930: 63 65 73 73 61 72 79 2e 20 54 68 69 73 20 6d 65  cessary. This me
2940: 61 6e 73 2c 20 65 78 74 65 72 6e 61 6c 20 70 61  ans, external pa
2950: 72 61 6d 65 74 65 72 20 65 6e 74 69 74 69 65 73  rameter entities
2960: 20 74 72 69 67 67 65 72 73 20 74 68 69 73 20 68   triggers this h
2970: 61 6e 64 6c 65 72 20 6f 6e 6c 79 2c 0a 69 66 20  andler only,.if 
2980: 2d 70 61 72 61 6d 65 6e 74 69 74 79 70 61 72 73  -paramentitypars
2990: 69 6e 67 20 69 73 20 75 73 65 64 20 77 69 74 68  ing is used with
29a0: 20 61 72 67 75 6d 65 6e 74 20 22 61 6c 77 61 79   argument "alway
29b0: 73 22 20 6f 72 20 69 66 0a 2d 70 61 72 61 6d 65  s" or if.-parame
29c0: 6e 74 69 74 79 70 61 72 73 69 6e 67 20 69 73 20  ntityparsing is 
29d0: 75 73 65 64 20 77 69 74 68 20 61 72 67 75 6d 65  used with argume
29e0: 6e 74 20 22 6e 6f 74 73 74 61 6e 64 61 6c 6f 6e  nt "notstandalon
29f0: 65 22 20 61 6e 64 20 74 68 65 0a 64 6f 63 75 6d  e" and the.docum
2a00: 65 6e 74 20 69 73 6e 27 74 20 6d 61 72 6b 65 64  ent isn't marked
2a10: 20 61 73 20 73 74 61 6e 64 61 6c 6f 6e 65 2e 3c   as standalone.<
2a20: 2f 70 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  /p>.            
2a30: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 20  </dd>.        . 
2a40: 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20         .        
2a50: 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a  .          <dt>.
2a60: 3c 62 3e 20 2d 75 6e 6b 6e 6f 77 6e 65 6e 63 6f  <b> -unknownenco
2a70: 64 69 6e 67 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20  dingcommand</b> 
2a80: 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f  <i>script</i>.</
2a90: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
2aa0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70            <dd><p
2ab0: 3e 4e 6f 74 20 69 6d 70 6c 65 6d 65 6e 74 65 64  >Not implemented
2ac0: 20 61 74 20 54 63 6c 20 6c 65 76 65 6c 2e 3c 2f   at Tcl level.</
2ad0: 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  p></dd>.        
2ae0: 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20  ..        .     
2af0: 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 2d 73 74       <dt>.<b>-st
2b00: 61 72 74 6e 61 6d 65 73 70 61 63 65 64 65 63 6c  artnamespacedecl
2b10: 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e 73  command</b> <i>s
2b20: 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a  cript</i>.</dt>.
2b30: 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20            ..    
2b40: 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 53 70 65        <dd><p>Spe
2b50: 63 69 66 69 65 73 20 61 20 54 63 6c 20 63 6f 6d  cifies a Tcl com
2b60: 6d 61 6e 64 20 74 6f 20 61 73 73 6f 63 69 61 74  mand to associat
2b70: 65 20 77 69 74 68 20 73 74 61 72 74 20 73 63 6f  e with start sco
2b80: 70 65 20 6f 66 0a 6e 61 6d 65 73 70 61 63 65 20  pe of.namespace 
2b90: 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 69 6e 20  declarations in 
2ba0: 74 68 65 20 64 6f 63 75 6d 65 6e 74 2e 20 54 68  the document. Th
2bb0: 65 20 61 63 74 75 61 6c 20 63 6f 6d 6d 61 6e 64  e actual command
2bc0: 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68 69   consists of thi
2bd0: 73 0a 6f 70 74 69 6f 6e 20 66 6f 6c 6c 6f 77 65  s.option followe
2be0: 64 20 62 79 20 74 77 6f 20 61 72 67 75 6d 65 6e  d by two argumen
2bf0: 74 73 3a 20 74 68 65 20 6e 61 6d 65 73 70 61 63  ts: the namespac
2c00: 65 20 70 72 65 66 69 78 20 61 6e 64 20 74 68 65  e prefix and the
2c10: 20 6e 61 6d 65 73 70 61 63 65 0a 55 52 49 2e 20   namespace.URI. 
2c20: 46 6f 72 20 61 6e 20 78 6d 6c 6e 73 20 61 74 74  For an xmlns att
2c30: 72 69 62 75 74 65 2c 20 70 72 65 66 69 78 20 77  ribute, prefix w
2c40: 69 6c 6c 20 62 65 20 74 68 65 20 65 6d 70 74 79  ill be the empty
2c50: 20 6c 69 73 74 2e 20 20 46 6f 72 20 61 6e 0a 78   list.  For an.x
2c60: 6d 6c 6e 73 3d 22 22 20 61 74 74 72 69 62 75 74  mlns="" attribut
2c70: 65 2c 20 75 72 69 20 77 69 6c 6c 20 62 65 20 74  e, uri will be t
2c80: 68 65 20 65 6d 70 74 79 20 6c 69 73 74 2e 20 54  he empty list. T
2c90: 68 65 20 63 61 6c 6c 20 74 6f 20 74 68 65 20 73  he call to the s
2ca0: 74 61 72 74 0a 61 6e 64 20 65 6e 64 20 65 6c 65  tart.and end ele
2cb0: 6d 65 6e 74 20 68 61 6e 64 6c 65 72 73 20 6f 63  ment handlers oc
2cc0: 63 75 72 20 62 65 74 77 65 65 6e 20 74 68 65 20  cur between the 
2cd0: 63 61 6c 6c 73 20 74 6f 20 74 68 65 20 73 74 61  calls to the sta
2ce0: 72 74 20 61 6e 64 20 65 6e 64 20 6e 61 6d 65 73  rt and end names
2cf0: 70 61 63 65 0a 64 65 63 6c 61 72 61 74 69 6f 6e  pace.declaration
2d00: 20 68 61 6e 64 6c 65 72 73 2e 3c 2f 70 3e 3c 2f   handlers.</p></
2d10: 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a 20 20  dd>.        ..  
2d20: 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 20        .         
2d30: 20 3c 64 74 3e 0a 3c 62 3e 20 2d 65 6e 64 6e 61   <dt>.<b> -endna
2d40: 6d 65 73 70 61 63 65 64 65 63 6c 63 6f 6d 6d 61  mespacedeclcomma
2d50: 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69 70 74  nd</b> <i>script
2d60: 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20 20  </i>.</dt>.     
2d70: 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20       ..         
2d80: 20 3c 64 64 3e 3c 70 3e 53 70 65 63 69 66 69 65   <dd><p>Specifie
2d90: 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e 64 20  s a Tcl command 
2da0: 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77 69 74  to associate wit
2db0: 68 20 65 6e 64 20 73 63 6f 70 65 20 6f 66 0a 6e  h end scope of.n
2dc0: 61 6d 65 73 70 61 63 65 20 64 65 63 6c 61 72 61  amespace declara
2dd0: 74 69 6f 6e 73 20 69 6e 20 74 68 65 20 64 6f 63  tions in the doc
2de0: 75 6d 65 6e 74 2e 20 54 68 65 20 61 63 74 75 61  ument. The actua
2df0: 6c 20 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73 69 73  l command consis
2e00: 74 73 20 6f 66 20 74 68 69 73 0a 6f 70 74 69 6f  ts of this.optio
2e10: 6e 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 74 68  n followed by th
2e20: 65 20 6e 61 6d 65 73 70 61 63 65 20 70 72 65 66  e namespace pref
2e30: 69 78 20 61 73 20 61 72 67 75 6d 65 6e 74 2e 20  ix as argument. 
2e40: 49 6e 20 63 61 73 65 20 6f 66 20 61 6e 20 78 6d  In case of an xm
2e50: 6c 6e 73 0a 61 74 74 72 69 62 75 74 65 2c 20 70  lns.attribute, p
2e60: 72 65 66 69 78 20 77 69 6c 6c 20 62 65 20 74 68  refix will be th
2e70: 65 20 65 6d 70 74 79 20 6c 69 73 74 2e 20 54 68  e empty list. Th
2e80: 65 20 63 61 6c 6c 20 74 6f 20 74 68 65 20 73 74  e call to the st
2e90: 61 72 74 20 61 6e 64 20 65 6e 64 20 65 6c 65 6d  art and end elem
2ea0: 65 6e 74 0a 68 61 6e 64 6c 65 72 73 20 6f 63 63  ent.handlers occ
2eb0: 75 72 20 62 65 74 77 65 65 6e 20 74 68 65 20 63  ur between the c
2ec0: 61 6c 6c 73 20 74 6f 20 74 68 65 20 73 74 61 72  alls to the star
2ed0: 74 20 61 6e 64 20 65 6e 64 20 6e 61 6d 65 73 70  t and end namesp
2ee0: 61 63 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a  ace declaration.
2ef0: 68 61 6e 64 6c 65 72 73 2e 3c 2f 70 3e 3c 2f 64  handlers.</p></d
2f00: 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a 20 20 20  d>.        ..   
2f10: 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20       .          
2f20: 3c 64 74 3e 0a 3c 62 3e 20 2d 63 6f 6d 6d 65 6e  <dt>.<b> -commen
2f30: 74 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e  tcommand</b> <i>
2f40: 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e  script</i>.</dt>
2f50: 0a 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20  .          ..   
2f60: 20 20 20 20 20 20 20 3c 64 64 3e 0a 3c 70 3e 53         <dd>.<p>S
2f70: 70 65 63 69 66 69 65 73 20 61 20 54 63 6c 20 63  pecifies a Tcl c
2f80: 6f 6d 6d 61 6e 64 20 74 6f 20 61 73 73 6f 63 69  ommand to associ
2f90: 61 74 65 20 77 69 74 68 20 63 6f 6d 6d 65 6e 74  ate with comment
2fa0: 73 20 69 6e 20 74 68 65 0a 64 6f 63 75 6d 65 6e  s in the.documen
2fb0: 74 2e 20 54 68 65 20 61 63 74 75 61 6c 20 63 6f  t. The actual co
2fc0: 6d 6d 61 6e 64 20 63 6f 6e 73 69 73 74 73 20 6f  mmand consists o
2fd0: 66 20 74 68 69 73 20 6f 70 74 69 6f 6e 20 66 6f  f this option fo
2fe0: 6c 6c 6f 77 65 64 20 62 79 20 6f 6e 65 20 61 72  llowed by one ar
2ff0: 67 75 6d 65 6e 74 3a 0a 74 68 65 20 63 6f 6d 6d  gument:.the comm
3000: 65 6e 74 20 64 61 74 61 2e 3c 2f 70 3e 0a 0a 3c  ent data.</p>..<
3010: 70 3e 45 78 61 6d 70 6c 65 3a 3c 2f 70 3e 0a 0a  p>Example:</p>..
3020: 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61 6d  <pre class="exam
3030: 70 6c 65 22 3e 0a 70 72 6f 63 20 48 61 6e 64 6c  ple">.proc Handl
3040: 65 43 6f 6d 6d 65 6e 74 20 7b 64 61 74 61 7d 20  eComment {data} 
3050: 7b 0a 20 20 20 20 70 75 74 73 20 73 74 64 65 72  {.    puts stder
3060: 72 20 22 43 6f 6d 6d 65 6e 74 20 3d 3d 26 67 74  r "Comment ==&gt
3070: 3b 20 24 64 61 74 61 22 0a 7d 0a 0a 24 70 61 72  ; $data".}..$par
3080: 73 65 72 20 63 6f 6e 66 69 67 75 72 65 20 2d 63  ser configure -c
3090: 6f 6d 6d 65 6e 74 63 6f 6d 6d 61 6e 64 20 48 61  ommentcommand Ha
30a0: 6e 64 6c 65 43 6f 6d 6d 65 6e 74 0a 0a 24 70 61  ndleComment..$pa
30b0: 72 73 65 72 20 70 61 72 73 65 20 7b 26 6c 74 3b  rser parse {&lt;
30c0: 74 65 73 74 26 67 74 3b 26 6c 74 3b 21 2d 2d 20  test&gt;&lt;!-- 
30d0: 74 68 69 73 20 69 73 20 26 6c 74 3b 6f 62 76 69  this is &lt;obvi
30e0: 6f 75 73 6c 79 26 67 74 3b 20 61 20 63 6f 6d 6d  ously&gt; a comm
30f0: 65 6e 74 20 2d 2d 26 67 74 3b 26 6c 74 3b 2f 74  ent --&gt;&lt;/t
3100: 65 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a  est&gt;}.</pre>.
3110: 0a 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64 20 72  .<p>This would r
3120: 65 73 75 6c 74 20 69 6e 20 74 68 65 20 66 6f 6c  esult in the fol
3130: 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 20 62  lowing command b
3140: 65 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70  eing invoked:</p
3150: 3e 0a 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22 65  >..<pre class="e
3160: 78 61 6d 70 6c 65 22 3e 0a 48 61 6e 64 6c 65 43  xample">.HandleC
3170: 6f 6d 6d 65 6e 74 20 7b 20 74 68 69 73 20 69 73  omment { this is
3180: 20 26 6c 74 3b 6f 62 76 69 6f 75 73 6c 79 26 67   &lt;obviously&g
3190: 74 3b 20 61 20 63 6f 6d 6d 65 6e 74 20 7d 0a 3c  t; a comment }.<
31a0: 2f 70 72 65 3e 0a 20 20 20 20 20 20 20 20 20 20  /pre>.          
31b0: 20 20 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20    </dd>.        
31c0: 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20  .        .      
31d0: 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74    .          <dt
31e0: 3e 0a 3c 62 3e 20 2d 6e 6f 74 73 74 61 6e 64 61  >.<b> -notstanda
31f0: 6c 6f 6e 65 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20  lonecommand</b> 
3200: 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f  <i>script</i>.</
3210: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
3220: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70            <dd><p
3230: 3e 54 68 69 73 20 54 63 6c 20 63 6f 6d 6d 61 6e  >This Tcl comman
3240: 64 20 69 73 20 63 61 6c 6c 65 64 2c 20 69 66 20  d is called, if 
3250: 74 68 65 20 64 6f 63 75 6d 65 6e 74 20 69 73 20  the document is 
3260: 6e 6f 74 0a 73 74 61 6e 64 61 6c 6f 6e 65 20 28  not.standalone (
3270: 69 74 20 68 61 73 20 61 6e 20 65 78 74 65 72 6e  it has an extern
3280: 61 6c 20 73 75 62 73 65 74 20 6f 72 20 61 20 72  al subset or a r
3290: 65 66 65 72 65 6e 63 65 20 74 6f 20 61 20 70 61  eference to a pa
32a0: 72 61 6d 65 74 65 72 20 65 6e 74 69 74 79 2c 20  rameter entity, 
32b0: 62 75 74 0a 64 6f 65 73 20 6e 6f 74 20 68 61 76  but.does not hav
32c0: 65 20 73 74 61 6e 64 61 6c 6f 6e 65 3d 22 79 65  e standalone="ye
32d0: 73 22 29 2e 20 49 74 20 69 73 20 63 61 6c 6c 65  s"). It is calle
32e0: 64 20 77 69 74 68 20 6e 6f 20 61 64 64 69 74 69  d with no additi
32f0: 6f 6e 61 6c 0a 61 72 67 75 6d 65 6e 74 73 2e 3c  onal.arguments.<
3300: 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  /p></dd>.       
3310: 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20   ..        .    
3320: 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 20 2d        <dt>.<b> -
3330: 73 74 61 72 74 63 64 61 74 61 73 65 63 74 69 6f  startcdatasectio
3340: 6e 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e  ncommand</b> <i>
3350: 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e  script</i>.</dt>
3360: 0a 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20  .          ..   
3370: 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 53 70         <dd><p>Sp
3380: 65 63 69 66 69 65 73 20 61 20 54 63 6c 20 63 6f  ecifies a Tcl co
3390: 6d 6d 61 6e 64 20 74 6f 20 61 73 73 6f 63 69 61  mmand to associa
33a0: 74 65 20 77 69 74 68 20 74 68 65 20 73 74 61 72  te with the star
33b0: 74 20 6f 66 20 61 0a 43 44 41 54 41 20 73 65 63  t of a.CDATA sec
33c0: 74 69 6f 6e 2e 20 20 49 74 20 69 73 20 63 61 6c  tion.  It is cal
33d0: 6c 65 64 20 77 69 74 68 20 6e 6f 20 61 64 64 69  led with no addi
33e0: 74 69 6f 6e 61 6c 20 61 72 67 75 6d 65 6e 74 73  tional arguments
33f0: 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20  .</p></dd>.     
3400: 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20     ..        .  
3410: 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e          <dt>.<b>
3420: 20 2d 65 6e 64 63 64 61 74 61 73 65 63 74 69 6f   -endcdatasectio
3430: 6e 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e  ncommand</b> <i>
3440: 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e  script</i>.</dt>
3450: 0a 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20  .          ..   
3460: 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 53 70         <dd><p>Sp
3470: 65 63 69 66 69 65 73 20 61 20 54 63 6c 20 63 6f  ecifies a Tcl co
3480: 6d 6d 61 6e 64 20 74 6f 20 61 73 73 6f 63 69 61  mmand to associa
3490: 74 65 20 77 69 74 68 20 74 68 65 20 65 6e 64 20  te with the end 
34a0: 6f 66 20 61 20 43 44 41 54 41 0a 73 65 63 74 69  of a CDATA.secti
34b0: 6f 6e 2e 20 20 49 74 20 69 73 20 63 61 6c 6c 65  on.  It is calle
34c0: 64 20 77 69 74 68 20 6e 6f 20 61 64 64 69 74 69  d with no additi
34d0: 6f 6e 61 6c 20 61 72 67 75 6d 65 6e 74 73 2e 3c  onal arguments.<
34e0: 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20  /p></dd>.       
34f0: 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20   ..        .    
3500: 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 20 2d        <dt>.<b> -
3510: 65 6c 65 6d 65 6e 74 64 65 63 6c 63 6f 6d 6d 61  elementdeclcomma
3520: 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69 70 74  nd</b> <i>script
3530: 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20 20  </i>.</dt>.     
3540: 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20       ..         
3550: 20 3c 64 64 3e 0a 3c 70 3e 53 70 65 63 69 66 69   <dd>.<p>Specifi
3560: 65 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e 64  es a Tcl command
3570: 20 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77 69   to associate wi
3580: 74 68 20 65 6c 65 6d 65 6e 74 0a 64 65 63 6c 61  th element.decla
3590: 72 61 74 69 6f 6e 73 2e 20 54 68 65 20 61 63 74  rations. The act
35a0: 75 61 6c 20 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73  ual command cons
35b0: 69 73 74 73 20 6f 66 20 74 68 69 73 20 6f 70 74  ists of this opt
35c0: 69 6f 6e 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20  ion followed by 
35d0: 74 77 6f 0a 61 72 67 75 6d 65 6e 74 73 3a 20 74  two.arguments: t
35e0: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 65  he name of the e
35f0: 6c 65 6d 65 6e 74 20 61 6e 64 20 74 68 65 20 63  lement and the c
3600: 6f 6e 74 65 6e 74 20 6d 6f 64 65 6c 2e 20 54 68  ontent model. Th
3610: 65 20 63 6f 6e 74 65 6e 74 20 6d 6f 64 65 6c 20  e content model 
3620: 61 72 67 0a 69 73 20 61 20 74 63 6c 20 6c 69 73  arg.is a tcl lis
3630: 74 20 6f 66 20 66 6f 75 72 20 65 6c 65 6d 65 6e  t of four elemen
3640: 74 73 2e 20 54 68 65 20 66 69 72 73 74 20 6c 69  ts. The first li
3650: 73 74 20 65 6c 65 6d 65 6e 74 20 73 70 65 63 69  st element speci
3660: 66 69 65 73 20 74 68 65 20 74 79 70 65 20 6f 66  fies the type of
3670: 0a 74 68 65 20 58 4d 4c 20 65 6c 65 6d 65 6e 74  .the XML element
3680: 3b 20 74 68 65 20 73 69 78 20 64 69 66 66 65 72  ; the six differ
3690: 65 6e 74 20 70 6f 73 73 69 62 6c 65 20 74 79 70  ent possible typ
36a0: 65 73 20 61 72 65 20 72 65 70 6f 72 74 65 64 20  es are reported 
36b0: 61 73 0a 22 4d 49 58 45 44 22 2c 20 22 4e 41 4d  as."MIXED", "NAM
36c0: 45 22 2c 20 22 45 4d 50 54 59 22 2c 20 22 43 48  E", "EMPTY", "CH
36d0: 4f 49 43 45 22 2c 0a 22 53 45 51 22 20 6f 72 20  OICE",."SEQ" or 
36e0: 22 41 4e 59 22 2e 20 54 68 65 20 73 65 63 6f 6e  "ANY". The secon
36f0: 64 20 6c 69 73 74 20 65 6c 65 6d 65 6e 74 20 72  d list element r
3700: 65 70 6f 72 74 73 20 74 68 65 0a 71 75 61 6e 74  eports the.quant
3710: 69 66 69 65 72 20 74 6f 20 74 68 65 20 63 6f 6e  ifier to the con
3720: 74 65 6e 74 20 6d 6f 64 65 6c 20 69 6e 20 58 4d  tent model in XM
3730: 4c 20 53 79 6e 74 61 78 20 28 22 3f 22 2c 20 22  L Syntax ("?", "
3740: 2a 22 20 6f 72 0a 22 2b 22 29 20 6f 72 20 69 73  *" or."+") or is
3750: 20 74 68 65 20 65 6d 70 74 79 20 6c 69 73 74 2e   the empty list.
3760: 20 49 66 20 74 68 65 20 74 79 70 65 20 69 73 20   If the type is 
3770: 22 4d 49 58 45 44 22 2c 20 74 68 65 6e 20 74 68  "MIXED", then th
3780: 65 0a 71 75 61 6e 74 69 66 69 65 72 20 77 69 6c  e.quantifier wil
3790: 6c 20 62 65 20 22 7b 7d 22 2c 20 69 6e 64 69 63  l be "{}", indic
37a0: 61 74 69 6e 67 20 61 6e 20 50 43 44 41 54 41 20  ating an PCDATA 
37b0: 6f 6e 6c 79 20 65 6c 65 6d 65 6e 74 2c 20 6f 72  only element, or
37c0: 0a 22 2a 22 2c 20 77 69 74 68 20 74 68 65 20 61  ."*", with the a
37d0: 6c 6c 6f 77 65 64 20 65 6c 65 6d 65 6e 74 73 20  llowed elements 
37e0: 74 6f 20 69 6e 74 65 72 6d 69 78 20 77 69 74 68  to intermix with
37f0: 20 50 43 44 41 54 41 20 61 73 20 74 63 6c 20 6c   PCDATA as tcl l
3800: 69 73 74 20 61 73 0a 74 68 65 20 66 6f 75 72 74  ist as.the fourt
3810: 68 20 61 72 67 75 6d 65 6e 74 2e 20 49 66 20 74  h argument. If t
3820: 68 65 20 74 79 70 65 20 69 73 20 22 4e 41 4d 45  he type is "NAME
3830: 22 2c 20 74 68 65 20 6e 61 6d 65 20 69 73 20 74  ", the name is t
3840: 68 65 20 74 68 69 72 64 0a 61 72 67 3b 20 6f 74  he third.arg; ot
3850: 68 65 72 77 69 73 65 20 74 68 65 20 74 68 69 72  herwise the thir
3860: 64 20 61 72 67 75 6d 65 6e 74 20 69 73 20 74 68  d argument is th
3870: 65 20 65 6d 70 74 79 20 6c 69 73 74 2e 20 49 66  e empty list. If
3880: 20 74 68 65 20 74 79 70 65 20 69 73 0a 22 43 48   the type is."CH
3890: 4f 49 43 45 22 20 6f 72 20 22 53 45 51 22 20 74  OICE" or "SEQ" t
38a0: 68 65 20 66 6f 75 72 74 68 20 61 72 67 75 6d 65  he fourth argume
38b0: 6e 74 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20  nt will contain 
38c0: 61 20 6c 69 73 74 0a 6f 66 20 63 6f 6e 74 65 6e  a list.of conten
38d0: 74 20 6d 6f 64 65 6c 73 20 62 75 69 6c 64 20 6c  t models build l
38e0: 69 6b 65 20 74 68 69 73 20 6f 6e 65 2e 20 54 68  ike this one. Th
38f0: 65 20 22 45 4d 50 54 59 22 2c 20 22 41 4e 59 22  e "EMPTY", "ANY"
3900: 2c 0a 61 6e 64 20 22 4d 49 58 45 44 22 20 74 79  ,.and "MIXED" ty
3910: 70 65 73 20 77 69 6c 6c 20 6f 6e 6c 79 20 6f 63  pes will only oc
3920: 63 75 72 20 61 74 20 74 6f 70 20 6c 65 76 65 6c  cur at top level
3930: 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 78 61 6d 70 6c  .</p>..<p>Exampl
3940: 65 73 3a 3c 2f 70 3e 0a 0a 3c 70 72 65 20 63 6c  es:</p>..<pre cl
3950: 61 73 73 3d 22 65 78 61 6d 70 6c 65 22 3e 0a 70  ass="example">.p
3960: 72 6f 63 20 65 6c 44 65 63 6c 48 61 6e 64 6c 65  roc elDeclHandle
3970: 72 20 7b 6e 61 6d 65 20 63 6f 6e 74 65 6e 74 7d  r {name content}
3980: 20 7b 0a 20 20 20 20 20 70 75 74 73 20 22 24 6e   {.     puts "$n
3990: 61 6d 65 20 24 63 6f 6e 74 65 6e 74 22 0a 7d 0a  ame $content".}.
39a0: 0a 73 65 74 20 70 61 72 73 65 72 20 5b 65 78 70  .set parser [exp
39b0: 61 74 20 2d 65 6c 65 6d 65 6e 74 64 65 63 6c 63  at -elementdeclc
39c0: 6f 6d 6d 61 6e 64 20 65 6c 44 65 63 6c 48 61 6e  ommand elDeclHan
39d0: 64 6c 65 72 5d 0a 24 70 61 72 73 65 72 20 70 61  dler].$parser pa
39e0: 72 73 65 20 7b 26 6c 74 3b 3f 78 6d 6c 20 76 65  rse {&lt;?xml ve
39f0: 72 73 69 6f 6e 3d 27 31 2e 30 27 3f 26 67 74 3b  rsion='1.0'?&gt;
3a00: 0a 26 6c 74 3b 21 44 4f 43 54 59 50 45 20 74 65  .&lt;!DOCTYPE te
3a10: 73 74 20 5b 0a 26 6c 74 3b 21 45 4c 45 4d 45 4e  st [.&lt;!ELEMEN
3a20: 54 20 74 65 73 74 20 28 23 50 43 44 41 54 41 29  T test (#PCDATA)
3a30: 26 67 74 3b 20 0a 5d 26 67 74 3b 0a 26 6c 74 3b  &gt; .]&gt;.&lt;
3a40: 74 65 73 74 26 67 74 3b 66 6f 6f 26 6c 74 3b 2f  test&gt;foo&lt;/
3a50: 74 65 73 74 26 67 74 3b 7d 0a 3c 2f 70 72 65 3e  test&gt;}.</pre>
3a60: 0a 0a 3c 70 3e 54 68 69 73 20 77 6f 75 6c 64 20  ..<p>This would 
3a70: 72 65 73 75 6c 74 20 69 6e 20 74 68 65 20 66 6f  result in the fo
3a80: 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d 61 6e 64 20  llowing command 
3a90: 62 65 69 6e 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f  being invoked:</
3aa0: 70 3e 0a 0a 3c 70 72 65 20 63 6c 61 73 73 3d 22  p>..<pre class="
3ab0: 65 78 61 6d 70 6c 65 22 3e 0a 74 65 73 74 20 7b  example">.test {
3ac0: 4d 49 58 45 44 20 7b 7d 20 7b 7d 20 7b 7d 7d 0a  MIXED {} {} {}}.
3ad0: 0a 24 70 61 72 73 65 72 20 72 65 73 65 74 0a 24  .$parser reset.$
3ae0: 70 61 72 73 65 72 20 70 61 72 73 65 20 7b 26 6c  parser parse {&l
3af0: 74 3b 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 27  t;?xml version='
3b00: 31 2e 30 27 3f 26 67 74 3b 0a 26 6c 74 3b 21 44  1.0'?&gt;.&lt;!D
3b10: 4f 43 54 59 50 45 20 74 65 73 74 20 5b 0a 26 6c  OCTYPE test [.&l
3b20: 74 3b 21 45 4c 45 4d 45 4e 54 20 74 65 73 74 20  t;!ELEMENT test 
3b30: 28 61 7c 62 29 26 67 74 3b 0a 5d 26 67 74 3b 0a  (a|b)&gt;.]&gt;.
3b40: 26 6c 74 3b 74 65 73 74 26 67 74 3b 26 6c 74 3b  &lt;test&gt;&lt;
3b50: 61 2f 26 67 74 3b 26 6c 74 3b 2f 74 65 73 74 26  a/&gt;&lt;/test&
3b60: 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a 0a 3c 70 3e  gt;}.</pre>..<p>
3b70: 54 68 69 73 20 77 6f 75 6c 64 20 72 65 73 75 6c  This would resul
3b80: 74 20 69 6e 20 74 68 65 20 66 6f 6c 6c 6f 77 69  t in the followi
3b90: 6e 67 20 63 6f 6d 6d 61 6e 64 20 62 65 69 6e 67  ng command being
3ba0: 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70 3e 0a 0a 3c   invoked:</p>..<
3bb0: 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61 6d 70  pre class="examp
3bc0: 6c 65 22 3e 0a 65 6c 44 65 63 6c 48 61 6e 64 6c  le">.elDeclHandl
3bd0: 65 72 20 74 65 73 74 20 7b 43 48 4f 49 43 45 20  er test {CHOICE 
3be0: 7b 7d 20 7b 7d 20 7b 7b 4e 41 4d 45 20 7b 7d 20  {} {} {{NAME {} 
3bf0: 61 20 7b 7d 7d 20 7b 4e 41 4d 45 20 7b 7d 20 62  a {}} {NAME {} b
3c00: 20 7b 7d 7d 7d 7d 0a 3c 2f 70 72 65 3e 0a 3c 2f   {}}}}.</pre>.</
3c10: 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a 0a 20  dd>.        ... 
3c20: 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20         .        
3c30: 20 20 3c 64 74 3e 0a 3c 62 3e 20 2d 61 74 74 6c    <dt>.<b> -attl
3c40: 69 73 74 64 65 63 6c 63 6f 6d 6d 61 6e 64 3c 2f  istdeclcommand</
3c50: 62 3e 20 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e  b> <i>script</i>
3c60: 0a 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 20  .</dt>.         
3c70: 20 0a 0a 20 20 20 20 20 20 20 20 20 20 3c 64 64   ..          <dd
3c80: 3e 0a 3c 70 3e 53 70 65 63 69 66 69 65 73 20 61  >.<p>Specifies a
3c90: 20 54 63 6c 20 63 6f 6d 6d 61 6e 64 20 74 6f 20   Tcl command to 
3ca0: 61 73 73 6f 63 69 61 74 65 20 77 69 74 68 20 61  associate with a
3cb0: 74 74 6c 69 73 74 0a 64 65 63 6c 61 72 61 74 69  ttlist.declarati
3cc0: 6f 6e 73 2e 20 54 68 65 20 61 63 74 75 61 6c 20  ons. The actual 
3cd0: 63 6f 6d 6d 61 6e 64 20 63 6f 6e 73 69 73 74 73  command consists
3ce0: 20 6f 66 20 74 68 69 73 20 6f 70 74 69 6f 6e 20   of this option 
3cf0: 66 6f 6c 6c 6f 77 65 64 20 62 79 20 66 69 76 65  followed by five
3d00: 0a 61 72 67 75 6d 65 6e 74 73 2e 20 20 54 68 65  .arguments.  The
3d10: 20 41 74 74 6c 69 73 74 20 64 65 63 6c 61 72 61   Attlist declara
3d20: 74 69 6f 6e 20 68 61 6e 64 6c 65 72 20 69 73 20  tion handler is 
3d30: 63 61 6c 6c 65 64 20 66 6f 72 20 2a 65 61 63 68  called for *each
3d40: 2a 20 61 74 74 72 69 62 75 74 65 2e 20 53 6f 0a  * attribute. So.
3d50: 61 20 73 69 6e 67 6c 65 20 41 74 74 6c 69 73 74  a single Attlist
3d60: 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 77 69 74   declaration wit
3d70: 68 20 6d 75 6c 74 69 70 6c 65 20 61 74 74 72 69  h multiple attri
3d80: 62 75 74 65 73 20 64 65 63 6c 61 72 65 64 20 77  butes declared w
3d90: 69 6c 6c 20 67 65 6e 65 72 61 74 65 0a 6d 75 6c  ill generate.mul
3da0: 74 69 70 6c 65 20 63 61 6c 6c 73 20 74 6f 20 74  tiple calls to t
3db0: 68 69 73 20 68 61 6e 64 6c 65 72 2e 20 54 68 65  his handler. The
3dc0: 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 20 74   arguments are t
3dd0: 68 65 20 65 6c 65 6d 65 6e 74 20 6e 61 6d 65 20  he element name 
3de0: 74 68 69 73 0a 61 74 74 72 69 62 75 74 65 20 62  this.attribute b
3df0: 65 6c 6f 6e 67 73 20 74 6f 2c 20 74 68 65 20 6e  elongs to, the n
3e00: 61 6d 65 20 6f 66 20 74 68 65 20 61 74 74 72 69  ame of the attri
3e10: 62 75 74 65 2c 20 74 68 65 20 74 79 70 65 20 6f  bute, the type o
3e20: 66 20 74 68 65 20 61 74 74 72 69 62 75 74 65 2c  f the attribute,
3e30: 20 74 68 65 0a 64 65 66 61 75 6c 74 20 76 61 6c   the.default val
3e40: 75 65 20 28 6d 61 79 20 62 65 20 74 68 65 20 65  ue (may be the e
3e50: 6d 70 74 79 20 6c 69 73 74 29 20 61 6e 64 20 61  mpty list) and a
3e60: 20 72 65 71 75 69 72 65 64 20 66 6c 61 67 2e 20   required flag. 
3e70: 49 66 20 74 68 69 73 20 66 6c 61 67 20 69 73 20  If this flag is 
3e80: 74 72 75 65 0a 61 6e 64 20 74 68 65 20 64 65 66  true.and the def
3e90: 61 75 6c 74 20 76 61 6c 75 65 20 69 73 20 6e 6f  ault value is no
3ea0: 74 20 74 68 65 20 65 6d 70 74 79 20 6c 69 73 74  t the empty list
3eb0: 2c 20 74 68 65 6e 20 74 68 69 73 20 69 73 20 61  , then this is a
3ec0: 20 22 23 46 49 58 45 44 22 0a 64 65 66 61 75 6c   "#FIXED".defaul
3ed0: 74 2e 3c 2f 70 3e 0a 0a 3c 70 3e 45 78 61 6d 70  t.</p>..<p>Examp
3ee0: 6c 65 3a 3c 2f 70 3e 0a 0a 3c 70 72 65 20 63 6c  le:</p>..<pre cl
3ef0: 61 73 73 3d 22 65 78 61 6d 70 6c 65 22 3e 0a 70  ass="example">.p
3f00: 72 6f 63 20 61 74 74 6c 69 73 74 48 61 6e 64 6c  roc attlistHandl
3f10: 65 72 20 7b 65 6c 6e 61 6d 65 20 6e 61 6d 65 20  er {elname name 
3f20: 74 79 70 65 20 64 65 66 61 75 6c 74 20 69 73 52  type default isR
3f30: 65 71 75 69 72 65 64 7d 20 7b 0a 20 20 20 20 70  equired} {.    p
3f40: 75 74 73 20 22 24 65 6c 6e 61 6d 65 20 24 6e 61  uts "$elname $na
3f50: 6d 65 20 24 74 79 70 65 20 24 64 65 66 61 75 6c  me $type $defaul
3f60: 74 20 24 69 73 52 65 71 75 69 72 65 64 22 0a 7d  t $isRequired".}
3f70: 0a 0a 73 65 74 20 70 61 72 73 65 72 20 5b 65 78  ..set parser [ex
3f80: 70 61 74 20 2d 61 74 74 6c 69 73 74 64 65 63 6c  pat -attlistdecl
3f90: 63 6f 6d 6d 61 6e 64 20 61 74 74 6c 69 73 74 48  command attlistH
3fa0: 61 6e 64 6c 65 72 5d 0a 24 70 61 72 73 65 72 20  andler].$parser 
3fb0: 70 61 72 73 65 20 7b 26 6c 74 3b 3f 78 6d 6c 20  parse {&lt;?xml 
3fc0: 76 65 72 73 69 6f 6e 3d 27 31 2e 30 27 3f 26 67  version='1.0'?&g
3fd0: 74 3b 0a 26 6c 74 3b 21 44 4f 43 54 59 50 45 20  t;.&lt;!DOCTYPE 
3fe0: 74 65 73 74 20 5b 0a 26 6c 74 3b 21 45 4c 45 4d  test [.&lt;!ELEM
3ff0: 45 4e 54 20 74 65 73 74 20 45 4d 50 54 59 26 67  ENT test EMPTY&g
4000: 74 3b 0a 26 6c 74 3b 21 41 54 54 4c 49 53 54 20  t;.&lt;!ATTLIST 
4010: 74 65 73 74 0a 20 20 20 20 20 20 20 20 20 20 69  test.          i
4020: 64 20 20 20 20 20 20 49 44 20 20 20 20 20 20 23  d      ID      #
4030: 52 45 51 55 49 52 45 44 0a 20 20 20 20 20 20 20  REQUIRED.       
4040: 20 20 20 6e 61 6d 65 20 20 20 20 43 44 41 54 41     name    CDATA
4050: 20 20 20 23 49 4d 50 4c 49 45 44 26 67 74 3b 0a     #IMPLIED&gt;.
4060: 5d 26 67 74 3b 0a 26 6c 74 3b 74 65 73 74 2f 26  ]&gt;.&lt;test/&
4070: 67 74 3b 7d 0a 3c 2f 70 72 65 3e 0a 0a 3c 70 3e  gt;}.</pre>..<p>
4080: 54 68 69 73 20 77 6f 75 6c 64 20 72 65 73 75 6c  This would resul
4090: 74 20 69 6e 20 74 68 65 20 66 6f 6c 6c 6f 77 69  t in the followi
40a0: 6e 67 20 63 6f 6d 6d 61 6e 64 73 20 62 65 69 6e  ng commands bein
40b0: 67 20 69 6e 76 6f 6b 65 64 3a 3c 2f 70 3e 0a 0a  g invoked:</p>..
40c0: 3c 70 72 65 20 63 6c 61 73 73 3d 22 65 78 61 6d  <pre class="exam
40d0: 70 6c 65 22 3e 0a 61 74 74 6c 69 73 74 48 61 6e  ple">.attlistHan
40e0: 64 6c 65 72 20 74 65 73 74 20 69 64 20 49 44 20  dler test id ID 
40f0: 7b 7d 20 31 0a 61 74 74 6c 69 73 74 48 61 6e 64  {} 1.attlistHand
4100: 6c 65 72 20 74 65 73 74 20 6e 61 6d 65 20 43 44  ler test name CD
4110: 41 54 41 20 7b 7d 20 30 0a 3c 2f 70 72 65 3e 0a  ATA {} 0.</pre>.
4120: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a  </dd>.        ..
4130: 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20          .       
4140: 20 20 20 3c 64 74 3e 0a 3c 62 3e 20 2d 73 74 61     <dt>.<b> -sta
4150: 72 74 64 6f 63 74 79 70 65 64 65 63 6c 63 6f 6d  rtdoctypedeclcom
4160: 6d 61 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69  mand</b> <i>scri
4170: 70 74 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20  pt</i>.</dt>.   
4180: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
4190: 20 20 20 3c 64 64 3e 3c 70 3e 53 70 65 63 69 66     <dd><p>Specif
41a0: 69 65 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e  ies a Tcl comman
41b0: 64 20 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77  d to associate w
41c0: 69 74 68 20 74 68 65 20 73 74 61 72 74 20 6f 66  ith the start of
41d0: 20 74 68 65 0a 44 4f 43 54 59 50 45 20 64 65 63   the.DOCTYPE dec
41e0: 6c 61 72 61 74 69 6f 6e 2e 20 54 68 69 73 20 63  laration. This c
41f0: 6f 6d 6d 61 6e 64 20 69 73 20 63 61 6c 6c 65 64  ommand is called
4200: 20 62 65 66 6f 72 65 20 61 6e 79 20 44 54 44 20   before any DTD 
4210: 6f 72 20 69 6e 74 65 72 6e 61 6c 20 73 75 62 73  or internal subs
4220: 65 74 0a 69 73 20 70 61 72 73 65 64 2e 20 20 54  et.is parsed.  T
4230: 68 65 20 61 63 74 75 61 6c 20 63 6f 6d 6d 61 6e  he actual comman
4240: 64 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74 68  d consists of th
4250: 69 73 20 6f 70 74 69 6f 6e 20 66 6f 6c 6c 6f 77  is option follow
4260: 65 64 20 62 79 20 66 6f 75 72 0a 61 72 67 75 6d  ed by four.argum
4270: 65 6e 74 73 3a 20 74 68 65 20 64 6f 63 74 79 70  ents: the doctyp
4280: 65 20 6e 61 6d 65 2c 20 74 68 65 20 73 79 73 74  e name, the syst
4290: 65 6d 20 69 64 65 6e 74 69 66 69 65 72 2c 20 74  em identifier, t
42a0: 68 65 20 70 75 62 6c 69 63 20 69 64 65 6e 74 69  he public identi
42b0: 66 69 65 72 20 61 6e 64 20 61 0a 62 6f 6f 6c 65  fier and a.boole
42c0: 61 6e 2c 20 74 68 61 74 20 73 68 6f 77 73 20 69  an, that shows i
42d0: 66 20 74 68 65 20 44 4f 43 54 59 50 45 20 68 61  f the DOCTYPE ha
42e0: 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 73 75  s an internal su
42f0: 62 73 65 74 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20  bset.</p></dd>. 
4300: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
4310: 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e   .          <dt>
4320: 0a 3c 62 3e 20 2d 65 6e 64 64 6f 63 74 79 70 65  .<b> -enddoctype
4330: 64 65 63 6c 63 6f 6d 6d 61 6e 64 3c 2f 62 3e 20  declcommand</b> 
4340: 3c 69 3e 73 63 72 69 70 74 3c 2f 69 3e 0a 3c 2f  <i>script</i>.</
4350: 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a  dt>.          ..
4360: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70            <dd><p
4370: 3e 53 70 65 63 69 66 69 65 73 20 61 20 54 63 6c  >Specifies a Tcl
4380: 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 61 73 73 6f   command to asso
4390: 63 69 61 74 65 20 77 69 74 68 20 74 68 65 20 65  ciate with the e
43a0: 6e 64 20 6f 66 20 74 68 65 0a 44 4f 43 54 59 50  nd of the.DOCTYP
43b0: 45 20 64 65 63 6c 61 72 61 74 69 6f 6e 2e 20 54  E declaration. T
43c0: 68 69 73 20 63 6f 6d 6d 61 6e 64 20 69 73 20 63  his command is c
43d0: 61 6c 6c 65 64 20 61 66 74 65 72 20 70 72 6f 63  alled after proc
43e0: 65 73 73 69 6e 67 20 61 6e 79 20 65 78 74 65 72  essing any exter
43f0: 6e 61 6c 0a 73 75 62 73 65 74 2e 20 20 49 74 20  nal.subset.  It 
4400: 69 73 20 63 61 6c 6c 65 64 20 77 69 74 68 20 6e  is called with n
4410: 6f 20 61 64 64 69 74 69 6f 6e 61 6c 20 61 72 67  o additional arg
4420: 75 6d 65 6e 74 73 2e 3c 2f 70 3e 3c 2f 64 64 3e  uments.</p></dd>
4430: 0a 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20  .        ..     
4440: 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64     .          <d
4450: 74 3e 0a 3c 62 3e 20 2d 70 61 72 61 6d 65 6e 74  t>.<b> -parament
4460: 69 74 79 70 61 72 73 69 6e 67 3c 2f 62 3e 20 3c  ityparsing</b> <
4470: 69 3e 6e 65 76 65 72 7c 6e 6f 74 73 74 61 6e 64  i>never|notstand
4480: 61 6c 6f 6e 65 7c 61 6c 77 61 79 73 3c 2f 69 3e  alone|always</i>
4490: 0a 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 20  .</dt>.         
44a0: 20 0a 0a 20 20 20 20 20 20 20 20 20 20 3c 64 64   ..          <dd
44b0: 3e 3c 70 3e 22 6e 65 76 65 72 22 20 64 69 73 61  ><p>"never" disa
44c0: 62 6c 65 73 20 65 78 70 61 6e 73 69 6f 6e 20 6f  bles expansion o
44d0: 66 20 70 61 72 61 6d 65 74 65 72 20 65 6e 74 69  f parameter enti
44e0: 74 69 65 73 2c 0a 22 61 6c 77 61 79 73 22 20 65  ties,."always" e
44f0: 78 70 61 6e 64 73 20 61 6c 77 61 79 73 20 61 6e  xpands always an
4500: 64 20 22 6e 6f 74 73 74 61 6e 64 61 6c 6f 6e 65  d "notstandalone
4510: 22 20 6f 6e 6c 79 2c 20 69 66 20 74 68 65 0a 64  " only, if the.d
4520: 6f 63 75 6d 65 6e 74 20 69 73 6e 27 74 20 22 73  ocument isn't "s
4530: 74 61 6e 64 61 6c 6f 6e 65 3d 27 6e 6f 27 22 2e  tandalone='no'".
4540: 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 74   The default ist
4550: 20 22 6e 65 76 65 72 22 3c 2f 70 3e 3c 2f 64 64   "never"</p></dd
4560: 3e 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20  >.        .     
4570: 20 20 20 0a 20 20 20 20 20 20 20 20 0a 20 20 20     .        .   
4580: 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 20         <dt>.<b> 
4590: 2d 65 6e 74 69 74 79 64 65 63 6c 63 6f 6d 6d 61  -entitydeclcomma
45a0: 6e 64 3c 2f 62 3e 20 3c 69 3e 73 63 72 69 70 74  nd</b> <i>script
45b0: 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20 20  </i>.</dt>.     
45c0: 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20       ..         
45d0: 20 3c 64 64 3e 3c 70 3e 53 70 65 63 69 66 69 65   <dd><p>Specifie
45e0: 73 20 61 20 54 63 6c 20 63 6f 6d 6d 61 6e 64 20  s a Tcl command 
45f0: 74 6f 20 61 73 73 6f 63 69 61 74 65 20 77 69 74  to associate wit
4600: 68 20 61 6e 79 20 65 6e 74 69 74 79 0a 64 65 63  h any entity.dec
4610: 6c 61 72 61 74 69 6f 6e 2e 20 54 68 65 20 61 63  laration. The ac
4620: 74 75 61 6c 20 63 6f 6d 6d 61 6e 64 20 63 6f 6e  tual command con
4630: 73 69 73 74 73 20 6f 66 20 74 68 69 73 20 6f 70  sists of this op
4640: 74 69 6f 6e 20 66 6f 6c 6c 6f 77 65 64 20 62 79  tion followed by
4650: 20 73 65 76 65 6e 0a 61 72 67 75 6d 65 6e 74 73   seven.arguments
4660: 3a 20 74 68 65 20 65 6e 74 69 74 79 20 6e 61 6d  : the entity nam
4670: 65 2c 20 61 20 62 6f 6f 6c 65 61 6e 20 69 64 65  e, a boolean ide
4680: 6e 74 69 66 79 69 6e 67 20 70 61 72 61 6d 65 74  ntifying paramet
4690: 65 72 20 65 6e 74 69 74 69 65 73 2c 20 74 68 65  er entities, the
46a0: 20 76 61 6c 75 65 0a 6f 66 20 74 68 65 20 65 6e   value.of the en
46b0: 74 69 74 79 2c 20 74 68 65 20 62 61 73 65 20 75  tity, the base u
46c0: 72 69 2c 20 74 68 65 20 73 79 73 74 65 6d 20 69  ri, the system i
46d0: 64 65 6e 74 69 66 69 65 72 2c 20 74 68 65 20 70  dentifier, the p
46e0: 75 62 6c 69 63 20 69 64 65 6e 74 69 66 69 65 72  ublic identifier
46f0: 20 61 6e 64 0a 74 68 65 20 6e 6f 74 61 74 69 6f   and.the notatio
4700: 6e 20 6e 61 6d 65 2e 20 41 63 63 6f 72 64 69 6e  n name. Accordin
4710: 67 20 74 6f 20 74 68 65 20 74 79 70 65 20 6f 66  g to the type of
4720: 20 65 6e 74 69 74 79 20 64 65 63 6c 61 72 61 74   entity declarat
4730: 69 6f 6e 20 73 6f 6d 65 20 6f 66 20 74 68 69 73  ion some of this
4740: 0a 61 72 67 75 6d 65 6e 74 73 20 6d 61 79 20 62  .arguments may b
4750: 65 20 74 68 65 20 65 6d 70 74 79 20 6c 69 73 74  e the empty list
4760: 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20  .</p></dd>.     
4770: 20 20 20 0a 0a 0a 20 20 20 20 20 20 20 20 0a 20     ...        . 
4780: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62           <dt>.<b
4790: 3e 20 2d 69 67 6e 6f 72 65 77 68 69 74 65 63 64  > -ignorewhitecd
47a0: 61 74 61 3c 2f 62 3e 20 3c 69 3e 62 6f 6f 6c 65  ata</b> <i>boole
47b0: 61 6e 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20  an</i>.</dt>.   
47c0: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
47d0: 20 20 20 3c 64 64 3e 3c 70 3e 49 66 20 74 68 69     <dd><p>If thi
47e0: 73 20 66 6c 61 67 20 69 73 20 73 65 74 2c 20 65  s flag is set, e
47f0: 6c 65 6d 65 6e 74 20 63 6f 6e 74 65 6e 74 20 77  lement content w
4800: 68 69 63 68 20 63 6f 6e 74 61 69 6e 20 6f 6e 6c  hich contain onl
4810: 79 0a 77 68 69 74 65 73 70 61 63 65 73 20 69 73  y.whitespaces is
4820: 6e 27 74 20 72 65 70 6f 72 74 65 64 20 77 69 74  n't reported wit
4830: 68 20 74 68 65 0a 3c 74 74 20 63 6c 61 73 73 3d  h the.<tt class=
4840: 22 73 61 6d 70 22 3e 2d 63 68 61 72 61 63 74 65  "samp">-characte
4850: 72 64 61 74 61 63 6f 6d 6d 61 6e 64 3c 2f 74 74  rdatacommand</tt
4860: 3e 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20  >.</p></dd>.    
4870: 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20      ..        . 
4880: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62           <dt>.<b
4890: 3e 20 2d 69 67 6e 6f 72 65 77 68 69 74 65 73 70  > -ignorewhitesp
48a0: 61 63 65 3c 2f 62 3e 20 3c 69 3e 62 6f 6f 6c 65  ace</b> <i>boole
48b0: 61 6e 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20  an</i>.</dt>.   
48c0: 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20         ..       
48d0: 20 20 20 3c 64 64 3e 41 6e 6f 74 68 65 72 20 6e     <dd>Another n
48e0: 61 6d 65 20 66 6f 72 20 3c 69 20 63 6c 61 73 73  ame for <i class
48f0: 3d 22 6d 22 3e 20 2d 69 67 6e 6f 72 65 77 68 69  ="m"> -ignorewhi
4900: 74 65 63 64 61 74 61 3c 2f 69 3e 3b 20 73 65 65  tecdata</i>; see
4910: 20 74 68 65 72 65 2e 0a 20 20 20 20 20 20 20 20   there..        
4920: 20 20 20 20 3c 2f 64 64 3e 0a 20 20 20 20 20 20      </dd>.      
4930: 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20    ..        .   
4940: 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 3e 20         <dt>.<b> 
4950: 2d 68 61 6e 64 6c 65 72 73 65 74 3c 2f 62 3e 20  -handlerset</b> 
4960: 3c 69 3e 6e 61 6d 65 3c 2f 69 3e 0a 3c 2f 64 74  <i>name</i>.</dt
4970: 3e 0a 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20  >.          ..  
4980: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 54          <dd><p>T
4990: 68 69 73 20 6f 70 74 69 6f 6e 20 73 65 74 73 20  his option sets 
49a0: 74 68 65 20 54 63 6c 20 68 61 6e 64 6c 65 72 20  the Tcl handler 
49b0: 73 65 74 20 73 63 6f 70 65 20 66 6f 72 20 74 68  set scope for th
49c0: 65 0a 63 6f 6e 66 69 67 75 72 65 20 6f 70 74 69  e.configure opti
49d0: 6f 6e 73 2e 20 41 6e 79 20 6f 70 74 69 6f 6e 20  ons. Any option 
49e0: 76 61 6c 75 65 20 70 61 69 72 20 66 6f 6c 6c 6f  value pair follo
49f0: 77 69 6e 67 20 74 68 69 73 20 6f 70 74 69 6f 6e  wing this option
4a00: 20 69 6e 20 74 68 65 0a 73 61 6d 65 20 63 61 6c   in the.same cal
4a10: 6c 20 74 6f 20 74 68 65 20 70 61 72 73 65 72 20  l to the parser 
4a20: 61 72 65 20 6d 6f 64 69 66 79 69 6e 67 20 74 68  are modifying th
4a30: 65 20 6e 61 6d 65 64 20 54 63 6c 20 68 61 6e 64  e named Tcl hand
4a40: 6c 65 72 20 73 65 74 2e 20 49 66 0a 79 6f 75 20  ler set. If.you 
4a50: 64 6f 6e 27 74 20 75 73 65 20 74 68 69 73 20 6f  don't use this o
4a60: 70 74 69 6f 6e 2c 20 79 6f 75 20 61 72 65 20 6d  ption, you are m
4a70: 6f 64 69 66 79 69 6e 67 20 74 68 65 20 64 65 66  odifying the def
4a80: 61 75 6c 74 20 54 63 6c 20 68 61 6e 64 6c 65 72  ault Tcl handler
4a90: 0a 73 65 74 2c 20 6e 61 6d 65 64 20 22 64 65 66  .set, named "def
4aa0: 61 75 6c 74 22 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a  ault".</p></dd>.
4ab0: 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20          ..      
4ac0: 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74    .          <dt
4ad0: 3e 0a 3c 62 3e 20 2d 6e 6f 65 78 70 61 6e 64 3c  >.<b> -noexpand<
4ae0: 2f 62 3e 20 3c 69 3e 62 6f 6f 6c 65 61 6e 3c 2f  /b> <i>boolean</
4af0: 69 3e 0a 3c 2f 64 74 3e 0a 20 20 20 20 20 20 20  i>.</dt>.       
4b00: 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20 20 3c     ..          <
4b10: 64 64 3e 0a 3c 70 3e 4e 6f 72 6d 61 6c 6c 79 2c  dd>.<p>Normally,
4b20: 20 74 68 65 20 70 61 72 73 65 72 20 77 69 6c 6c   the parser will
4b30: 20 74 72 79 20 74 6f 20 65 78 70 61 6e 64 20 72   try to expand r
4b40: 65 66 65 72 65 6e 63 65 73 20 74 6f 0a 65 6e 74  eferences to.ent
4b50: 69 74 69 65 73 20 64 65 66 69 6e 65 64 20 69 6e  ities defined in
4b60: 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 73 75   the internal su
4b70: 62 73 65 74 2e 20 49 66 20 74 68 69 73 20 6f 70  bset. If this op
4b80: 74 69 6f 6e 20 69 73 20 73 65 74 20 74 6f 20 61  tion is set to a
4b90: 20 74 72 75 65 20 76 61 6c 75 65 0a 74 68 69 73   true value.this
4ba0: 20 65 6e 74 69 74 69 65 73 20 61 72 65 20 6e 6f   entities are no
4bb0: 74 20 65 78 70 61 6e 64 65 64 2c 20 62 75 74 20  t expanded, but 
4bc0: 72 65 70 6f 72 74 65 64 20 6c 69 74 65 72 61 6c  reported literal
4bd0: 20 76 69 61 20 74 68 65 20 64 65 66 61 75 6c 74   via the default
4be0: 0a 68 61 6e 64 6c 65 72 2e 20 3c 62 3e 57 61 72  .handler. <b>War
4bf0: 6e 69 6e 67 3a 3c 2f 62 3e 20 49 66 20 79 6f 75  ning:</b> If you
4c00: 20 73 65 74 20 74 68 69 73 20 6f 70 74 69 6f 6e   set this option
4c10: 20 74 6f 20 74 72 75 65 20 61 6e 64 20 64 6f 65   to true and doe
4c20: 73 6e 27 74 20 69 6e 73 74 61 6c 6c 20 61 0a 64  sn't install a.d
4c30: 65 66 61 75 6c 74 20 68 61 6e 64 6c 65 72 20 28  efault handler (
4c40: 77 69 74 68 20 74 68 65 20 2d 64 65 66 61 75 6c  with the -defaul
4c50: 74 63 6f 6d 6d 61 6e 64 20 6f 70 74 69 6f 6e 29  tcommand option)
4c60: 20 66 6f 72 20 65 76 65 72 79 20 68 61 6e 64 6c   for every handl
4c70: 65 72 20 73 65 74 20 6f 66 20 74 68 65 0a 70 61  er set of the.pa
4c80: 72 73 65 72 20 61 6c 6c 20 69 6e 74 65 72 6e 61  rser all interna
4c90: 6c 20 65 6e 74 69 74 69 65 73 20 61 72 65 20 73  l entities are s
4ca0: 69 6c 65 6e 74 20 6c 6f 73 74 20 66 6f 72 20 74  ilent lost for t
4cb0: 68 65 20 68 61 6e 64 6c 65 72 20 73 65 74 73 20  he handler sets 
4cc0: 77 69 74 68 6f 75 74 20 61 0a 64 65 66 61 75 6c  without a.defaul
4cd0: 74 20 68 61 6e 64 6c 65 72 2e 3c 2f 70 3e 0a 20  t handler.</p>. 
4ce0: 20 20 20 20 20 20 20 20 20 20 20 3c 2f 64 64 3e             </dd>
4cf0: 0a 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20  .        ..     
4d00: 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64     .          <d
4d10: 74 3e 0a 3c 62 3e 2d 75 73 65 46 6f 72 65 69 67  t>.<b>-useForeig
4d20: 6e 44 54 44 3c 2f 62 3e 20 3c 69 3e 26 6c 74 3b  nDTD</b> <i>&lt;
4d30: 62 6f 6f 6c 65 6e 26 67 74 3b 3c 2f 69 3e 0a 3c  boolen&gt;</i>.<
4d40: 2f 64 74 3e 0a 20 20 20 20 20 20 20 20 20 20 0a  /dt>.          .
4d50: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 49 66            <dd>If
4d60: 20 26 6c 74 3b 62 6f 6f 6c 65 6e 26 67 74 3b 20   &lt;boolen&gt; 
4d70: 69 73 20 74 72 75 65 20 61 6e 64 20 74 68 65 20  is true and the 
4d80: 64 6f 63 75 6d 65 6e 74 20 64 6f 65 73 20 6e 6f  document does no
4d90: 74 20 68 61 76 65 20 61 6e 0a 65 78 74 65 72 6e  t have an.extern
4da0: 61 6c 20 73 75 62 73 65 74 2c 20 74 68 65 20 70  al subset, the p
4db0: 61 72 73 65 72 20 77 69 6c 6c 20 63 61 6c 6c 20  arser will call 
4dc0: 74 68 65 20 2d 65 78 74 65 72 6e 61 6c 65 6e 74  the -externalent
4dd0: 69 74 79 63 6f 6d 6d 61 6e 64 20 73 63 72 69 70  itycommand scrip
4de0: 74 20 77 69 74 68 0a 65 6d 70 74 79 20 76 61 6c  t with.empty val
4df0: 75 65 73 20 66 6f 72 20 74 68 65 20 73 79 73 74  ues for the syst
4e00: 65 6d 49 64 20 61 6e 64 20 70 75 62 6c 69 63 49  emId and publicI
4e10: 44 20 61 72 67 75 6d 65 6e 74 73 2e 20 54 68 69  D arguments. Thi
4e20: 73 20 6f 70 74 69 6f 6e 20 6d 75 73 74 20 62 65  s option must be
4e30: 20 73 65 74 2c 0a 62 65 66 6f 72 65 20 74 68 65   set,.before the
4e40: 20 66 69 72 73 74 20 70 69 65 63 65 20 6f 66 20   first piece of 
4e50: 64 61 74 61 20 69 73 20 70 61 72 73 65 64 2e 20  data is parsed. 
4e60: 53 65 74 74 69 6e 67 20 74 68 69 73 20 6f 70 74  Setting this opt
4e70: 69 6f 6e 2c 20 61 66 74 65 72 20 74 68 65 0a 70  ion, after the.p
4e80: 61 72 73 69 6e 67 20 68 61 73 20 73 74 61 72 74  arsing has start
4e90: 65 64 20 68 61 73 20 6e 6f 20 65 66 66 65 63 74  ed has no effect
4ea0: 2e 20 54 68 65 20 64 65 66 61 75 6c 74 20 69 73  . The default is
4eb0: 20 6e 6f 74 20 74 6f 20 75 73 65 20 61 20 66 6f   not to use a fo
4ec0: 72 65 69 67 6e 20 44 54 44 2e 20 54 68 65 0a 64  reign DTD. The.d
4ed0: 65 66 61 75 6c 74 20 69 73 20 72 65 73 74 6f 72  efault is restor
4ee0: 65 64 2c 20 61 66 74 65 72 20 72 65 73 65 74 74  ed, after resett
4ef0: 69 6e 67 20 74 68 65 20 70 61 72 73 65 72 2e 20  ing the parser. 
4f00: 50 6c 65 61 63 65 20 6e 6f 74 69 63 65 2c 20 74  Pleace notice, t
4f10: 68 61 74 20 61 0a 2d 70 61 72 61 6d 65 6e 74 69  hat a.-paramenti
4f20: 74 79 70 61 72 73 69 6e 67 20 76 61 6c 75 65 20  typarsing value 
4f30: 6f 66 20 22 6e 65 76 65 72 22 20 28 77 68 69 63  of "never" (whic
4f40: 68 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74  h is the default
4f50: 29 20 73 75 70 70 72 65 73 73 65 73 20 61 6e 79  ) suppresses any
4f60: 20 63 61 6c 6c 0a 74 6f 20 74 68 65 20 2d 65 78   call.to the -ex
4f70: 74 65 72 6e 61 6c 65 6e 74 69 74 79 63 6f 6d 6d  ternalentitycomm
4f80: 61 6e 64 20 73 63 72 69 70 74 2e 20 50 6c 65 61  and script. Plea
4f90: 63 65 20 6e 6f 74 69 63 65 2c 20 74 68 61 74 2c  ce notice, that,
4fa0: 20 69 66 20 74 68 65 20 64 6f 63 75 6d 65 6e 74   if the document
4fb0: 20 61 6c 73 6f 0a 64 6f 65 73 6e 27 74 20 68 61   also.doesn't ha
4fc0: 76 65 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 73  ve an internal s
4fd0: 75 62 73 65 74 2c 20 74 68 65 20 2d 73 74 61 72  ubset, the -star
4fe0: 74 64 6f 63 74 79 70 65 64 65 63 6c 63 6f 6d 6d  tdoctypedeclcomm
4ff0: 61 6e 64 20 61 6e 64 0a 65 6e 64 64 6f 63 74 79  and and.enddocty
5000: 70 65 64 65 63 6c 63 6f 6d 6d 61 6e 64 20 73 63  pedeclcommand sc
5010: 72 69 70 74 73 2c 20 69 66 20 73 65 74 2c 20 61  ripts, if set, a
5020: 72 65 20 6e 6f 74 20 63 61 6c 6c 65 64 2e 3c 2f  re not called.</
5030: 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a 20 20  dd>.        ..  
5040: 20 20 20 20 3c 2f 64 6c 3e 0a 20 20 20 20 3c 68      </dl>.    <h
5050: 32 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 43 54 69  2><a name="SECTi
5060: 64 30 78 31 37 34 36 62 38 30 22 3e 20 43 4f 4d  d0x1746b80"> COM
5070: 4d 41 4e 44 20 4d 45 54 48 4f 44 53 20 3c 2f 61  MAND METHODS </a
5080: 3e 3c 2f 68 32 3e 3c 64 6c 20 63 6c 61 73 73 3d  ></h2><dl class=
5090: 22 63 6f 6d 6d 61 6e 64 6c 69 73 74 22 3e 0a 20  "commandlist">. 
50a0: 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20         .        
50b0: 20 20 3c 64 74 3e 0a 3c 62 20 63 6c 61 73 73 3d    <dt>.<b class=
50c0: 22 63 6d 64 22 3e 70 61 72 73 65 72 3c 2f 62 3e  "cmd">parser</b>
50d0: 20 3c 62 20 63 6c 61 73 73 3d 22 6d 65 74 68 6f   <b class="metho
50e0: 64 22 3e 63 6f 6e 66 69 67 75 72 65 3c 2f 62 3e  d">configure</b>
50f0: 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 6f 70   <i class="m">op
5100: 74 69 6f 6e 20 76 61 6c 75 65 20 3f 6f 70 74 69  tion value ?opti
5110: 6f 6e 20 76 61 6c 75 65 3f 3c 2f 69 3e 0a 3c 2f  on value?</i>.</
5120: 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 3c  dt>..          <
5130: 64 64 3e 3c 70 3e 53 65 74 73 20 63 6f 6e 66 69  dd><p>Sets confi
5140: 67 75 72 61 74 69 6f 6e 20 6f 70 74 69 6f 6e 73  guration options
5150: 20 66 6f 72 20 74 68 65 20 70 61 72 73 65 72 2e   for the parser.
5160: 20 45 76 65 72 79 20 63 6f 6d 6d 61 6e 64 0a 6f   Every command.o
5170: 70 74 69 6f 6e 2c 20 65 78 63 65 70 74 20 3c 69  ption, except <i
5180: 20 63 6c 61 73 73 3d 22 6d 22 3e 2d 6e 61 6d 65   class="m">-name
5190: 73 70 61 63 65 3c 2f 69 3e 20 63 61 6e 20 62 65  space</i> can be
51a0: 20 73 65 74 20 6f 72 20 6d 6f 64 69 66 69 65 64   set or modified
51b0: 20 77 69 74 68 20 74 68 69 73 20 6d 65 74 68 6f   with this metho
51c0: 64 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20  d.</p></dd>.    
51d0: 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20      ..        . 
51e0: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62           <dt>.<b
51f0: 20 63 6c 61 73 73 3d 22 63 6d 64 22 3e 70 61 72   class="cmd">par
5200: 73 65 72 3c 2f 62 3e 20 3c 62 20 63 6c 61 73 73  ser</b> <b class
5210: 3d 22 6d 65 74 68 6f 64 22 3e 63 67 65 74 3c 2f  ="method">cget</
5220: 62 3e 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e  b> <i class="m">
5230: 3f 2d 68 61 6e 64 6c 65 72 73 65 74 20 6e 61 6d  ?-handlerset nam
5240: 65 3f 20 6f 70 74 69 6f 6e 3c 2f 69 3e 0a 3c 2f  e? option</i>.</
5250: 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 3c  dt>..          <
5260: 64 64 3e 0a 3c 70 3e 52 65 74 75 72 6e 20 74 68  dd>.<p>Return th
5270: 65 20 63 75 72 72 65 6e 74 20 63 6f 6e 66 69 67  e current config
5280: 75 72 61 74 69 6f 6e 20 76 61 6c 75 65 20 6f 70  uration value op
5290: 74 69 6f 6e 20 66 6f 72 20 74 68 65 0a 70 61 72  tion for the.par
52a0: 73 65 72 2e 3c 2f 70 3e 20 0a 20 20 20 20 20 20  ser.</p> .      
52b0: 20 20 20 20 3c 70 3e 49 66 20 74 68 65 20 2d 68      <p>If the -h
52c0: 61 6e 64 6c 65 72 73 65 74 20 6f 70 74 69 6f 6e  andlerset option
52d0: 20 69 73 20 75 73 65 64 2c 20 74 68 65 20 63 6f   is used, the co
52e0: 6e 66 69 67 75 72 61 74 69 6f 6e 20 66 6f 72 20  nfiguration for 
52f0: 74 68 65 0a 6e 61 6d 65 64 20 68 61 6e 64 6c 65  the.named handle
5300: 72 20 73 65 74 20 69 73 20 72 65 74 75 72 6e 65  r set is returne
5310: 64 2e 3c 2f 70 3e 0a 20 20 20 20 20 20 20 20 20  d.</p>.         
5320: 20 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 0a   </dd>.        .
5330: 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20  .        .      
5340: 20 20 20 20 3c 64 74 3e 0a 3c 62 20 63 6c 61 73      <dt>.<b clas
5350: 73 3d 22 63 6d 64 22 3e 70 61 72 73 65 72 3c 2f  s="cmd">parser</
5360: 62 3e 20 3c 62 20 63 6c 61 73 73 3d 22 6d 65 74  b> <b class="met
5370: 68 6f 64 22 3e 63 75 72 72 65 6e 74 6d 61 72 6b  hod">currentmark
5380: 75 70 3c 2f 62 3e 0a 3c 2f 64 74 3e 0a 0a 20 20  up</b>.</dt>..  
5390: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 52          <dd><p>R
53a0: 65 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65  eturns the curre
53b0: 6e 74 20 6d 61 72 6b 75 70 20 61 73 20 66 6f 75  nt markup as fou
53c0: 6e 64 20 69 6e 20 74 68 65 20 58 4d 4c 2c 20 69  nd in the XML, i
53d0: 66 0a 20 20 20 20 20 20 20 20 20 20 63 61 6c 6c  f.          call
53e0: 65 64 20 66 72 6f 6d 20 77 69 74 68 69 6e 20 6f  ed from within o
53f0: 6e 65 20 6f 66 20 69 74 73 20 6d 61 72 6b 75 70  ne of its markup
5400: 20 65 76 65 6e 74 20 68 61 6e 64 6c 65 72 20 73   event handler s
5410: 63 72 69 70 74 0a 20 20 20 20 20 20 20 20 20 20  cript.          
5420: 28 2d 65 6c 65 6d 65 6e 74 73 74 61 72 74 63 6f  (-elementstartco
5430: 6d 6d 61 6e 64 2c 20 2d 65 6c 65 6d 65 6e 74 65  mmand, -elemente
5440: 6e 64 63 6f 6d 6d 61 6e 64 2c 20 2d 63 6f 6d 6d  ndcommand, -comm
5450: 65 6e 74 63 6f 6d 6d 61 6e 64 0a 20 20 20 20 20  entcommand.     
5460: 20 20 20 20 20 61 6e 64 20 2d 70 72 6f 63 65 73       and -proces
5470: 73 69 6e 67 69 6e 73 74 72 75 63 74 69 6f 6e 63  singinstructionc
5480: 6f 6d 6d 61 6e 64 29 2e 20 4f 74 68 65 72 77 69  ommand). Otherwi
5490: 73 65 20 69 74 20 72 65 74 75 72 6e 20 74 68 65  se it return the
54a0: 0a 20 20 20 20 20 20 20 20 20 20 65 6d 70 74 79  .          empty
54b0: 20 73 74 72 69 6e 67 2e 3c 2f 70 3e 3c 2f 64 64   string.</p></dd
54c0: 3e 0a 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20  >.        ..    
54d0: 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c      .          <
54e0: 64 74 3e 0a 3c 62 20 63 6c 61 73 73 3d 22 63 6d  dt>.<b class="cm
54f0: 64 22 3e 70 61 72 73 65 72 3c 2f 62 3e 20 3c 62  d">parser</b> <b
5500: 20 63 6c 61 73 73 3d 22 6d 65 74 68 6f 64 22 3e   class="method">
5510: 64 65 6c 65 74 65 3c 2f 62 3e 0a 3c 2f 64 74 3e  delete</b>.</dt>
5520: 0a 0a 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e  ..          <dd>
5530: 3c 70 3e 44 65 6c 65 74 65 73 20 74 68 65 20 70  <p>Deletes the p
5540: 61 72 73 65 72 20 61 6e 64 20 74 68 65 20 70 61  arser and the pa
5550: 72 73 65 72 20 63 6f 6d 6d 61 6e 64 2e 20 41 20  rser command. A 
5560: 70 61 72 73 65 72 20 63 61 6e 6e 6f 74 0a 62 65  parser cannot.be
5570: 20 64 65 6c 65 74 65 64 20 66 72 6f 6d 20 77 69   deleted from wi
5580: 74 68 69 6e 20 6f 6e 65 20 6f 66 20 69 74 73 20  thin one of its 
5590: 68 61 6e 64 6c 65 72 20 63 61 6c 6c 62 61 63 6b  handler callback
55a0: 73 20 28 6e 65 69 74 68 65 72 20 64 69 72 65 63  s (neither direc
55b0: 74 6c 79 20 6e 6f 72 0a 69 6e 64 69 72 65 63 74  tly nor.indirect
55c0: 6c 79 29 20 61 6e 64 20 77 69 6c 6c 20 72 61 69  ly) and will rai
55d0: 73 65 20 61 20 74 63 6c 20 65 72 72 6f 72 20 69  se a tcl error i
55e0: 6e 20 74 68 69 73 20 63 61 73 65 2e 3c 2f 70 3e  n this case.</p>
55f0: 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 0a 0a  </dd>.        ..
5600: 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20          .       
5610: 20 20 20 3c 64 74 3e 0a 3c 62 20 63 6c 61 73 73     <dt>.<b class
5620: 3d 22 63 6d 64 22 3e 70 61 72 73 65 72 3c 2f 62  ="cmd">parser</b
5630: 3e 20 3c 62 20 63 6c 61 73 73 3d 22 6d 65 74 68  > <b class="meth
5640: 6f 64 22 3e 66 72 65 65 3c 2f 62 3e 0a 3c 2f 64  od">free</b>.</d
5650: 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 3c 64  t>..          <d
5660: 64 3e 3c 70 3e 41 6e 6f 74 68 65 72 20 6e 61 6d  d><p>Another nam
5670: 65 20 74 6f 20 63 61 6c 6c 20 74 68 65 20 6d 65  e to call the me
5680: 74 68 6f 64 20 3c 69 20 63 6c 61 73 73 3d 22 6d  thod <i class="m
5690: 22 3e 64 65 6c 65 74 65 3c 2f 69 3e 2c 20 73 65  ">delete</i>, se
56a0: 65 0a 20 20 20 20 20 20 20 20 20 20 74 68 65 72  e.          ther
56b0: 65 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20  e.</p></dd>.    
56c0: 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20      ..        . 
56d0: 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62           <dt>.<b
56e0: 20 63 6c 61 73 73 3d 22 63 6d 64 22 3e 70 61 72   class="cmd">par
56f0: 73 65 72 3c 2f 62 3e 20 3c 62 20 63 6c 61 73 73  ser</b> <b class
5700: 3d 22 6d 65 74 68 6f 64 22 3e 67 65 74 3c 2f 62  ="method">get</b
5710: 3e 20 3c 69 20 63 6c 61 73 73 3d 22 6d 22 3e 2d  > <i class="m">-
5720: 73 70 65 63 69 66 69 65 64 61 74 74 72 69 62 75  specifiedattribu
5730: 74 65 63 6f 75 6e 74 7c 2d 69 64 61 74 74 72 69  tecount|-idattri
5740: 62 75 74 65 69 6e 64 65 78 7c 2d 63 75 72 72 65  buteindex|-curre
5750: 6e 74 62 79 74 65 63 6f 75 6e 74 7c 2d 63 75 72  ntbytecount|-cur
5760: 72 65 6e 74 6c 69 6e 65 6e 75 6d 62 65 72 7c 2d  rentlinenumber|-
5770: 63 75 72 72 65 6e 74 63 6f 6c 75 6d 6e 6e 75 6d  currentcolumnnum
5780: 62 65 72 7c 2d 63 75 72 72 65 6e 74 62 79 74 65  ber|-currentbyte
5790: 69 6e 64 65 78 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a  index</i>.</dt>.
57a0: 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 0a 3c            <dd>.<
57b0: 64 6c 20 63 6c 61 73 73 3d 22 6f 70 74 6c 69 73  dl class="optlis
57c0: 74 22 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  t">.            
57d0: 20 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20    .             
57e0: 20 20 20 3c 64 74 3e 3c 62 3e 2d 73 70 65 63 69     <dt><b>-speci
57f0: 66 69 65 64 61 74 74 72 69 62 75 74 65 63 6f 75  fiedattributecou
5800: 6e 74 3c 2f 62 3e 3c 2f 64 74 3e 0a 0a 20 20 20  nt</b></dt>..   
5810: 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 64               <dd
5820: 3e 3c 70 3e 20 52 65 74 75 72 6e 73 20 74 68 65  ><p> Returns the
5830: 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 61   number of the a
5840: 74 74 72 69 62 75 74 65 2f 76 61 6c 75 65 20 70  ttribute/value p
5850: 61 69 72 73 0a 70 61 73 73 65 64 20 69 6e 20 6c  airs.passed in l
5860: 61 73 74 20 63 61 6c 6c 20 74 6f 20 74 68 65 20  ast call to the 
5870: 65 6c 65 6d 65 6e 74 73 74 61 72 74 63 6f 6d 6d  elementstartcomm
5880: 61 6e 64 20 74 68 61 74 20 77 65 72 65 20 73 70  and that were sp
5890: 65 63 69 66 69 65 64 20 69 6e 20 74 68 65 0a 73  ecified in the.s
58a0: 74 61 72 74 2d 74 61 67 20 72 61 74 68 65 72 20  tart-tag rather 
58b0: 74 68 61 6e 20 64 65 66 61 75 6c 74 65 64 2e 20  than defaulted. 
58c0: 45 61 63 68 20 61 74 74 72 69 62 75 74 65 2f 76  Each attribute/v
58d0: 61 6c 75 65 20 70 61 69 72 20 63 6f 75 6e 74 73  alue pair counts
58e0: 20 61 73 20 32 3b 20 74 68 75 73 0a 74 68 69 73   as 2; thus.this
58f0: 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20   corresponds to 
5900: 61 6e 20 69 6e 64 65 78 20 69 6e 74 6f 20 74 68  an index into th
5910: 65 20 61 74 74 72 69 62 75 74 65 20 6c 69 73 74  e attribute list
5920: 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 0a 65   passed to the.e
5930: 6c 65 6d 65 6e 74 73 74 61 72 74 63 6f 6d 6d 61  lementstartcomma
5940: 6e 64 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20  nd.</p></dd>.   
5950: 20 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20             ..   
5960: 20 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20             .    
5970: 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e              <dt>
5980: 3c 62 3e 2d 69 64 61 74 74 72 69 62 75 74 65 69  <b>-idattributei
5990: 6e 64 65 78 3c 2f 62 3e 3c 2f 64 74 3e 0a 20 20  ndex</b></dt>.  
59a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 20                . 
59b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c                 <
59c0: 64 64 3e 3c 70 3e 52 65 74 75 72 6e 73 20 74 68  dd><p>Returns th
59d0: 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 49  e index of the I
59e0: 44 20 61 74 74 72 69 62 75 74 65 20 70 61 73 73  D attribute pass
59f0: 65 64 20 69 6e 20 74 68 65 0a 6c 61 73 74 20 63  ed in the.last c
5a00: 61 6c 6c 20 74 6f 20 58 4d 4c 5f 53 74 61 72 74  all to XML_Start
5a10: 45 6c 65 6d 65 6e 74 48 61 6e 64 6c 65 72 2c 20  ElementHandler, 
5a20: 6f 72 20 2d 31 20 69 66 20 74 68 65 72 65 20 69  or -1 if there i
5a30: 73 20 6e 6f 20 49 44 20 61 74 74 72 69 62 75 74  s no ID attribut
5a40: 65 2e 20 20 45 61 63 68 0a 61 74 74 72 69 62 75  e.  Each.attribu
5a50: 74 65 2f 76 61 6c 75 65 20 70 61 69 72 20 63 6f  te/value pair co
5a60: 75 6e 74 73 20 61 73 20 32 3b 20 74 68 75 73 20  unts as 2; thus 
5a70: 74 68 69 73 20 63 6f 72 72 65 73 70 6f 6e 64 73  this corresponds
5a80: 20 74 6f 20 61 6e 20 69 6e 64 65 78 20 69 6e 74   to an index int
5a90: 6f 20 74 68 65 0a 61 74 74 72 69 62 75 74 65 73  o the.attributes
5aa0: 20 6c 69 73 74 20 70 61 73 73 65 64 20 74 6f 20   list passed to 
5ab0: 74 68 65 20 65 6c 65 6d 65 6e 74 73 74 61 72 74  the elementstart
5ac0: 63 6f 6d 6d 61 6e 64 2e 3c 2f 70 3e 3c 2f 64 64  command.</p></dd
5ad0: 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  >.              
5ae0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a  .              .
5af0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 20                . 
5b00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c                 <
5b10: 64 74 3e 3c 62 3e 2d 63 75 72 72 65 6e 74 62 79  dt><b>-currentby
5b20: 74 65 63 6f 75 6e 74 3c 2f 62 3e 3c 2f 64 74 3e  tecount</b></dt>
5b30: 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ..              
5b40: 20 20 3c 64 64 3e 3c 70 3e 52 65 74 75 72 6e 20    <dd><p>Return 
5b50: 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 79  the number of by
5b60: 74 65 73 20 69 6e 20 74 68 65 20 63 75 72 72 65  tes in the curre
5b70: 6e 74 20 65 76 65 6e 74 2e 0a 52 65 74 75 72 6e  nt event..Return
5b80: 73 20 30 20 69 66 20 74 68 65 20 65 76 65 6e 74  s 0 if the event
5b90: 20 69 73 20 69 6e 20 61 6e 20 69 6e 74 65 72 6e   is in an intern
5ba0: 61 6c 20 65 6e 74 69 74 79 2e 3c 2f 70 3e 3c 2f  al entity.</p></
5bb0: 64 64 3e 0a 20 20 20 20 20 20 20 20 20 20 20 20  dd>.            
5bc0: 20 20 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20    ..            
5bd0: 20 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20    .             
5be0: 20 20 20 3c 64 74 3e 3c 62 3e 2d 63 75 72 72 65     <dt><b>-curre
5bf0: 6e 74 6c 69 6e 65 6e 75 6d 62 65 72 3c 2f 62 3e  ntlinenumber</b>
5c00: 3c 2f 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20  </dt>..         
5c10: 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 20 52         <dd><p> R
5c20: 65 74 75 72 6e 73 20 74 68 65 20 6c 69 6e 65 20  eturns the line 
5c30: 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63 75  number of the cu
5c40: 72 72 65 6e 74 20 70 61 72 73 65 0a 6c 6f 63 61  rrent parse.loca
5c50: 74 69 6f 6e 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20  tion.</p></dd>. 
5c60: 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 0a 20               .. 
5c70: 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 20 20               .  
5c80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 64                <d
5c90: 74 3e 3c 62 3e 2d 63 75 72 72 65 6e 74 63 6f 6c  t><b>-currentcol
5ca0: 75 6d 6e 6e 75 6d 62 65 72 3c 2f 62 3e 3c 2f 64  umnnumber</b></d
5cb0: 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20  t>..            
5cc0: 20 20 20 20 3c 64 64 3e 3c 70 3e 20 52 65 74 75      <dd><p> Retu
5cd0: 72 6e 73 20 74 68 65 20 63 6f 6c 75 6d 6e 20 6e  rns the column n
5ce0: 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63 75 72  umber of the cur
5cf0: 72 65 6e 74 20 70 61 72 73 65 0a 6c 6f 63 61 74  rent parse.locat
5d00: 69 6f 6e 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20  ion.</p></dd>.  
5d10: 20 20 20 20 20 20 20 20 20 20 20 20 0a 0a 20 20              ..  
5d20: 20 20 20 20 20 20 20 20 20 20 20 20 0a 20 20 20              .   
5d30: 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 64 74               <dt
5d40: 3e 3c 62 3e 2d 63 75 72 72 65 6e 74 62 79 74 65  ><b>-currentbyte
5d50: 69 6e 64 65 78 3c 2f 62 3e 3c 2f 64 74 3e 0a 0a  index</b></dt>..
5d60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5d70: 3c 64 64 3e 3c 70 3e 20 52 65 74 75 72 6e 73 20  <dd><p> Returns 
5d80: 74 68 65 20 62 79 74 65 20 69 6e 64 65 78 20 6f  the byte index o
5d90: 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 61  f the current pa
5da0: 72 73 65 0a 6c 6f 63 61 74 69 6f 6e 2e 3c 2f 70  rse.location.</p
5db0: 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20 20  ></dd>.         
5dc0: 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20       .          
5dd0: 20 20 3c 2f 64 6c 3e 0a 3c 70 3e 4f 6e 6c 79 20    </dl>.<p>Only 
5de0: 6f 6e 65 20 76 61 6c 75 65 20 6d 61 79 20 62 65  one value may be
5df0: 20 72 65 71 75 65 73 74 65 64 20 61 74 20 61 20   requested at a 
5e00: 74 69 6d 65 2e 3c 2f 70 3e 0a 3c 2f 64 64 3e 0a  time.</p>.</dd>.
5e10: 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20          ..      
5e20: 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74    .          <dt
5e30: 3e 0a 3c 62 20 63 6c 61 73 73 3d 22 63 6d 64 22  >.<b class="cmd"
5e40: 3e 70 61 72 73 65 72 3c 2f 62 3e 20 3c 62 20 63  >parser</b> <b c
5e50: 6c 61 73 73 3d 22 6d 65 74 68 6f 64 22 3e 70 61  lass="method">pa
5e60: 72 73 65 3c 2f 62 3e 20 3c 69 20 63 6c 61 73 73  rse</b> <i class
5e70: 3d 22 6d 22 3e 64 61 74 61 3c 2f 69 3e 0a 3c 2f  ="m">data</i>.</
5e80: 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20 20 3c  dt>..          <
5e90: 64 64 3e 3c 70 3e 50 61 72 73 65 73 20 74 68 65  dd><p>Parses the
5ea0: 20 58 4d 4c 20 73 74 72 69 6e 67 20 3c 69 20 63   XML string <i c
5eb0: 6c 61 73 73 3d 22 6d 22 3e 64 61 74 61 3c 2f 69  lass="m">data</i
5ec0: 3e 2e 20 54 68 65 20 65 76 65 6e 74 20 63 61 6c  >. The event cal
5ed0: 6c 62 61 63 6b 0a 73 63 72 69 70 74 73 20 77 69  lback.scripts wi
5ee0: 6c 6c 20 62 65 20 63 61 6c 6c 65 64 2c 20 61 73  ll be called, as
5ef0: 20 74 68 65 72 65 20 74 72 69 67 67 65 72 69 6e   there triggerin
5f00: 67 20 65 76 65 6e 74 73 20 68 61 70 70 65 6e 73  g events happens
5f10: 2e 20 54 68 69 73 20 6d 65 74 68 6f 64 20 63 61  . This method ca
5f20: 6e 6e 6f 74 0a 62 65 20 75 73 65 64 20 66 72 6f  nnot.be used fro
5f30: 6d 20 77 69 74 68 69 6e 20 61 20 63 61 6c 6c 62  m within a callb
5f40: 61 63 6b 20 28 6e 65 69 74 68 65 72 20 64 69 72  ack (neither dir
5f50: 65 63 74 6c 79 20 6e 6f 72 20 69 6e 64 69 72 65  ectly nor indire
5f60: 63 74 6c 79 29 20 6f 66 0a 74 68 65 20 70 61 72  ctly) of.the par
5f70: 73 65 72 20 74 6f 20 62 65 20 75 73 65 64 20 61  ser to be used a
5f80: 6e 64 20 77 69 6c 6c 20 72 61 69 73 65 20 61 6e  nd will raise an
5f90: 20 65 72 72 6f 72 20 69 6e 20 74 68 69 73 20 63   error in this c
5fa0: 61 73 65 2e 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20  ase.</p></dd>.  
5fb0: 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20        ..        
5fc0: 0a 20 20 20 20 20 20 20 20 20 20 3c 64 74 3e 0a  .          <dt>.
5fd0: 3c 62 20 63 6c 61 73 73 3d 22 63 6d 64 22 3e 70  <b class="cmd">p
5fe0: 61 72 73 65 72 3c 2f 62 3e 20 3c 62 20 63 6c 61  arser</b> <b cla
5ff0: 73 73 3d 22 6d 65 74 68 6f 64 22 3e 70 61 72 73  ss="method">pars
6000: 65 63 68 61 6e 6e 65 6c 3c 2f 62 3e 20 3c 69 20  echannel</b> <i 
6010: 63 6c 61 73 73 3d 22 6d 22 3e 63 68 61 6e 6e 65  class="m">channe
6020: 6c 49 44 3c 2f 69 3e 0a 3c 2f 64 74 3e 0a 20 20  lID</i>.</dt>.  
6030: 20 20 20 20 20 20 20 20 3c 64 64 3e 3c 70 3e 52          <dd><p>R
6040: 65 61 64 73 20 74 68 65 20 58 4d 4c 20 64 61 74  eads the XML dat
6050: 61 20 6f 75 74 20 6f 66 20 74 68 65 20 74 63 6c  a out of the tcl
6060: 20 63 68 61 6e 6e 65 6c 20 3c 69 20 63 6c 61 73   channel <i clas
6070: 73 3d 22 6d 22 3e 63 68 61 6e 6e 65 6c 49 44 3c  s="m">channelID<
6080: 2f 69 3e 0a 28 73 74 61 72 74 69 6e 67 20 61 74  /i>.(starting at
6090: 20 74 68 65 20 63 75 72 72 65 6e 74 20 61 63 63   the current acc
60a0: 65 73 73 20 70 6f 73 69 74 69 6f 6e 2c 20 77 69  ess position, wi
60b0: 74 68 6f 75 74 20 61 6e 79 20 73 65 65 6b 29 20  thout any seek) 
60c0: 75 70 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66  up to the end of
60d0: 0a 66 69 6c 65 20 63 6f 6e 64 69 74 69 6f 6e 20  .file condition 
60e0: 61 6e 64 20 70 61 72 73 65 73 20 74 68 61 74 20  and parses that 
60f0: 64 61 74 61 2e 20 54 68 65 20 63 68 61 6e 6e 65  data. The channe
6100: 6c 20 65 6e 63 6f 64 69 6e 67 20 69 73 20 72 65  l encoding is re
6110: 73 70 65 63 74 65 64 2e 20 55 73 65 20 74 68 65  spected. Use the
6120: 0a 68 65 6c 70 65 72 20 70 72 6f 63 20 74 44 4f  .helper proc tDO
6130: 4d 3a 3a 78 6d 6c 4f 70 65 6e 46 69 6c 65 20 6f  M::xmlOpenFile o
6140: 75 74 20 6f 66 20 74 68 65 20 74 44 4f 4d 20 73  ut of the tDOM s
6150: 63 72 69 70 74 20 6c 69 62 72 61 72 79 20 74 6f  cript library to
6160: 20 6f 70 65 6e 20 61 20 66 69 6c 65 2c 20 69 66   open a file, if
6170: 0a 79 6f 75 20 77 61 6e 74 20 74 6f 20 75 73 65  .you want to use
6180: 20 74 68 69 73 20 6d 65 74 68 6f 64 2e 20 54 68   this method. Th
6190: 69 73 20 6d 65 74 68 6f 64 20 63 61 6e 6e 6f 74  is method cannot
61a0: 0a 62 65 20 75 73 65 64 20 66 72 6f 6d 20 77 69  .be used from wi
61b0: 74 68 69 6e 20 61 20 63 61 6c 6c 62 61 63 6b 20  thin a callback 
61c0: 28 6e 65 69 74 68 65 72 20 64 69 72 65 63 74 6c  (neither directl
61d0: 79 20 6e 6f 72 20 69 6e 64 69 72 65 63 74 6c 79  y nor indirectly
61e0: 29 20 6f 66 0a 74 68 65 20 70 61 72 73 65 72 20  ) of.the parser 
61f0: 74 6f 20 62 65 20 75 73 65 64 20 61 6e 64 20 77  to be used and w
6200: 69 6c 6c 20 72 61 69 73 65 20 61 6e 20 65 72 72  ill raise an err
6210: 6f 72 20 69 6e 20 74 68 69 73 20 63 61 73 65 2e  or in this case.
6220: 3c 2f 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20  </p></dd>.      
6230: 20 20 0a 0a 20 20 20 20 20 20 20 20 0a 20 20 20    ..        .   
6240: 20 20 20 20 20 20 20 3c 64 74 3e 0a 3c 62 20 63         <dt>.<b c
6250: 6c 61 73 73 3d 22 63 6d 64 22 3e 70 61 72 73 65  lass="cmd">parse
6260: 72 3c 2f 62 3e 20 3c 62 20 63 6c 61 73 73 3d 22  r</b> <b class="
6270: 6d 65 74 68 6f 64 22 3e 70 61 72 73 65 66 69 6c  method">parsefil
6280: 65 3c 2f 62 3e 20 3c 69 20 63 6c 61 73 73 3d 22  e</b> <i class="
6290: 6d 22 3e 66 69 6c 65 6e 61 6d 65 3c 2f 69 3e 0a  m">filename</i>.
62a0: 3c 2f 64 74 3e 0a 0a 20 20 20 20 20 20 20 20 20  </dt>..         
62b0: 20 3c 64 64 3e 3c 70 3e 52 65 61 64 73 20 74 68   <dd><p>Reads th
62c0: 65 20 58 4d 4c 20 64 61 74 61 20 64 69 72 65 63  e XML data direc
62d0: 74 6c 79 20 6f 75 74 20 6f 66 20 74 68 65 20 66  tly out of the f
62e0: 69 6c 65 20 77 69 74 68 20 74 68 65 0a 66 69 6c  ile with the.fil
62f0: 65 6e 61 6d 65 20 3c 69 20 63 6c 61 73 73 3d 22  ename <i class="
6300: 6d 22 3e 66 69 6c 65 6e 61 6d 65 3c 2f 69 3e 20  m">filename</i> 
6310: 61 6e 64 20 70 61 72 73 65 73 20 74 68 61 74 20  and parses that 
6320: 64 61 74 61 2e 20 54 68 69 73 20 69 73 20 64 6f  data. This is do
6330: 6e 65 20 77 69 74 68 20 6c 6f 77 20 6c 65 76 65  ne with low leve
6340: 6c 20 66 69 6c 65 0a 6f 70 65 72 61 74 69 6f 6e  l file.operation
6350: 73 2e 20 54 68 65 20 58 4d 4c 20 64 61 74 61 20  s. The XML data 
6360: 6d 75 73 74 20 62 65 20 69 6e 20 55 53 2d 41 53  must be in US-AS
6370: 43 49 49 2c 20 49 53 4f 2d 38 38 35 39 2d 31 2c  CII, ISO-8859-1,
6380: 20 55 54 46 2d 38 20 6f 72 20 55 54 46 2d 31 36   UTF-8 or UTF-16
6390: 0a 65 6e 63 6f 64 69 6e 67 2e 20 49 66 20 61 70  .encoding. If ap
63a0: 70 6c 69 63 61 62 6c 65 2c 20 74 68 69 73 20 69  plicable, this i
63b0: 73 20 74 68 65 20 66 61 73 74 65 73 74 20 77 61  s the fastest wa
63c0: 79 2c 20 74 6f 20 70 61 72 73 65 20 58 4d 4c 20  y, to parse XML 
63d0: 64 61 74 61 2e 20 54 68 69 73 0a 6d 65 74 68 6f  data. This.metho
63e0: 64 20 63 61 6e 6e 6f 74 20 62 65 20 75 73 65 64  d cannot be used
63f0: 20 66 72 6f 6d 20 77 69 74 68 69 6e 20 61 20 63   from within a c
6400: 61 6c 6c 62 61 63 6b 20 28 6e 65 69 74 68 65 72  allback (neither
6410: 20 64 69 72 65 63 74 6c 79 20 6e 6f 72 20 69 6e   directly nor in
6420: 64 69 72 65 63 74 6c 79 29 0a 6f 66 20 74 68 65  directly).of the
6430: 20 70 61 72 73 65 72 20 74 6f 20 62 65 20 75 73   parser to be us
6440: 65 64 20 61 6e 64 20 77 69 6c 6c 20 72 61 69 73  ed and will rais
6450: 65 20 61 6e 20 65 72 72 6f 72 20 69 6e 20 74 68  e an error in th
6460: 69 73 20 63 61 73 65 2e 3c 2f 70 3e 3c 2f 64 64  is case.</p></dd
6470: 3e 0a 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20  >.        ..    
6480: 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 20 3c      .          <
6490: 64 74 3e 0a 3c 62 20 63 6c 61 73 73 3d 22 63 6d  dt>.<b class="cm
64a0: 64 22 3e 70 61 72 73 65 72 3c 2f 62 3e 20 3c 62  d">parser</b> <b
64b0: 20 63 6c 61 73 73 3d 22 6d 65 74 68 6f 64 22 3e   class="method">
64c0: 72 65 73 65 74 3c 2f 62 3e 0a 3c 2f 64 74 3e 0a  reset</b>.</dt>.
64d0: 0a 20 20 20 20 20 20 20 20 20 20 3c 64 64 3e 3c  .          <dd><
64e0: 70 3e 52 65 73 65 74 73 20 74 68 65 20 70 61 72  p>Resets the par
64f0: 73 65 72 20 69 6e 20 70 72 65 70 61 72 61 74 69  ser in preparati
6500: 6f 6e 20 66 6f 72 20 70 61 72 73 69 6e 67 20 61  on for parsing a
6510: 6e 6f 74 68 65 72 0a 64 6f 63 75 6d 65 6e 74 2e  nother.document.
6520: 20 41 20 70 61 72 73 65 72 20 63 61 6e 6e 6f 74   A parser cannot
6530: 20 62 65 20 72 65 73 65 74 20 66 72 6f 6d 20 77   be reset from w
6540: 69 74 68 69 6e 20 6f 6e 65 20 6f 66 20 69 74 73  ithin one of its
6550: 20 68 61 6e 64 6c 65 72 20 63 61 6c 6c 62 61 63   handler callbac
6560: 6b 73 0a 28 6e 65 69 74 68 65 72 20 64 69 72 65  ks.(neither dire
6570: 63 74 6c 79 20 6e 6f 72 20 69 6e 64 69 72 65 63  ctly nor indirec
6580: 74 6c 79 29 20 61 6e 64 20 77 69 6c 6c 20 72 61  tly) and will ra
6590: 69 73 65 20 61 20 74 63 6c 20 65 72 72 6f 72 20  ise a tcl error 
65a0: 69 6e 20 74 68 69 73 0a 63 61 73 65 73 2e 3c 2f  in this.cases.</
65b0: 70 3e 3c 2f 64 64 3e 0a 20 20 20 20 20 20 20 20  p></dd>.        
65c0: 0a 20 20 20 20 20 20 3c 2f 64 6c 3e 0a 0a 20 20  .      </dl>..  
65d0: 20 20 3c 68 32 3e 3c 61 20 6e 61 6d 65 3d 22 53    <h2><a name="S
65e0: 45 43 54 69 64 30 78 31 37 34 64 36 36 30 22 3e  ECTid0x174d660">
65f0: 43 61 6c 6c 62 61 63 6b 20 43 6f 6d 6d 61 6e 64  Callback Command
6600: 20 52 65 74 75 72 6e 20 43 6f 64 65 73 3c 2f 61   Return Codes</a
6610: 3e 3c 2f 68 32 3e 3c 70 3e 41 20 73 63 72 69 70  ></h2><p>A scrip
6620: 74 20 69 6e 76 6f 6b 65 64 20 66 6f 72 20 61 6e  t invoked for an
6630: 79 20 6f 66 20 74 68 65 20 70 61 72 73 65 72 20  y of the parser 
6640: 63 61 6c 6c 62 61 63 6b 20 63 6f 6d 6d 61 6e 64  callback command
6650: 73 2c 20 73 75 63 68 20 61 73 0a 2d 65 6c 65 6d  s, such as.-elem
6660: 65 6e 74 73 74 61 72 74 63 6f 6d 6d 61 6e 64 2c  entstartcommand,
6670: 20 2d 65 6c 65 6d 65 6e 74 65 6e 64 63 6f 6d 6d   -elementendcomm
6680: 61 6e 64 2c 20 65 74 63 2c 20 6d 61 79 20 72 65  and, etc, may re
6690: 74 75 72 6e 20 61 6e 20 65 72 72 6f 72 20 63 6f  turn an error co
66a0: 64 65 20 6f 74 68 65 72 0a 74 68 61 6e 20 22 6f  de other.than "o
66b0: 6b 22 20 6f 72 20 22 65 72 72 6f 72 22 2e 20 41  k" or "error". A
66c0: 6c 6c 20 63 61 6c 6c 62 61 63 6b 73 20 6d 61 79  ll callbacks may
66d0: 20 69 6e 20 61 64 64 69 74 69 6f 6e 20 72 65 74   in addition ret
66e0: 75 72 6e 0a 22 62 72 65 61 6b 22 20 6f 72 20 22  urn."break" or "
66f0: 63 6f 6e 74 69 6e 75 65 22 2e 3c 2f 70 3e 3c 70  continue".</p><p
6700: 3e 49 66 20 61 20 63 61 6c 6c 62 61 63 6b 20 73  >If a callback s
6710: 63 72 69 70 74 20 72 65 74 75 72 6e 73 20 61 6e  cript returns an
6720: 20 22 65 72 72 6f 72 22 20 65 72 72 6f 72 20 63   "error" error c
6730: 6f 64 65 20 74 68 65 6e 0a 70 72 6f 63 65 73 73  ode then.process
6740: 69 6e 67 20 6f 66 20 74 68 65 20 64 6f 63 75 6d  ing of the docum
6750: 65 6e 74 20 69 73 20 74 65 72 6d 69 6e 61 74 65  ent is terminate
6760: 64 20 61 6e 64 20 74 68 65 20 65 72 72 6f 72 20  d and the error 
6770: 69 73 20 70 72 6f 70 61 67 61 74 65 64 20 69 6e  is propagated in
6780: 20 74 68 65 0a 75 73 75 61 6c 20 66 61 73 68 69   the.usual fashi
6790: 6f 6e 2e 3c 2f 70 3e 3c 70 3e 49 66 20 61 20 63  on.</p><p>If a c
67a0: 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 20 72  allback script r
67b0: 65 74 75 72 6e 73 20 61 20 22 62 72 65 61 6b 22  eturns a "break"
67c0: 20 65 72 72 6f 72 20 63 6f 64 65 20 74 68 65 6e   error code then
67d0: 20 61 6c 6c 0a 66 75 72 74 68 65 72 20 70 72 6f   all.further pro
67e0: 63 65 73 73 69 6e 67 20 6f 66 20 65 76 65 72 79  cessing of every
67f0: 20 68 61 6e 64 6c 65 72 20 73 63 72 69 70 74 20   handler script 
6800: 6f 75 74 20 6f 66 20 74 68 69 73 20 54 63 6c 20  out of this Tcl 
6810: 68 61 6e 64 6c 65 72 20 73 65 74 20 69 73 0a 73  handler set is.s
6820: 75 70 70 72 65 73 73 65 64 20 66 6f 72 20 74 68  uppressed for th
6830: 65 20 66 75 72 74 68 65 72 20 70 61 72 73 69 6e  e further parsin
6840: 67 2e 20 54 68 69 73 20 64 6f 65 73 20 6e 6f 74  g. This does not
6850: 20 69 6e 66 6c 75 65 6e 63 65 20 61 6e 79 20 6f   influence any o
6860: 74 68 65 72 20 68 61 6e 64 6c 65 72 0a 73 65 74  ther handler.set
6870: 2e 3c 2f 70 3e 3c 70 3e 49 66 20 61 20 63 61 6c  .</p><p>If a cal
6880: 6c 62 61 63 6b 20 73 63 72 69 70 74 20 72 65 74  lback script ret
6890: 75 72 6e 73 20 61 20 22 63 6f 6e 74 69 6e 75 65  urns a "continue
68a0: 22 20 65 72 72 6f 72 20 63 6f 64 65 20 74 68 65  " error code the
68b0: 6e 0a 70 72 6f 63 65 73 73 69 6e 67 20 6f 66 20  n.processing of 
68c0: 74 68 65 20 63 75 72 72 65 6e 74 20 65 6c 65 6d  the current elem
68d0: 65 6e 74 2c 20 61 6e 64 20 69 74 73 20 63 68 69  ent, and its chi
68e0: 6c 64 72 65 6e 2c 20 63 65 61 73 65 73 20 66 6f  ldren, ceases fo
68f0: 72 20 65 76 65 72 79 20 68 61 6e 64 6c 65 72 0a  r every handler.
6900: 73 63 72 69 70 74 20 6f 75 74 20 6f 66 20 74 68  script out of th
6910: 69 73 20 54 63 6c 20 68 61 6e 64 6c 65 72 20 73  is Tcl handler s
6920: 65 74 20 61 6e 64 20 70 72 6f 63 65 73 73 69 6e  et and processin
6930: 67 20 63 6f 6e 74 69 6e 75 65 73 20 77 69 74 68  g continues with
6940: 20 74 68 65 20 6e 65 78 74 0a 28 73 69 62 6c 69   the next.(sibli
6950: 6e 67 29 20 65 6c 65 6d 65 6e 74 2e 20 54 68 69  ng) element. Thi
6960: 73 20 64 6f 65 73 20 6e 6f 74 20 69 6e 66 6c 75  s does not influ
6970: 65 6e 63 65 20 61 6e 79 20 6f 74 68 65 72 20 68  ence any other h
6980: 61 6e 64 6c 65 72 20 73 65 74 2e 3c 2f 70 3e 3c  andler set.</p><
6990: 70 3e 49 66 20 61 20 63 61 6c 6c 62 61 63 6b 20  p>If a callback 
69a0: 73 63 72 69 70 74 20 72 65 74 75 72 6e 73 20 61  script returns a
69b0: 20 22 72 65 74 75 72 6e 22 20 65 72 72 6f 72 0a   "return" error.
69c0: 63 6f 64 65 20 74 68 65 6e 20 70 61 72 73 69 6e  code then parsin
69d0: 67 20 69 73 20 63 61 6e 63 65 6c 65 64 20 61 6c  g is canceled al
69e0: 74 6f 67 65 74 68 65 72 2c 20 62 75 74 20 6e 6f  together, but no
69f0: 20 65 72 72 6f 72 20 69 73 20 72 61 69 73 65 64   error is raised
6a00: 2e 3c 2f 70 3e 0a 0a 20 20 20 20 3c 68 32 3e 3c  .</p>..    <h2><
6a10: 61 20 6e 61 6d 65 3d 22 53 45 43 54 69 64 30 78  a name="SECTid0x
6a20: 31 37 34 65 31 66 30 22 3e 53 45 45 20 41 4c 53  174e1f0">SEE ALS
6a30: 4f 3c 2f 61 3e 3c 2f 68 32 3e 3c 70 20 63 6c 61  O</a></h2><p cla
6a40: 73 73 3d 22 73 65 65 61 6c 73 6f 22 3e 0a 3c 61  ss="seealso">.<a
6a50: 20 68 72 65 66 3d 22 65 78 70 61 74 61 70 69 2e   href="expatapi.
6a60: 68 74 6d 6c 22 3e 65 78 70 61 74 61 70 69 3c 2f  html">expatapi</
6a70: 61 3e 2c 20 3c 61 20 68 72 65 66 3d 22 74 64 6f  a>, <a href="tdo
6a80: 6d 63 6d 64 2e 68 74 6d 6c 22 3e 74 64 6f 6d 3c  mcmd.html">tdom<
6a90: 2f 61 3e 0a 3c 2f 70 3e 0a 0a 20 20 20 20 3c 68  /a>.</p>..    <h
6aa0: 32 3e 3c 61 20 6e 61 6d 65 3d 22 53 45 43 54 69  2><a name="SECTi
6ab0: 64 30 78 31 37 34 65 35 62 30 22 3e 4b 45 59 57  d0x174e5b0">KEYW
6ac0: 4f 52 44 53 3c 2f 61 3e 3c 2f 68 32 3e 3c 70 20  ORDS</a></h2><p 
6ad0: 63 6c 61 73 73 3d 22 6b 65 79 77 6f 72 64 73 22  class="keywords"
6ae0: 3e 3c 61 20 63 6c 61 73 73 3d 22 6b 65 79 77 6f  ><a class="keywo
6af0: 72 64 22 20 68 72 65 66 3d 22 6b 65 79 77 6f 72  rd" href="keywor
6b00: 64 2d 69 6e 64 65 78 2e 68 74 6d 6c 23 4b 57 2d  d-index.html#KW-
6b10: 53 41 58 22 3e 53 41 58 3c 2f 61 3e 3c 2f 70 3e  SAX">SAX</a></p>
6b20: 0a 20 20 3c 2f 64 69 76 3e 3c 68 72 20 63 6c 61  .  </div><hr cla
6b30: 73 73 3d 22 6e 61 76 73 65 70 22 3e 3c 64 69 76  ss="navsep"><div
6b40: 20 63 6c 61 73 73 3d 22 6e 61 76 62 61 72 22 20   class="navbar" 
6b50: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0a  align="center">.
6b60: 3c 61 20 63 6c 61 73 73 3d 22 6e 61 76 61 69 64  <a class="navaid
6b70: 22 20 68 72 65 66 3d 22 69 6e 64 65 78 2e 68 74  " href="index.ht
6b80: 6d 6c 22 3e 43 6f 6e 74 65 6e 74 73 3c 2f 61 3e  ml">Contents</a>
6b90: 20 c2 b7 20 3c 61 20 63 6c 61 73 73 3d 22 6e 61   · <a class="na
6ba0: 76 61 69 64 22 20 68 72 65 66 3d 22 63 61 74 65  vaid" href="cate
6bb0: 67 6f 72 79 2d 69 6e 64 65 78 2e 68 74 6d 6c 22  gory-index.html"
6bc0: 3e 49 6e 64 65 78 3c 2f 61 3e 20 c2 b7 20 3c 61  >Index</a> · <a
6bd0: 20 63 6c 61 73 73 3d 22 6e 61 76 61 69 64 22 20   class="navaid" 
6be0: 68 72 65 66 3d 22 6b 65 79 77 6f 72 64 2d 69 6e  href="keyword-in
6bf0: 64 65 78 2e 68 74 6d 6c 22 3e 4b 65 79 77 6f 72  dex.html">Keywor
6c00: 64 73 3c 2f 61 3e 20 c2 b7 20 3c 61 20 63 6c 61  ds</a> · <a cla
6c10: 73 73 3d 22 6e 61 76 61 69 64 22 20 68 72 65 66  ss="navaid" href
6c20: 3d 22 68 74 74 70 3a 2f 2f 74 64 6f 6d 2e 6f 72  ="http://tdom.or
6c30: 67 22 3e 52 65 70 6f 73 69 74 6f 72 79 3c 2f 61  g">Repository</a
6c40: 3e 0a 3c 2f 64 69 76 3e 0a 3c 2f 62 6f 64 79 3e  >.</div>.</body>
6c50: 0a 3c 2f 68 74 6d 6c 3e 0a                       .</html>.