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

Changes In Branch dom_featureinfo Excluding Merge-Ins

This is equivalent to a diff from 02675cd3c8 to d40d0f4c10

2013-09-26
01:35
Added dom method featureinfo. check-in: 9ab65ed6fc user: rolf tags: trunk
01:30
Added tests. Documentation tweak. Closed-Leaf check-in: d40d0f4c10 user: rolf tags: dom_featureinfo
2013-09-25
00:47
Updated and regenerated doc. check-in: 8ccb6f120b user: rolf tags: dom_featureinfo
00:09
Updated from trunk. check-in: 3a3b825826 user: rolf tags: dom_featureinfo
00:03
More work on OASIS-suite.tcl. check-in: 02675cd3c8 user: rolf tags: trunk
2013-09-24
22:50
Added a Relax NG compact tmml schema definition (generated by trang from the tmml.dtd and a minor modification. check-in: 1189b8bada user: rolf tags: trunk

Changes to doc/dom.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: dom</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x80b16e8">NAME</a> · <a href="#SECTid0x80b1760">SYNOPSIS</a> · <a href="#SECTid0x80b1828">DESCRIPTION </a> · <a href="#SECTid0x80b3f38">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x80b16e8">NAME</a></h2><p class="namesection">
<b class="names">dom - </b><br>Create an in-memory DOM tree from XML</p>
  
  <h2><a name="SECTid0x80b1760">SYNOPSIS</a></h2><pre class="syntax">package require tdom

<b class="cmd">dom</b> <i class="m">method</i> ?<i class="m">arg arg ...</i>?</pre>

  <h2><a name="SECTid0x80b1828">DESCRIPTION </a></h2><p>This command provides the creation of complete DOM trees in memory. In
the usual case a string containing a XML information is parsed and converted
into a DOM tree. <i class="m">method</i> indicates a specific subcommand. </p><p>The valid methods are:</p><dl class="commandlist">
        
          <dt>
<b class="cmd">dom</b> <b class="method">parse</b> ?<i class="m">options</i>? ?<i class="m">data</i>?</dt>
          <dd>Parses the XML information and builds up the DOM tree in memory
providing a Tcl object command to this DOM document object. Example:


|



|


|


|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: dom</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xc559e0">NAME</a> · <a href="#SECTid0xc0a3d0">SYNOPSIS</a> · <a href="#SECTid0xc5fe50">DESCRIPTION </a> · <a href="#SECTid0xbf8f80">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0xc559e0">NAME</a></h2><p class="namesection">
<b class="names">dom - </b><br>Create an in-memory DOM tree from XML</p>
  
  <h2><a name="SECTid0xc0a3d0">SYNOPSIS</a></h2><pre class="syntax">package require tdom

<b class="cmd">dom</b> <i class="m">method</i> ?<i class="m">arg arg ...</i>?</pre>

  <h2><a name="SECTid0xc5fe50">DESCRIPTION </a></h2><p>This command provides the creation of complete DOM trees in memory. In
the usual case a string containing a XML information is parsed and converted
into a DOM tree. <i class="m">method</i> indicates a specific subcommand. </p><p>The valid methods are:</p><dl class="commandlist">
        
          <dt>
<b class="cmd">dom</b> <b class="method">parse</b> ?<i class="m">options</i>? ?<i class="m">data</i>?</dt>
          <dd>Parses the XML information and builds up the DOM tree in memory
providing a Tcl object command to this DOM document object. Example:
414
415
416
417
418
419
420
























































421

422


423
424
425
426
427
428
429
430
431
432
433
434
435
<i class="m">string</i>
</dt>
          <dd>Returns 1, if <i class="m">string</i> is
valid according to production 16 of the <a href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</a>
recommendation. Otherwise it returns 0.</dd>
        

























































      </dl>




  <h2><a name="SECTid0x80b3f38">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-XML">XML</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-document">document</a>, <a class="keyword" href="keyword-index.html#KW-node">node</a>, <a class="keyword" href="keyword-index.html#KW-parsing">parsing</a>
</p>
</div><div class="footer">
<hr class="navsep"><!-- footer.html: Standard navigational footer --><div class="navbar" align="center">
        <a class="navaid" href="index.html">tDOM Overview</a>
 ·	<a class="navaid" href="doc-index.html">Table of Contents</a>
 ·	<a class="navaid" href="category-index.html">Index</a>
 ·	<a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</div>
</body>
</html>







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


<
|
|
<
<
<
<



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484

485
486




487
488
489
<i class="m">string</i>
</dt>
          <dd>Returns 1, if <i class="m">string</i> is
valid according to production 16 of the <a href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</a>
recommendation. Otherwise it returns 0.</dd>
        

        
            <dt>
<b class="cmd">dom</b> <b class="method">featureinfo</b>
            <i class="m">feature</i>
</dt>
            <dd>This method provides information about the used
            build options and the expat version. The valid values for
            the <i class="m">feature</i> argument are:
            <dl class="optlist">
                
                    <dt><b>expatversion</b></dt>
                    <dd>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is. what the expat API
                    function XML_ExpatVersion() returns.</dd>
                
                
                    <dt><b>expatmajorversion</b></dt>
                    <dd>Returns the major version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>expatminorversion</b></dt>
                    <dd>Returns the minor version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>expatmicroversion</b></dt>
                    <dd>Returns the micro version of the underlyling
                    expat version as integer.</dd>
                
                
                    <dt><b>dtd</b></dt>
                    <dd>Returns as boolean, if build with
                    <i class="m">--enable-dtd</i>.</dd>
                
                
                    <dt><b>ns</b></dt>
                    <dd>Returns as boolean, if build with
                    <i class="m">--enable-ns</i>.</dd>
                
                
                    <dt><b>unknown</b></dt>
                    <dd>Returns as boolean, if build with
                    <i class="m">--enable-unknown</i>.</dd>
                
                
                    <dt><b>tdomalloc</b></dt>
                    <dd>Returns as boolean, if build with
                    <i class="m">--enable-tdomalloc</i>.</dd>
                
                
                    <dt><b>lessns</b></dt>
                    <dd>Returns as boolean, if build with
                    <i class="m">--enable-lessns</i>.</dd>
                
            </dl>
            </dd>   
        
    </dl>

<h2><a name="SECTid0xbf8f80">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-XML">XML</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-document">document</a>, <a class="keyword" href="keyword-index.html#KW-node">node</a>, <a class="keyword" href="keyword-index.html#KW-parsing">parsing</a>
</p>

</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>




</div>
</body>
</html>

Changes to doc/dom.n.

486
487
488
489
490
491
492




































493
494
valid according to production 20 of the XML 1.0
recommendation. Otherwise it returns 0.
.TP
\&\fB\fBdom\fP \fBisPIValue\fP \fIstring\fB
\&\fRReturns 1, if \fIstring\fR is
valid according to production 16 of the XML 1.0
recommendation. Otherwise it returns 0.




































.SH KEYWORDS
XML, DOM, document, node, parsing







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


486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
valid according to production 20 of the XML 1.0
recommendation. Otherwise it returns 0.
.TP
\&\fB\fBdom\fP \fBisPIValue\fP \fIstring\fB
\&\fRReturns 1, if \fIstring\fR is
valid according to production 16 of the XML 1.0
recommendation. Otherwise it returns 0.
.TP
\&\fB\fBdom\fP \fBfeatureinfo\fP \fIfeature\fB
\&\fRThis method provides information about the used
build options and the expat version. The valid values for
the \fIfeature\fR argument are:
.RS
.IP "\fBexpatversion\fR"
Returns the version of the underlyling expat
version as string, something like
"exapt_2.1.0". This is. what the expat API
function XML_ExpatVersion() returns.
.IP "\fBexpatmajorversion\fR"
Returns the major version of the underlyling
expat version as integer.
.IP "\fBexpatminorversion\fR"
Returns the minor version of the underlyling
expat version as integer.
.IP "\fBexpatmicroversion\fR"
Returns the micro version of the underlyling
expat version as integer.
.IP "\fBdtd\fR"
Returns as boolean, if build with
\&\fI--enable-dtd\fR.
.IP "\fBns\fR"
Returns as boolean, if build with
\&\fI--enable-ns\fR.
.IP "\fBunknown\fR"
Returns as boolean, if build with
\&\fI--enable-unknown\fR.
.IP "\fBtdomalloc\fR"
Returns as boolean, if build with
\&\fI--enable-tdomalloc\fR.
.IP "\fBlessns\fR"
Returns as boolean, if build with
\&\fI--enable-lessns\fR.
.RE
.SH KEYWORDS
XML, DOM, document, node, parsing

Changes to doc/dom.xml.

386
387
388
389
390
391
392
























































393
394
395
396
397
398
399
400
401
402
403
          <command><cmd>dom</cmd> <method>isPIValue</method>
<m>string</m></command>
          <desc>Returns 1, if <m>string</m> is
valid according to production 16 of the <ref href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</ref>
recommendation. Otherwise it returns 0.</desc>
        </commanddef>

























































      </commandlist>
  </section>

  <keywords>
    <keyword>XML</keyword>
    <keyword>DOM</keyword>
    <keyword>document</keyword>
    <keyword>node</keyword>
    <keyword>parsing</keyword>
  </keywords>
</manpage>







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

|





|

386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
          <command><cmd>dom</cmd> <method>isPIValue</method>
<m>string</m></command>
          <desc>Returns 1, if <m>string</m> is
valid according to production 16 of the <ref href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</ref>
recommendation. Otherwise it returns 0.</desc>
        </commanddef>

        <commanddef>
            <command><cmd>dom</cmd> <method>featureinfo</method> <m>feature</m></command>
            <desc>This method provides information about the used
            build options and the expat version. The valid values for
            the <m>feature</m> argument are:
            <optlist>
                <optdef>
                    <optname>expatversion</optname>
                    <desc>Returns the version of the underlyling expat
                    version as string, something like
                    "exapt_2.1.0". This is. what the expat API
                    function XML_ExpatVersion() returns.</desc>
                </optdef>
                <optdef>
                    <optname>expatmajorversion</optname>
                    <desc>Returns the major version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatminorversion</optname>
                    <desc>Returns the minor version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>expatmicroversion</optname>
                    <desc>Returns the micro version of the underlyling
                    expat version as integer.</desc>
                </optdef>
                <optdef>
                    <optname>dtd</optname>
                    <desc>Returns as boolean, if build with
                    <m>--enable-dtd</m>.</desc>
                </optdef>
                <optdef>
                    <optname>ns</optname>
                    <desc>Returns as boolean, if build with
                    <m>--enable-ns</m>.</desc>
                </optdef>
                <optdef>
                    <optname>unknown</optname>
                    <desc>Returns as boolean, if build with
                    <m>--enable-unknown</m>.</desc>
                </optdef>
                <optdef>
                    <optname>tdomalloc</optname>
                    <desc>Returns as boolean, if build with
                    <m>--enable-tdomalloc</m>.</desc>
                </optdef>
                <optdef>
                    <optname>lessns</optname>
                    <desc>Returns as boolean, if build with
                    <m>--enable-lessns</m>.</desc>
                </optdef>
            </optlist>
            </desc>   
        </commanddef>
    </commandlist>
</section>

<keywords>
    <keyword>XML</keyword>
    <keyword>DOM</keyword>
    <keyword>document</keyword>
    <keyword>node</keyword>
    <keyword>parsing</keyword>
</keywords>
</manpage>

Changes to doc/domDoc.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: domDoc</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x80a9a60">NAME</a> · <a href="#SECTid0x80a7380">SYNOPSIS</a> · <a href="#SECTid0x80967e0">DESCRIPTION </a> · <a href="#SECTid0x80cf590">SEE ALSO</a> · <a href="#SECTid0x80cf7b0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x80a9a60">NAME</a></h2><p class="namesection">
<b class="names">domDoc - </b><br>Manipulates an instance of a DOM document object</p>
  
  <h2><a name="SECTid0x80a7380">SYNOPSIS</a></h2><pre class="syntax">
<b class="cmd">domDocObjCmd</b> <i class="m">method</i> ?<i class="m">arg arg ...</i>?</pre>

  <h2><a name="SECTid0x80967e0">DESCRIPTION </a></h2><p>This command manipulates one particular instance of a document
object. <i class="m">method</i> indicates a specific method of the document class. These
methods should closely conform to the W3C recommendation "Document Object Model
(Core) Level 1" (<a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html">http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html</a>). Look
at these documents for a deeper understanding of the functionality.</p><p>The valid methods are:</p><dl class="commandlist">
        
          <dt>
<b class="method">documentElement</b> ?<i class="m">objVar</i>?</dt>


|



|


|


|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: domDoc</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xb33e90">NAME</a> · <a href="#SECTid0xbdcc00">SYNOPSIS</a> · <a href="#SECTid0xbd6c70">DESCRIPTION </a> · <a href="#SECTid0xc270c0">SEE ALSO</a> · <a href="#SECTid0xc27450">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0xb33e90">NAME</a></h2><p class="namesection">
<b class="names">domDoc - </b><br>Manipulates an instance of a DOM document object</p>
  
  <h2><a name="SECTid0xbdcc00">SYNOPSIS</a></h2><pre class="syntax">
<b class="cmd">domDocObjCmd</b> <i class="m">method</i> ?<i class="m">arg arg ...</i>?</pre>

  <h2><a name="SECTid0xbd6c70">DESCRIPTION </a></h2><p>This command manipulates one particular instance of a document
object. <i class="m">method</i> indicates a specific method of the document class. These
methods should closely conform to the W3C recommendation "Document Object Model
(Core) Level 1" (<a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html">http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html</a>). Look
at these documents for a deeper understanding of the functionality.</p><p>The valid methods are:</p><dl class="commandlist">
        
          <dt>
<b class="method">documentElement</b> ?<i class="m">objVar</i>?</dt>
176
177
178
179
180
181
182

183
184
185
186
187
188
189
190
191
        <dd>Returns the system identifier of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the system identifier of the document is set to this
value.</dd>
      

      

        <dt><b class="method">internalSubset <i class="m">?internalSubset?</i>
</b></dt>
        <dd>Returns the internal subset of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the internal subset of the document is set to this
value. Note, that none of the parsing methods preserve the internal subset
of a document; a freshly parsed document will always have an empty internal
subset. Also note, that the method doesen't do any syntactical check on a
given internal subset.</dd>







>
|
|







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
        <dd>Returns the system identifier of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the system identifier of the document is set to this
value.</dd>
      

      
        <dt>
<b class="method">internalSubset</b> <i class="m">?internalSubset?</i>
</dt>
        <dd>Returns the internal subset of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the internal subset of the document is set to this
value. Note, that none of the parsing methods preserve the internal subset
of a document; a freshly parsed document will always have an empty internal
subset. Also note, that the method doesen't do any syntactical check on a
given internal subset.</dd>
502
503
504
505
506
507
508

509
510
511
512
513
514
515
516
517
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]</pre>

          </dd>
      

      

        <dt><b class="method">baseURI <i class="m">?URI?</i>
</b></dt>
        <dd>Returns the present baseURI of the document. If the optional 
argument URI is given, sets the base URI of the document to the given URI.</dd>
      

      
        <dt>
<b class="method">appendFromScript</b> <i class="m">tclScript</i>







>
|
|







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]</pre>

          </dd>
      

      
        <dt>
<b class="method">baseURI</b> <i class="m">?URI?</i>
</dt>
        <dd>Returns the present baseURI of the document. If the optional 
argument URI is given, sets the base URI of the document to the given URI.</dd>
      

      
        <dt>
<b class="method">appendFromScript</b> <i class="m">tclScript</i>
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562

  </dl><p>Otherwise, if an unknown method name is given, the command with the
same name as the given metho within the namespace <tt class="samp">::dom::domDoc</tt> is
tried to be executed. This allows quick method additions on Tcl level.</p><p>Newly created nodes are appended to a hidden fragment list. If they
are not moved into the tree they are automaticaly deleted, when the whole
document gets deleted.</p>

    <h2><a name="SECTid0x80cf590">SEE ALSO</a></h2><p class="seealso">dom, domNode</p>

    <h2><a name="SECTid0x80cf7b0">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-DOMnodecreation">DOM node creation</a>, <a class="keyword" href="keyword-index.html#KW-documentelement">document element</a>
</p>

</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>







|

|








547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564

  </dl><p>Otherwise, if an unknown method name is given, the command with the
same name as the given metho within the namespace <tt class="samp">::dom::domDoc</tt> is
tried to be executed. This allows quick method additions on Tcl level.</p><p>Newly created nodes are appended to a hidden fragment list. If they
are not moved into the tree they are automaticaly deleted, when the whole
document gets deleted.</p>

    <h2><a name="SECTid0xc270c0">SEE ALSO</a></h2><p class="seealso">dom, domNode</p>

    <h2><a name="SECTid0xc27450">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-DOMnodecreation">DOM node creation</a>, <a class="keyword" href="keyword-index.html#KW-documentelement">document element</a>
</p>

</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>

Changes to doc/domDoc.n.

280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
.TP
\&\fB\fBsystemId\fP \fI?systemId?\fB
\&\fRReturns the system identifier of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the system identifier of the document is set to this
value.
.TP
\&\fB\fBinternalSubset \fI?internalSubset?\fB\fP
\&\fRReturns the internal subset of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the internal subset of the document is set to this
value. Note, that none of the parsing methods preserve the internal subset
of a document; a freshly parsed document will always have an empty internal
subset. Also note, that the method doesen't do any syntactical check on a
given internal subset.







|







280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
.TP
\&\fB\fBsystemId\fP \fI?systemId?\fB
\&\fRReturns the system identifier of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the system identifier of the document is set to this
value.
.TP
\&\fB\fBinternalSubset\fP \fI?internalSubset?\fB
\&\fRReturns the internal subset of the doctype declaration of the
document, if there is one, otherwise the empty string. If there is a value
given to the method, the internal subset of the document is set to this
value. Note, that none of the parsing methods preserve the internal subset
of a document; a freshly parsed document will always have an empty internal
subset. Also note, that the method doesen't do any syntactical check on a
given internal subset.
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
.CE
.RE
.TP
\&\fB\fBbaseURI \fI?URI?\fB\fP
\&\fRReturns the present baseURI of the document. If the optional
argument URI is given, sets the base URI of the document to the given URI.
.TP
\&\fB\fBappendFromScript\fP \fItclScript\fB
\&\fRAppends the nodes created by the \fItclScript\fR by
Tcl functions, which have been built using \fIdom createNodeCmd\fR, at the end
of the current list of top level nodes of the document.







|







532
533
534
535
536
537
538
539
540
541
542
543
544
545
546

set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}]
set root [$doc documentElement]
set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]
.CE
.RE
.TP
\&\fB\fBbaseURI\fP \fI?URI?\fB
\&\fRReturns the present baseURI of the document. If the optional
argument URI is given, sets the base URI of the document to the given URI.
.TP
\&\fB\fBappendFromScript\fP \fItclScript\fB
\&\fRAppends the nodes created by the \fItclScript\fR by
Tcl functions, which have been built using \fIdom createNodeCmd\fR, at the end
of the current list of top level nodes of the document.

Changes to doc/domNode.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: domNode</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xb3b870">NAME</a> · <a href="#SECTid0xb53db0">SYNOPSIS</a> · <a href="#SECTid0xb5e220"> DESCRIPTION </a> · <a href="#SECTid0xba0550">SEE ALSO</a> · <a href="#SECTid0xba0920">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0xb3b870">NAME</a></h2><p class="namesection">
<b class="names">domNode - </b><br>Manipulates an instance of a DOM node object</p>



  <h2><a name="SECTid0xb53db0">SYNOPSIS</a></h2><pre class="syntax"> $nodeObject <i class="m">method</i>  <i class="m">arg arg ...</i>
</pre>
  <h2><a name="SECTid0xb5e220"> DESCRIPTION </a></h2><p>This command manipulates one particular instance of a DOM node object.
<i class="m">method</i> indicates a specific method of the node class. These methods
should closely conform to the W3C recommendation "Document Object Model
(Core) Level 1" (<a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html">http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html</a>)
as well to parts of the W3C draft "XML Pointer Language (XPointer)"
(<a href="http://www.w3.org/TR/1998/WD-xptr-19980303">http://www.w3.org/TR/1998/WD-xptr-19980303</a>).
Please note, that the XPointer methods are deprecated. Use DOM methods
or XPath expressions instead of them.</p><p>The selectNodes method implements the "XML Path






|


|




|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: domNode</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xbfa130">NAME</a> · <a href="#SECTid0xb35060">SYNOPSIS</a> · <a href="#SECTid0xc044c0"> DESCRIPTION </a> · <a href="#SECTid0xc30d50">SEE ALSO</a> · <a href="#SECTid0xc310e0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0xbfa130">NAME</a></h2><p class="namesection">
<b class="names">domNode - </b><br>Manipulates an instance of a DOM node object</p>



  <h2><a name="SECTid0xb35060">SYNOPSIS</a></h2><pre class="syntax"> $nodeObject <i class="m">method</i>  <i class="m">arg arg ...</i>
</pre>
  <h2><a name="SECTid0xc044c0"> DESCRIPTION </a></h2><p>This command manipulates one particular instance of a DOM node object.
<i class="m">method</i> indicates a specific method of the node class. These methods
should closely conform to the W3C recommendation "Document Object Model
(Core) Level 1" (<a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html">http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html</a>)
as well to parts of the W3C draft "XML Pointer Language (XPointer)"
(<a href="http://www.w3.org/TR/1998/WD-xptr-19980303">http://www.w3.org/TR/1998/WD-xptr-19980303</a>).
Please note, that the XPointer methods are deprecated. Use DOM methods
or XPath expressions instead of them.</p><p>The selectNodes method implements the "XML Path
558
559
560
561
562
563
564

565
566
567
568
569
570
571
572
573
574
575
576
577
578
579

580
581
582
583
584
585
586
587
588
        <dd>Translate the subtree starting at the object node according to
the specifications in <i class="m">specifications</i> and outputs the result in the
variable <i class="m">outputVar</i> . The translation is very similar to Cost Simple
mode.</dd>
      

      

        <dt><b class="method">toXPath <i class="m">?-legacy?</i>
</b></dt>
        <dd>Returns an XPath, which exactly addresses the given
node in its document. This XPath is only valid as there are no changes to DOM
tree made later one. With the -legacy option, other XPath expressions
are returnd, which doesn't work in all cases.</dd>
      

      
        <dt><b class="method">getBaseURI</b></dt>
        <dd>Returns the baseURI of the node. This method is deprecated in
          favor of the <i class="m">baseURI</i> method.</dd>
      

      

        <dt><b class="method">baseURI <i class="m">?URI?</i>
</b></dt>
        <dd>Returns the present baseURI of the node. If the optional 
argument URI is given, sets the base URI of the node and of all of its child
nodes out of the same enitity as node to the given URI.</dd>
      

      
        <dt>







>
|
|













>
|
|







558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
        <dd>Translate the subtree starting at the object node according to
the specifications in <i class="m">specifications</i> and outputs the result in the
variable <i class="m">outputVar</i> . The translation is very similar to Cost Simple
mode.</dd>
      

      
        <dt>
<b class="method">toXPath</b> <i class="m">?-legacy?</i>
</dt>
        <dd>Returns an XPath, which exactly addresses the given
node in its document. This XPath is only valid as there are no changes to DOM
tree made later one. With the -legacy option, other XPath expressions
are returnd, which doesn't work in all cases.</dd>
      

      
        <dt><b class="method">getBaseURI</b></dt>
        <dd>Returns the baseURI of the node. This method is deprecated in
          favor of the <i class="m">baseURI</i> method.</dd>
      

      
        <dt>
<b class="method">baseURI</b> <i class="m">?URI?</i>
</dt>
        <dd>Returns the present baseURI of the node. If the optional 
argument URI is given, sets the base URI of the node and of all of its child
nodes out of the same enitity as node to the given URI.</dd>
      

      
        <dt>
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
for <i class="m">getAttribute</i>.</dd>
      
    </dl><p>Otherwise, if an unknown method name is given, the command with the same
name as the given method within the namespace <tt class="l">::dom::domNode</tt> is tried to
be executed. This allows quick method additions on Tcl level.</p>


  <h2><a name="SECTid0xba0550">SEE ALSO</a></h2><p class="seealso">dom, domDoc</p>
  
  <h2><a name="SECTid0xba0920">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-XML">XML</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-document">document</a>, <a class="keyword" href="keyword-index.html#KW-node">node</a>, <a class="keyword" href="keyword-index.html#KW-parsing">parsing</a>
</p>
  
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>







|

|








665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
for <i class="m">getAttribute</i>.</dd>
      
    </dl><p>Otherwise, if an unknown method name is given, the command with the same
name as the given method within the namespace <tt class="l">::dom::domNode</tt> is tried to
be executed. This allows quick method additions on Tcl level.</p>


  <h2><a name="SECTid0xc30d50">SEE ALSO</a></h2><p class="seealso">dom, domDoc</p>
  
  <h2><a name="SECTid0xc310e0">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-XML">XML</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-document">document</a>, <a class="keyword" href="keyword-index.html#KW-node">node</a>, <a class="keyword" href="keyword-index.html#KW-parsing">parsing</a>
</p>
  
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>

Changes to doc/domNode.n.

533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
.TP
\&\fB\fBsimpleTranslate\fP \fIoutputVar\fB \fIspecifications\fB
\&\fRTranslate the subtree starting at the object node according to
the specifications in \fIspecifications\fR and outputs the result in the
variable \fIoutputVar\fR . The translation is very similar to Cost Simple
mode.
.TP
\&\fB\fBtoXPath \fI?-legacy?\fB\fP
\&\fRReturns an XPath, which exactly addresses the given
node in its document. This XPath is only valid as there are no changes to DOM
tree made later one. With the -legacy option, other XPath expressions
are returnd, which doesn't work in all cases.
.TP
\&\fB\fBgetBaseURI\fP
\&\fRReturns the baseURI of the node. This method is deprecated in
favor of the \fIbaseURI\fR method.
.TP
\&\fB\fBbaseURI \fI?URI?\fB\fP
\&\fRReturns the present baseURI of the node. If the optional
argument URI is given, sets the base URI of the node and of all of its child
nodes out of the same enitity as node to the given URI.
.TP
\&\fB\fBdisableOutputEscaping\fP \fI?boolean?\fB
\&\fRThis method works only for text nodes; for every other nodes it
returns error. Without the optional argument it returns, if disabling output







|









|







533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
.TP
\&\fB\fBsimpleTranslate\fP \fIoutputVar\fB \fIspecifications\fB
\&\fRTranslate the subtree starting at the object node according to
the specifications in \fIspecifications\fR and outputs the result in the
variable \fIoutputVar\fR . The translation is very similar to Cost Simple
mode.
.TP
\&\fB\fBtoXPath\fP \fI?-legacy?\fB
\&\fRReturns an XPath, which exactly addresses the given
node in its document. This XPath is only valid as there are no changes to DOM
tree made later one. With the -legacy option, other XPath expressions
are returnd, which doesn't work in all cases.
.TP
\&\fB\fBgetBaseURI\fP
\&\fRReturns the baseURI of the node. This method is deprecated in
favor of the \fIbaseURI\fR method.
.TP
\&\fB\fBbaseURI\fP \fI?URI?\fB
\&\fRReturns the present baseURI of the node. If the optional
argument URI is given, sets the base URI of the node and of all of its child
nodes out of the same enitity as node to the given URI.
.TP
\&\fB\fBdisableOutputEscaping\fP \fI?boolean?\fB
\&\fRThis method works only for text nodes; for every other nodes it
returns error. Without the optional argument it returns, if disabling output

Changes to doc/expat.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: expat</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid80acb10">NAME</a> · <a href="#SECTid80acb88">SYNOPSIS</a> · <a href="#SECTid80acd40">DESCRIPTION</a> · <a href="#SECTid80ace80">COMMAND OPTIONS</a> · <a href="#SECTid80aeac8"> COMMAND METHODS </a> · <a href="#SECTid80af860">Callback Command Return Codes</a> · <a href="#SECTid80af950">SEE ALSO</a> · <a href="#SECTid80af9c8">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid80acb10">NAME</a></h2><p class="namesection">
<b class="names">expat - </b><br>Creates an instance of an expat parser object</p>



    <h2><a name="SECTid80acb88">SYNOPSIS</a></h2><pre class="syntax">
<b class="cmd">package require tdom</b>

<b class="cmd">expat</b> ?<i class="m">parsername</i>? ?<i class="m">-namespace</i>? ?<i class="m">arg arg ..</i>

<b class="cmd">xml::parser</b> ?<i class="m">parsername</i>? ?<i class="m">-namespace</i>? ?<i class="m">arg arg ..</i>
</pre>
    <h2><a name="SECTid80acd40">DESCRIPTION</a></h2><p>The parser created with <i class="m">expat</i> or <i class="m">xml::parser</i>
(which is just another name for the same command in an own namespace) are able
to parse any kind of well-formed XML. The parsers are stream oriented XML
parser. This means that you register handler scripts with the parser prior to
starting the parse. These handler scripts are called when the parser discovers
the associated structures in the document being parsed.  A start tag is an
example of the kind of structures for which you may register a handler
script.</p><p>The parsers do not validate the XML document. They do parse the internal DTD
and, at request, external DTD and external entities, if you resolve the
identifier of the external entities with the -externalentitycommand script (see
there).</p><p>Additionly, the Tcl extension code that implements this command provides an
API for adding C level coded handlers. Up to now, there exists the parser
extension command "tdom". The handler set installed by this extension build an
in memory "tDOM" DOM tree, while the parser is parsing the input.</p><p>It is possible to register an arbitrary amount of different handler scripts
and C level handlers for most of the events. If the event occurs, they are
called in turn.</p>

    <h2><a name="SECTid80ace80">COMMAND OPTIONS</a></h2><dl class="optlist">
        
          <dt><b>-namespace</b></dt>

          <dd>
<p>Enables namespace parsing. You must use this option while
creating the parser with the <tt class="samp">expat</tt> or <tt class="samp">xml::parser</tt>
command. You can't enable (nor disable) namespace parsing with


|



|


|




|






|
















|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: expat</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xbd7740">NAME</a> · <a href="#SECTid0xc60700">SYNOPSIS</a> · <a href="#SECTid0xc4eae0">DESCRIPTION</a> · <a href="#SECTid0xc53830">COMMAND OPTIONS</a> · <a href="#SECTid0xc3a630"> COMMAND METHODS </a> · <a href="#SECTid0xc17880">Callback Command Return Codes</a> · <a href="#SECTid0xc18290">SEE ALSO</a> · <a href="#SECTid0xc18650">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0xbd7740">NAME</a></h2><p class="namesection">
<b class="names">expat - </b><br>Creates an instance of an expat parser object</p>



    <h2><a name="SECTid0xc60700">SYNOPSIS</a></h2><pre class="syntax">
<b class="cmd">package require tdom</b>

<b class="cmd">expat</b> ?<i class="m">parsername</i>? ?<i class="m">-namespace</i>? ?<i class="m">arg arg ..</i>

<b class="cmd">xml::parser</b> ?<i class="m">parsername</i>? ?<i class="m">-namespace</i>? ?<i class="m">arg arg ..</i>
</pre>
    <h2><a name="SECTid0xc4eae0">DESCRIPTION</a></h2><p>The parser created with <i class="m">expat</i> or <i class="m">xml::parser</i>
(which is just another name for the same command in an own namespace) are able
to parse any kind of well-formed XML. The parsers are stream oriented XML
parser. This means that you register handler scripts with the parser prior to
starting the parse. These handler scripts are called when the parser discovers
the associated structures in the document being parsed.  A start tag is an
example of the kind of structures for which you may register a handler
script.</p><p>The parsers do not validate the XML document. They do parse the internal DTD
and, at request, external DTD and external entities, if you resolve the
identifier of the external entities with the -externalentitycommand script (see
there).</p><p>Additionly, the Tcl extension code that implements this command provides an
API for adding C level coded handlers. Up to now, there exists the parser
extension command "tdom". The handler set installed by this extension build an
in memory "tDOM" DOM tree, while the parser is parsing the input.</p><p>It is possible to register an arbitrary amount of different handler scripts
and C level handlers for most of the events. If the event occurs, they are
called in turn.</p>

    <h2><a name="SECTid0xc53830">COMMAND OPTIONS</a></h2><dl class="optlist">
        
          <dt><b>-namespace</b></dt>

          <dd>
<p>Enables namespace parsing. You must use this option while
creating the parser with the <tt class="samp">expat</tt> or <tt class="samp">xml::parser</tt>
command. You can't enable (nor disable) namespace parsing with
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
-paramentityparsing value of "never" (which is the default) suppresses any call
to the -externalentitycommand script. Pleace notice, that, if the document also
doesn't have an internal subset, the -startdoctypedeclcommand and
enddoctypedeclcommand scripts, if set, are not called.</dd>
        

      </dl>
    <h2><a name="SECTid80aeac8"> COMMAND METHODS </a></h2><dl class="commandlist">
        
          <dt>
<b class="cmd">parser</b> <b class="method">configure</b> <i class="m">option value ?option value?</i>
</dt>

          <dd><p>Sets configuration options for the parser. Every command
option, except <i class="m">-namespace</i> can be set or modified with this method.</p></dd>
        

        
          <dt>
<b class="cmd">parser</b> <b class="method">cget <i class="m">?-handlerset name? option</i>
</b>
</dt>

          <dd>
<p>Return the current configuration value option for the
parser.</p> 
          <p>If the -handlerset option is used, the configuration for the
named handler set is returned.</p>







|











|
<







612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631

632
633
634
635
636
637
638
-paramentityparsing value of "never" (which is the default) suppresses any call
to the -externalentitycommand script. Pleace notice, that, if the document also
doesn't have an internal subset, the -startdoctypedeclcommand and
enddoctypedeclcommand scripts, if set, are not called.</dd>
        

      </dl>
    <h2><a name="SECTid0xc3a630"> COMMAND METHODS </a></h2><dl class="commandlist">
        
          <dt>
<b class="cmd">parser</b> <b class="method">configure</b> <i class="m">option value ?option value?</i>
</dt>

          <dd><p>Sets configuration options for the parser. Every command
option, except <i class="m">-namespace</i> can be set or modified with this method.</p></dd>
        

        
          <dt>
<b class="cmd">parser</b> <b class="method">cget</b> <i class="m">?-handlerset name? option</i>

</dt>

          <dd>
<p>Return the current configuration value option for the
parser.</p> 
          <p>If the -handlerset option is used, the configuration for the
named handler set is returned.</p>
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
          <dd><p>Resets the parser in preparation for parsing another
document. A parser cannot be reseted from within one of its handler callbacks
(neither directly nor indirectly) and will raise a tcl error in this
cases.</p></dd>
        
      </dl>

    <h2><a name="SECTid80af860">Callback Command Return Codes</a></h2><p>A script invoked for any of the parser callback commands, such as
-elementstartcommand, -elementendcommand, etc, may return an error code other
than "ok" or "error". All callbacks may in addition return
"break" or "continue".</p><p>If a callback script returns an "error" error code then
processing of the document is terminated and the error is propagated in the
usual fashion.</p><p>If a callback script returns a "break" error code then all
further processing of every handler script out of this Tcl handler set is
suppressed for the further parsing. This does not influence any other handler
set.</p><p>If a callback script returns a "continue" error code then
processing of the current element, and its children, ceases for every handler
script out of this Tcl handler set and processing continues with the next
(sibling) element. This does not influence any other handler set.</p>

    <h2><a name="SECTid80af950">SEE ALSO</a></h2><p class="seealso">
<a href="expatapi.html">expatapi</a>, <a href="tdomcmd.html">tdom</a>
</p>

    <h2><a name="SECTid80af9c8">KEYWORDS</a></h2><p class="keywords"><a class="keyword" href="keyword-index.html#KW-SAX">SAX</a></p>
  </div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>







|












|



|





751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
          <dd><p>Resets the parser in preparation for parsing another
document. A parser cannot be reseted from within one of its handler callbacks
(neither directly nor indirectly) and will raise a tcl error in this
cases.</p></dd>
        
      </dl>

    <h2><a name="SECTid0xc17880">Callback Command Return Codes</a></h2><p>A script invoked for any of the parser callback commands, such as
-elementstartcommand, -elementendcommand, etc, may return an error code other
than "ok" or "error". All callbacks may in addition return
"break" or "continue".</p><p>If a callback script returns an "error" error code then
processing of the document is terminated and the error is propagated in the
usual fashion.</p><p>If a callback script returns a "break" error code then all
further processing of every handler script out of this Tcl handler set is
suppressed for the further parsing. This does not influence any other handler
set.</p><p>If a callback script returns a "continue" error code then
processing of the current element, and its children, ceases for every handler
script out of this Tcl handler set and processing continues with the next
(sibling) element. This does not influence any other handler set.</p>

    <h2><a name="SECTid0xc18290">SEE ALSO</a></h2><p class="seealso">
<a href="expatapi.html">expatapi</a>, <a href="tdomcmd.html">tdom</a>
</p>

    <h2><a name="SECTid0xc18650">KEYWORDS</a></h2><p class="keywords"><a class="keyword" href="keyword-index.html#KW-SAX">SAX</a></p>
  </div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>

Changes to doc/expat.n.

710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
\&\fR
.RS
.PP
Sets configuration options for the parser. Every command
option, except \fI-namespace\fR can be set or modified with this method.
.RE
.TP
\&\fB\fBparser\fP \fBcget \fI?-handlerset name? option\fB\fP
\&\fR
.RS
.PP
Return the current configuration value option for the
parser.
.PP
If the -handlerset option is used, the configuration for the







|







710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
\&\fR
.RS
.PP
Sets configuration options for the parser. Every command
option, except \fI-namespace\fR can be set or modified with this method.
.RE
.TP
\&\fB\fBparser\fP \fBcget\fP \fI?-handlerset name? option\fB
\&\fR
.RS
.PP
Return the current configuration value option for the
parser.
.PP
If the -handlerset option is used, the configuration for the

Changes to doc/expatapi.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: expatapi</title><meta name="xsl-processor" content="Jochen Loewer et. al. (loewerj@hotmail.com)"><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTnode8831">NAME</a> · <a href="#SECTnode8840">SYNOPSIS</a> · <a href="#SECTnode8918">ARGUMENTS</a> · <a href="#SECTnode8999">DESCRIPTION</a> · <a href="#SECTnode9184">SEE ALSO</a> · <a href="#SECTnode9190">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTnode8831">NAME</a></h2><p class="namesection">
<b class="names">CheckExpatParserObj, CHandlerSetInstall, CHandlerSetRemove,
         CHandlerSetCreate, CHandlerSetGetUserData, GetExpatInfo - </b><br>Functions to create, install and remove expat parser object
extensions.</p>
  <h2><a name="SECTnode8840">SYNOPSIS</a></h2><pre class="syntax">#include &lt;tclexpat.h&gt;

int 
<b class="fun">CheckExpatParserObj</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-nameObj"><i>nameObj</i></a>)  

int
<b class="fun">CHandlerSetInstall</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>, <a href="#ARG-handlerSet"><i>handlerSet</i></a>)



|



|


|



|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: expatapi</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xc45810">NAME</a> · <a href="#SECTid0xb350c0">SYNOPSIS</a> · <a href="#SECTid0xbdd020">ARGUMENTS</a> · <a href="#SECTid0xc55490">DESCRIPTION</a> · <a href="#SECTid0xc5b130">SEE ALSO</a> · <a href="#SECTid0xc5b3d0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0xc45810">NAME</a></h2><p class="namesection">
<b class="names">CheckExpatParserObj, CHandlerSetInstall, CHandlerSetRemove,
         CHandlerSetCreate, CHandlerSetGetUserData, GetExpatInfo - </b><br>Functions to create, install and remove expat parser object
extensions.</p>
  <h2><a name="SECTid0xb350c0">SYNOPSIS</a></h2><pre class="syntax">#include &lt;tclexpat.h&gt;

int 
<b class="fun">CheckExpatParserObj</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-nameObj"><i>nameObj</i></a>)  

int
<b class="fun">CHandlerSetInstall</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>, <a href="#ARG-handlerSet"><i>handlerSet</i></a>)

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void*
<b class="fun">CHandlerSetGetUserData</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>, <a href="#ARG-handlerSetName"><i>handlerSetName</i></a>)

TclGenExpatInfo*
<b class="fun">GetExpatInfo</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>)
</pre>

  <h2><a name="SECTnode8918">ARGUMENTS</a></h2><div class="arglist"><table width="100%" rules="none" cellpadding="5%">
<thead><tr class="heading">
<th width="20%">Type</th><th width="70%">Name</th><th width="10%">Mode</th>
</tr></thead><tr class="syntax">
<td class="type" width="20%" align="left">Tcl_Interp</td><td class="name" width="70%" align="left"><a name="ARG-interp">*interp</a></td><td class="mode" width="10%" align="center">in</td>
</tr><tr class="desc">
<td class="padding" width="20%"> </td><td class="argdesc" width="80%" align="left" colspan="2">Interpreter with the expat parser object.</td>
</tr><tr class="syntax">







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void*
<b class="fun">CHandlerSetGetUserData</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>, <a href="#ARG-handlerSetName"><i>handlerSetName</i></a>)

TclGenExpatInfo*
<b class="fun">GetExpatInfo</b> (<a href="#ARG-interp"><i>interp</i></a>, <a href="#ARG-expatObj"><i>expatObj</i></a>)
</pre>

  <h2><a name="SECTid0xbdd020">ARGUMENTS</a></h2><div class="arglist"><table width="100%" rules="none" cellpadding="5%">
<thead><tr class="heading">
<th width="20%">Type</th><th width="70%">Name</th><th width="10%">Mode</th>
</tr></thead><tr class="syntax">
<td class="type" width="20%" align="left">Tcl_Interp</td><td class="name" width="70%" align="left"><a name="ARG-interp">*interp</a></td><td class="mode" width="10%" align="center">in</td>
</tr><tr class="desc">
<td class="padding" width="20%"> </td><td class="argdesc" width="80%" align="left" colspan="2">Interpreter with the expat parser object.</td>
</tr><tr class="syntax">
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</tr><tr class="syntax">
<td class="type" width="20%" align="left">Tcl_Obj</td><td class="name" width="70%" align="left"><a name="ARG-nameObj">*nameObj</a></td><td class="mode" width="10%" align="center"></td>
</tr><tr class="desc">
<td class="padding" width="20%"> </td><td class="argdesc" width="80%" align="left" colspan="2">A Tcl Object containing the name of a expat parser object</td>
</tr>
</table></div>

  <h2><a name="SECTnode8999">DESCRIPTION</a></h2><p>The functions described in this manual allows to add C level coded event
handler to an tDOM Tcl expat parser objects. A tDOM Tcl expat parser object is
able to have several Tcl scripts and C functions associated with an specific
event. If the event occurs, first the Tcl scripts then the C functions
associated with the event are called in turn.</p><p>A tDOM Tcl expat parser extension is an ordinary Tcl extension and loaded
like every other Tcl extension. It must install at least one new Tcl Level
command, that manipulates a tDOM Tcl expat parser object.</p><p>A C level handler set is a data structure like this:</p><pre class="example">
typedef struct CHandlerSet {







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</tr><tr class="syntax">
<td class="type" width="20%" align="left">Tcl_Obj</td><td class="name" width="70%" align="left"><a name="ARG-nameObj">*nameObj</a></td><td class="mode" width="10%" align="center"></td>
</tr><tr class="desc">
<td class="padding" width="20%"> </td><td class="argdesc" width="80%" align="left" colspan="2">A Tcl Object containing the name of a expat parser object</td>
</tr>
</table></div>

  <h2><a name="SECTid0xc55490">DESCRIPTION</a></h2><p>The functions described in this manual allows to add C level coded event
handler to an tDOM Tcl expat parser objects. A tDOM Tcl expat parser object is
able to have several Tcl scripts and C functions associated with an specific
event. If the event occurs, first the Tcl scripts then the C functions
associated with the event are called in turn.</p><p>A tDOM Tcl expat parser extension is an ordinary Tcl extension and loaded
like every other Tcl extension. It must install at least one new Tcl Level
command, that manipulates a tDOM Tcl expat parser object.</p><p>A C level handler set is a data structure like this:</p><pre class="example">
typedef struct CHandlerSet {
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    XML_NotationDeclHandler          notationcommand;
    /* C func for external entity */
    XML_ExternalEntityRefHandler     externalentitycommand;
    /* C func for unknown encoding */
    XML_UnknownEncodingHandler       unknownencodingcommand;
    /* C func for comments */
    XML_CommentHandler               commentCommand;
    /* C func for &quot;not standalone&quot; docs */
    XML_NotStandaloneHandler         notStandaloneCommand;
    /* C func for CDATA section start */
    XML_StartCdataSectionHandler     startCdataSectionCommand;
    /* C func for CDATA section end */
    XML_EndCdataSectionHandler       endCdataSectionCommand;
    /* C func for !ELEMENT decl's */
    XML_ElementDeclHandler           elementDeclCommand;







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    XML_NotationDeclHandler          notationcommand;
    /* C func for external entity */
    XML_ExternalEntityRefHandler     externalentitycommand;
    /* C func for unknown encoding */
    XML_UnknownEncodingHandler       unknownencodingcommand;
    /* C func for comments */
    XML_CommentHandler               commentCommand;
    /* C func for "not standalone" docs */
    XML_NotStandaloneHandler         notStandaloneCommand;
    /* C func for CDATA section start */
    XML_StartCdataSectionHandler     startCdataSectionCommand;
    /* C func for CDATA section end */
    XML_EndCdataSectionHandler       endCdataSectionCommand;
    /* C func for !ELEMENT decl's */
    XML_ElementDeclHandler           elementDeclCommand;
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    char          *method;
    CHandlerSet   *handlerSet;
    int            methodIndex, result;
    simpleCounter *counter;
    

    static char *exampleMethods[] = {
        &quot;enable&quot;, &quot;getresult&quot;, &quot;remove&quot;,
        NULL
    };
    enum exampleMethod {
        m_enable, m_getresult, m_remove
    };

    if (objc != 3) {
        Tcl_WrongNumArgs (interp, 1, objv, example_usage);
        return TCL_ERROR;
    }

    if (!CheckExpatParserObj (interp, objv[1])) {
        Tcl_SetResult (interp, &quot;First argument has to be a expat parser object&quot;, NULL);
        return TCL_ERROR;
    }
    /* ... */
</pre><p> <i class="m">CHandlerSetGet</i> returns a pointer to the C handler Set referenced
by the name <i class="m">handlerSetName</i> of the parser object
<i class="m">expatObj</i>. <i class="m">expatObj</i> has to be an expat parser object in the
interpreter <i class="m">interp</i>. Returns NULL in case of error.</p><p>
<i class="m">CHandlerSetGetUserData</i> returns a pointer to the userData of the C
handler set referenced by the name <i class="m">handlerSetName</i> of the parser object
<i class="m">expatObj</i>. <i class="m">expatObj</i> has to be an expat parser object in the
interpreter <i class="m">interp</i>. Returns NULL in case of error.</p><p> <i class="m">GetExpatInfo</i> Is a helper function that returns a pointer to the
TclGenExpatInfo structure of the tDOM Tcl expat parser object
<i class="m">expatObj</i>. The <i class="m">expatObj</i> has to be a tDOM Tcl expat parser object
in the interpreter <i class="m">interp</i>. This is most useful, to set the application
status of the parser object.</p><p>See the simple but full functionally example in the extensions/example
dir or the more complex example tnc in the extensions/tnc dir (a simple DTD
validation extension).</p>

  <h2><a name="SECTnode9184">SEE ALSO</a></h2><p class="seealso"><a href="expat.html">expat</a></p>

  <h2><a name="SECTnode9190">KEYWORDS</a></h2><p class="keywords"><a class="keyword" href="keyword-index.html#KW-Chandlerset">C handler set</a></p>
</div><div class="footer">
<hr class="navsep"><!-- footer.html: Standard navigational footer --><div class="navbar" align="center">
	<a class="navaid" href="index.html">Table of Contents</a>
 ·	<a class="navaid" href="category-index.html">Index</a>
 ·	<a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</div>
</body>
</html>







|












|


















|

|
<
|
|
<
<
<



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204

205
206



207
208
209
    char          *method;
    CHandlerSet   *handlerSet;
    int            methodIndex, result;
    simpleCounter *counter;
    

    static char *exampleMethods[] = {
        "enable", "getresult", "remove",
        NULL
    };
    enum exampleMethod {
        m_enable, m_getresult, m_remove
    };

    if (objc != 3) {
        Tcl_WrongNumArgs (interp, 1, objv, example_usage);
        return TCL_ERROR;
    }

    if (!CheckExpatParserObj (interp, objv[1])) {
        Tcl_SetResult (interp, "First argument has to be a expat parser object", NULL);
        return TCL_ERROR;
    }
    /* ... */
</pre><p> <i class="m">CHandlerSetGet</i> returns a pointer to the C handler Set referenced
by the name <i class="m">handlerSetName</i> of the parser object
<i class="m">expatObj</i>. <i class="m">expatObj</i> has to be an expat parser object in the
interpreter <i class="m">interp</i>. Returns NULL in case of error.</p><p>
<i class="m">CHandlerSetGetUserData</i> returns a pointer to the userData of the C
handler set referenced by the name <i class="m">handlerSetName</i> of the parser object
<i class="m">expatObj</i>. <i class="m">expatObj</i> has to be an expat parser object in the
interpreter <i class="m">interp</i>. Returns NULL in case of error.</p><p> <i class="m">GetExpatInfo</i> Is a helper function that returns a pointer to the
TclGenExpatInfo structure of the tDOM Tcl expat parser object
<i class="m">expatObj</i>. The <i class="m">expatObj</i> has to be a tDOM Tcl expat parser object
in the interpreter <i class="m">interp</i>. This is most useful, to set the application
status of the parser object.</p><p>See the simple but full functionally example in the extensions/example
dir or the more complex example tnc in the extensions/tnc dir (a simple DTD
validation extension).</p>

  <h2><a name="SECTid0xc5b130">SEE ALSO</a></h2><p class="seealso">expat</p>

  <h2><a name="SECTid0xc5b3d0">KEYWORDS</a></h2><p class="keywords"><a class="keyword" href="keyword-index.html#KW-Chandlerset">C handler set</a></p>

</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>



</div>
</body>
</html>

Changes to doc/manpage.css.

1
2
3
4
5
6
7
8
9
/*
 * $Id$
 * Author: 	Joe English, <jenglish@flightab.com>
 * Created: 	26 Jun 2000
 * Description:	CSS stylesheet for TCL man pages
 */

HTML {
    background: 	#FFFFFF;

|







1
2
3
4
5
6
7
8
9
/*
 * $Id: manpage.css,v 1.4 2002/06/20 00:44:17 jenglish Exp $
 * Author: 	Joe English, <jenglish@flightab.com>
 * Created: 	26 Jun 2000
 * Description:	CSS stylesheet for TCL man pages
 */

HTML {
    background: 	#FFFFFF;

Changes to doc/tdomcmd.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: tdom</title><meta name="xsl-processor" content="Jochen Loewer et. al. (loewerj@hotmail.com)"><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTnode13446">NAME</a> · <a href="#SECTnode13455">SYNOPSIS</a> · <a href="#SECTnode13461">DESCRIPTION</a> · <a href="#SECTnode13620">SEE ALSO</a> · <a href="#SECTnode13629">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTnode13446">NAME</a></h2><p class="namesection">
<b class="names">tdom - </b><br>tdom is an expat parser object extension to create an in-memory
DOM tree from the input while parsing.</p>


  <h2><a name="SECTnode13455">SYNOPSIS</a></h2><pre class="syntax">package require tdom

set parser [expat]

tdom $parser enable</pre>

  <h2><a name="SECTnode13461">DESCRIPTION</a></h2><p>
<i class="m">tdom</i> adds the C handler set &quot;tdom&quot; to an tcl expat
parser obj. This handler set builds an in-memory DOM tree out of the input,
parsed by the parser. A DOM tree created this way behave exactly like a DOM
tree created by the &quot;dom&quot; command (see there). In fact, tdom is only
another interface to the same functionality; it uses the code behind the
<tt class="samp">dom</tt> code for building the DOM tree.</p><dl class="commandlist">
      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">enable</b>
</dt>



|



|


|




|





|
|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: tdom</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xc4d2c0">NAME</a> · <a href="#SECTid0xc2c530">SYNOPSIS</a> · <a href="#SECTid0xab96a0">DESCRIPTION</a> · <a href="#SECTid0xc571c0">SEE ALSO</a> · <a href="#SECTid0xc57580">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0xc4d2c0">NAME</a></h2><p class="namesection">
<b class="names">tdom - </b><br>tdom is an expat parser object extension to create an in-memory
DOM tree from the input while parsing.</p>


  <h2><a name="SECTid0xc2c530">SYNOPSIS</a></h2><pre class="syntax">package require tdom

set parser [expat]

tdom $parser enable</pre>

  <h2><a name="SECTid0xab96a0">DESCRIPTION</a></h2><p>
<i class="m">tdom</i> adds the C handler set "tdom" to an tcl expat
parser obj. This handler set builds an in-memory DOM tree out of the input,
parsed by the parser. A DOM tree created this way behave exactly like a DOM
tree created by the "dom" command (see there). In fact, tdom is only
another interface to the same functionality; it uses the code behind the
<tt class="samp">dom</tt> code for building the DOM tree.</p><dl class="commandlist">
      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">enable</b>
</dt>

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setResultEncoding</b>
</dt>

        <dd><p>See the method <tt class="samp">setResultEncoding</tt> of the
<b class="cmd"><a href="dom.html">dom</a></b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setStoreLineColumn</b> ?<i class="m">boolean</i>?</dt>

        <dd><p>See the method <tt class="samp">setStoreLineColumn</tt> of the
<b class="cmd"><a href="dom.html">dom</a></b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">remove</b>
</dt>

        <dd><p>Removes the tdom C handler set from the parser
object.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">keepEmpties</b>
</dt>

        <dd><p>See the option <tt class="samp">-keepEmpties</tt> of the <b class="cmd"><a href="dom.html">dom</a></b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setExternalEntityResolver</b> <i class="m">script</i>
</dt>
        <dd></dd>
      

    </dl>

  <h2><a name="SECTnode13620">SEE ALSO</a></h2><p class="seealso">
<a href="dom.html">dom</a>, <a href="expat.html">expat</a>
</p>

  <h2><a name="SECTnode13629">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-SAX">SAX</a>, <a class="keyword" href="keyword-index.html#KW-Chandlerset">C handler set</a>
</p>

</div><div class="footer">
<hr class="navsep"><!-- footer.html: Standard navigational footer --><div class="navbar" align="center">
	<a class="navaid" href="index.html">Table of Contents</a>
 ·	<a class="navaid" href="category-index.html">Index</a>
 ·	<a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</div>
</body>
</html>







|







|
















|











|
<
<

|



<
|
|
<
<
<



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89


90
91
92
93
94

95
96



97
98
99

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setResultEncoding</b>
</dt>

        <dd><p>See the method <tt class="samp">setResultEncoding</tt> of the
<b class="cmd">dom</b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setStoreLineColumn</b> ?<i class="m">boolean</i>?</dt>

        <dd><p>See the method <tt class="samp">setStoreLineColumn</tt> of the
<b class="cmd">dom</b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">remove</b>
</dt>

        <dd><p>Removes the tdom C handler set from the parser
object.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">keepEmpties</b>
</dt>

        <dd><p>See the option <tt class="samp">-keepEmpties</tt> of the <b class="cmd">dom</b> command.</p></dd>
      

      
        <dt>
<b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setExternalEntityResolver</b> <i class="m">script</i>
</dt>
        <dd></dd>
      

    </dl>

  <h2><a name="SECTid0xc571c0">SEE ALSO</a></h2><p class="seealso">dom, expat</p>



  <h2><a name="SECTid0xc57580">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <a class="keyword" href="keyword-index.html#KW-SAX">SAX</a>, <a class="keyword" href="keyword-index.html#KW-Chandlerset">C handler set</a>
</p>


</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>



</div>
</body>
</html>

Changes to doc/tnc.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: tnc</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile$ $Revision$">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid883">NAME</a> · <a href="#SECTid892">SYNOPSIS</a> · <a href="#SECTid898">DESCRIPTION</a> · <a href="#SECTid1068">BUGS</a> · <a href="#SECTid1086">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid883">NAME</a></h2><p class="namesection">
<b class="names">tnc - </b><br>tnc is an expat parser object extension, that validates the XML
stream against the document DTD while parsing.</p>
  
  <h2><a name="SECTid892">SYNOPSIS</a></h2><pre class="syntax">package require tdom
package require tnc

set parser [expat]

tnc $parser enable</pre>

  <h2><a name="SECTid898">DESCRIPTION</a></h2><p>
<i class="m">tnc</i> adds the C handler set "tnc" to a tcl expat parser
obj. This handler set is a simple DTD validator. If the validator detects a
validation error, it sets the interp result, signals error and stops
parsing. There isn't any validation error recovering. As a consequence, only
valid documents are completely parsed.</p><p>This handler set has only three methods:</p><dl class="commandlist">
      
        <dt>


|



|


|



|






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: tnc</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0xc5fad0">NAME</a> · <a href="#SECTid0xc2c040">SYNOPSIS</a> · <a href="#SECTid0xab97c0">DESCRIPTION</a> · <a href="#SECTid0xc57df0">BUGS</a> · <a href="#SECTid0xc58760">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0xc5fad0">NAME</a></h2><p class="namesection">
<b class="names">tnc - </b><br>tnc is an expat parser object extension, that validates the XML
stream against the document DTD while parsing.</p>
  
  <h2><a name="SECTid0xc2c040">SYNOPSIS</a></h2><pre class="syntax">package require tdom
package require tnc

set parser [expat]

tnc $parser enable</pre>

  <h2><a name="SECTid0xab97c0">DESCRIPTION</a></h2><p>
<i class="m">tnc</i> adds the C handler set "tnc" to a tcl expat parser
obj. This handler set is a simple DTD validator. If the validator detects a
validation error, it sets the interp result, signals error and stops
parsing. There isn't any validation error recovering. As a consequence, only
valid documents are completely parsed.</p><p>This handler set has only three methods:</p><dl class="commandlist">
      
        <dt>
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
      

      </dl>
     </dd>
      
    </dl>

  <h2><a name="SECTid1068">BUGS</a></h2><p>The validation error reports could be much more informative and
user-friendly.</p><p>The validator doesn't detect ambiguous content models (see XML
recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't,
but handle such content models right anyhow. Tnc does not; if your DTD has
such ambiguous content models, tnc can not used to validate documents against
such (not completely XML spec compliant) DTDs.</p><p>It isn't possible to validate XML documents with standalone="yes" in the
XML Declaration</p><p>Violations of the validity constraints Proper Group/PE Nesting and
Proper Conditional Section/PE Nesting are not detected. They could only happen
inside a invalid DTD, not in the content of a document.</p>
  <h2><a name="SECTid1086">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-Validation">Validation</a>, <a class="keyword" href="keyword-index.html#KW-DTD">DTD</a>
</p>
  
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Table of Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>







|








|




|



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
      

      </dl>
     </dd>
      
    </dl>

  <h2><a name="SECTid0xc57df0">BUGS</a></h2><p>The validation error reports could be much more informative and
user-friendly.</p><p>The validator doesn't detect ambiguous content models (see XML
recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't,
but handle such content models right anyhow. Tnc does not; if your DTD has
such ambiguous content models, tnc can not used to validate documents against
such (not completely XML spec compliant) DTDs.</p><p>It isn't possible to validate XML documents with standalone="yes" in the
XML Declaration</p><p>Violations of the validity constraints Proper Group/PE Nesting and
Proper Conditional Section/PE Nesting are not detected. They could only happen
inside a invalid DTD, not in the content of a document.</p>
  <h2><a name="SECTid0xc58760">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-Validation">Validation</a>, <a class="keyword" href="keyword-index.html#KW-DTD">DTD</a>
</p>
  
</div><hr class="navsep"><div class="navbar" align="center">
<a class="navaid" href="index.html">Contents</a> · <a class="navaid" href="category-index.html">Index</a> · <a class="navaid" href="keyword-index.html">Keywords</a>
</div>
</body>
</html>

Changes to generic/tcldom.c.

216
217
218
219
220
221
222

223
224
225
226
227
228
229
    "    isComment string                                 \n"
    "    isCDATA string                                   \n"
    "    isPIValue string                                 \n"
    "    isName string                                    \n"
    "    isQName string                                   \n"
    "    isNCName string                                  \n"
    "    isPIName string                                  \n"

;

static char doc_usage[] =
    "Usage domDoc <method> <args>, where method can be:\n"
    "    documentElement ?objVar?                \n"
    "    getElementsByTagName name               \n"
    "    getElementsByTagNameNS uri localname    \n"







>







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
    "    isComment string                                 \n"
    "    isCDATA string                                   \n"
    "    isPIValue string                                 \n"
    "    isName string                                    \n"
    "    isQName string                                   \n"
    "    isNCName string                                  \n"
    "    isPIName string                                  \n"
    "    featureinfo feature                              \n"
;

static char doc_usage[] =
    "Usage domDoc <method> <args>, where method can be:\n"
    "    documentElement ?objVar?                \n"
    "    getElementsByTagName name               \n"
    "    getElementsByTagNameNS uri localname    \n"
5660
5661
5662
5663
5664
5665
5666
























































































5667
5668
5669
5670
5671
5672
5673

    return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1,
                                     0);
#endif

}


























































































/*----------------------------------------------------------------------------
|   tcldom_DomObjCmd
|
\---------------------------------------------------------------------------*/
int tcldom_DomObjCmd (
    ClientData   clientData,







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







5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762

    return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1,
                                     0);
#endif

}

/*----------------------------------------------------------------------------
|   tcldom_featureinfo
|
\---------------------------------------------------------------------------*/
static
int tcldom_featureinfo (
    ClientData  clientData,
    Tcl_Interp *interp,
    int         objc,
    Tcl_Obj    * const objv[]
)
{
    int featureIndex, result;
    
    static CONST84 char *features[] = {
        "expatversion",      "expatmajorversion",  "expatminorversion",
        "expatmicroversion", "dtd",                "ns",
        "unknown",           "tdomalloc",          "lessns",
        NULL
    };
    enum feature {
        o_expatversion,      o_expatmajorversion,  o_expatminorversion,
        o_expatmicroversion, o_dtd,                o_ns,
        o_unknown,           o_tdomalloc,          o_lessns   
    };

    if (Tcl_GetIndexFromObj(interp, objv[1], features, "feature", 0,
                            &featureIndex) != TCL_OK) {
        return TCL_ERROR;
    }

    switch ((enum feature) featureIndex) {
    case o_expatversion:
        SetResult(XML_ExpatVersion());
        break;
    case o_expatmajorversion:
        SetIntResult(XML_MAJOR_VERSION);
        break;
    case o_expatminorversion:
        SetIntResult(XML_MINOR_VERSION);
        break;
    case o_expatmicroversion:
        SetIntResult(XML_MICRO_VERSION);
        break;
    case o_dtd:
#ifdef XML_DTD
        result = 1;
#else
        result = 0;
#endif
        SetBooleanResult(result);
        break;
    case o_ns:
#ifdef XML_NS
        result = 1;
#else
        result = 0;
#endif
        SetBooleanResult(result);
        break;
    case o_unknown:       
#ifdef TDOM_NO_UNKNOWN_CMD
        result = 0;
#else
        result = 1;
#endif
        SetBooleanResult(result);
        break;
    case o_tdomalloc:
#ifdef USE_NORMAL_ALLOCATOR
        result = 0;
#else
        result = 1;
#endif
        SetBooleanResult(result);
        break;
    case o_lessns:
#ifdef TDOM_LESS_NS
        result = 1;
#else
        result = 0;
#endif
        SetBooleanResult(result);
        break;
    }
        return TCL_OK;
        
}

/*----------------------------------------------------------------------------
|   tcldom_DomObjCmd
|
\---------------------------------------------------------------------------*/
int tcldom_DomObjCmd (
    ClientData   clientData,
5686
5687
5688
5689
5690
5691
5692

5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704

5705
5706
5707
5708
5709
5710
5711
    static CONST84 char *domMethods[] = {
        "createDocument",  "createDocumentNS",   "createNodeCmd",
        "parse",           "setResultEncoding",  "setStoreLineColumn",
        "isCharData",      "isName",             "isPIName",
        "isQName",         "isComment",          "isCDATA",
        "isPIValue",       "isNCName",           "createDocumentNode",
        "setNameCheck",    "setTextCheck",       "setObjectCommands",

#ifdef TCL_THREADS
        "attachDocument",  "detachDocument",
#endif
        NULL
    };
    enum domMethod {
        m_createDocument,    m_createDocumentNS,   m_createNodeCmd,
        m_parse,             m_setResultEncoding,  m_setStoreLineColumn,
        m_isCharData,        m_isName,             m_isPIName,
        m_isQName,           m_isComment,          m_isCDATA,
        m_isPIValue,         m_isNCName,           m_createDocumentNode,
        m_setNameCheck,      m_setTextCheck,       m_setObjectCommands

#ifdef TCL_THREADS
        ,m_attachDocument,   m_detachDocument
#endif
    };

    static CONST84 char *nodeModeValues[] = {
        "automatic", "command", "token", NULL







>











|
>







5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
    static CONST84 char *domMethods[] = {
        "createDocument",  "createDocumentNS",   "createNodeCmd",
        "parse",           "setResultEncoding",  "setStoreLineColumn",
        "isCharData",      "isName",             "isPIName",
        "isQName",         "isComment",          "isCDATA",
        "isPIValue",       "isNCName",           "createDocumentNode",
        "setNameCheck",    "setTextCheck",       "setObjectCommands",
        "featureinfo",
#ifdef TCL_THREADS
        "attachDocument",  "detachDocument",
#endif
        NULL
    };
    enum domMethod {
        m_createDocument,    m_createDocumentNS,   m_createNodeCmd,
        m_parse,             m_setResultEncoding,  m_setStoreLineColumn,
        m_isCharData,        m_isName,             m_isPIName,
        m_isQName,           m_isComment,          m_isCDATA,
        m_isPIValue,         m_isNCName,           m_createDocumentNode,
        m_setNameCheck,      m_setTextCheck,       m_setObjectCommands,
        m_featureinfo
#ifdef TCL_THREADS
        ,m_attachDocument,   m_detachDocument
#endif
    };

    static CONST84 char *nodeModeValues[] = {
        "automatic", "command", "token", NULL
5922
5923
5924
5925
5926
5927
5928



5929
5930
5931
5932
5933
5934
5935
            return TCL_OK;
            
        case m_isNCName:
            CheckArgs(3,3,2,"string");
            SetBooleanResult(domIsNCNAME(Tcl_GetString(objv[2])));
            return TCL_OK;




    }
    SetResult( dom_usage);
    return TCL_ERROR;
}

#ifdef TCL_THREADS








>
>
>







6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
            return TCL_OK;
            
        case m_isNCName:
            CheckArgs(3,3,2,"string");
            SetBooleanResult(domIsNCNAME(Tcl_GetString(objv[2])));
            return TCL_OK;

        case m_featureinfo:
            CheckArgs(3,3,2,"feature")
            return tcldom_featureinfo(clientData, interp, --objc, objv+1);
    }
    SetResult( dom_usage);
    return TCL_ERROR;
}

#ifdef TCL_THREADS

Changes to tests/dom.test.

9
10
11
12
13
14
15

16
17
18
19
20
21
22
#    dom-4.*:  parse -useForeignDTD
#    dom-5.*:  external entities
#    dom-6.*:  use in slave interpreter
#    dom-7.*:  setNameCheck, setTextCheck
#    dom-8.*:  createDocumentNode, documentNodes
#    dom-9.*:  setObjectCommands
#    dom-10.*: createNodeCmd

#
# Copyright (c) 2002, 2003, 2004 Rolf Ade.

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

test dom-1.1 {createDocument with root node name not a XML Name} {
    list [catch {dom createDocument "root node"} msg] $msg







>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#    dom-4.*:  parse -useForeignDTD
#    dom-5.*:  external entities
#    dom-6.*:  use in slave interpreter
#    dom-7.*:  setNameCheck, setTextCheck
#    dom-8.*:  createDocumentNode, documentNodes
#    dom-9.*:  setObjectCommands
#    dom-10.*: createNodeCmd
#    dom-11.*: featureinfo
#
# Copyright (c) 2002, 2003, 2004 Rolf Ade.

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

test dom-1.1 {createDocument with root node name not a XML Name} {
    list [catch {dom createDocument "root node"} msg] $msg
1293
1294
1295
1296
1297
1298
1299
















1300
1301
1302
1303
        nodeCmds::e1 {
            nodeCmds::t "Some text"
        }} errMsg]
    lappend result $errMsg
} {{<docRoot><e1>Some text</e1></docRoot>} 1 {called outside domNode context}}

namespace delete nodeCmds

















# cleanup
::tcltest::cleanupTests
return







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




1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
        nodeCmds::e1 {
            nodeCmds::t "Some text"
        }} errMsg]
    lappend result $errMsg
} {{<docRoot><e1>Some text</e1></docRoot>} 1 {called outside domNode context}}

namespace delete nodeCmds

test dom-11.1 {featureinfo - expatversion} -body {
    dom featureinfo expatversion
} -match regexp -result {expat_.*}

test dom-11.2 {featureinfo - invalid arg} -body {
    catch {dom featureinfo foo} errMsg
} -result 1

test dom-11.3 {featureinfo - expatmajorversion} -body {
    dom featureinfo expatmajorversion
} -match regexp -result {(1|2)}

test dom-11.4 {featureinfo - dtd} -body {
    dom featureinfo dtd
} -match regexp -result {(0|1)}

# cleanup
::tcltest::cleanupTests
return