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

Overview
Comment:Regenerate doc.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b2e58e052fad7ccd68f8d09788470997d9cfcb7d09c25978d04791d7f59e03ec
User & Date: rolf 2024-09-28 00:20:48
Context
2024-09-30
20:45
With Tcl 9 now even on windows (worded already on LP64 platforms) a single text node in an XML source may be longer than 2 GByte. check-in: c219a15f48 user: rolf tags: trunk
2024-09-28
00:47
Started. check-in: 31dfe23093 user: rolf tags: prepare-release
00:20
Regenerate doc. check-in: b2e58e052f user: rolf tags: trunk
2024-09-27
23:50
Updated tclconfig. check-in: a5598e460d user: rolf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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: tmml-html.xsl,v $ $Revision: 1.11 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea0eccd0">NAME</a> · <a href="#SECTid0x5607ea120250">SYNOPSIS</a> · <a href="#SECTid0x5607ea120850">DESCRIPTION </a> · <a href="#SECTid0x5607ea09d0c0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x5607ea0eccd0">NAME</a></h2><p class="namesection">
<b class="names">dom - </b><br>Create an in-memory DOM tree from XML</p>
  
  <h2><a name="SECTid0x5607ea120250">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="SECTid0x5607ea120850">DESCRIPTION </a></h2><p>This command provides the creation of DOM trees in memory. In
the usual case a string containing a XML information is parsed and converted
into a DOM tree. Other possible parse input may be HTML or JSON.
The <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






|


|


|



|







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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a8a45a40">NAME</a> · <a href="#SECTid0x55a5a8a637a0">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a3edf0">DESCRIPTION </a> · <a href="#SECTid0x55a5a8a61600">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a5a8a45a40">NAME</a></h2><p class="namesection">
<b class="names">dom - </b><br>Create an in-memory DOM tree from XML</p>
  
  <h2><a name="SECTid0x55a5a8a637a0">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="SECTid0x55a5a8a3edf0">DESCRIPTION </a></h2><p>This command provides the creation of DOM trees in memory. In
the usual case a string containing a XML information is parsed and converted
into a DOM tree. Other possible parse input may be HTML or JSON.
The <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
157
158
159
160
161
162
163
164


165

166
167
168
169
170
171
172
173
                2000. The option -jsonmaxnesting allows the user to
                adjust that.</dd>
              
              
              
                <dt><b>--</b></dt> 
                <dd>The option <i class="m">--</i> marks the end of options.
                While respected in general this option is only needed


                in case of parsing JSON data, which may start with a

                "-".</dd>
              

              
                <dt><b>-keepEmpties</b></dt> 
                <dd>If <i class="m">-keepEmpties</i> is
specified then text nodes which contain only whitespaces will be part of the
resulting DOM tree. In default case (<i class="m">-keepEmpties</i> not given) those empty







|
>
>
|
>
|







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
                2000. The option -jsonmaxnesting allows the user to
                adjust that.</dd>
              
              
              
                <dt><b>--</b></dt> 
                <dd>The option <i class="m">--</i> marks the end of options.
                To give this option isn't strictly necessary even in
                the case of JSON parsing, for which valid data may
                start with a "-". If parsing json and if the second to
                last or last argument start with a "-" and isn't a
                known option name it will be treated as JSON
                data.</dd>
              

              
                <dt><b>-keepEmpties</b></dt> 
                <dd>If <i class="m">-keepEmpties</i> is
specified then text nodes which contain only whitespaces will be part of the
resulting DOM tree. In default case (<i class="m">-keepEmpties</i> not given) those empty
406
407
408
409
410
411
412
413
414
415


416
417














418
419
420
421
422
423
424
document element to create. The <i class="m">objVar</i> controls the
memory handling as explained above.</dd>
        

        
          <dt>
<b class="cmd">dom</b> <b class="method">createDocumentNode</b>
?<i class="m">objVar</i>?</dt>
          <dd>Creates a new 'empty' DOM document object without any element
node. <i class="m">objVar</i> controls the memory handling as explained above.</dd>


        















        
          <dt>
<b class="cmd">dom</b> <b class="method">createNodeCmd</b>
<i class="m">?-returnNodeCmd?</i> <i class="m">?-tagName name?</i> <i class="m">?-jsonType jsonType?</i> <i class="m">?-namespace URI?</i> <i class="m">(element|comment|text|cdata|pi)Node</i> <i class="m">commandName</i>
</dt>
          <dd>This method creates Tcl commands, which in turn create
          tDOM nodes. Tcl commands created by this command are only







|
|
|
>
>


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







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
document element to create. The <i class="m">objVar</i> controls the
memory handling as explained above.</dd>
        

        
          <dt>
<b class="cmd">dom</b> <b class="method">createDocumentNode</b>
?<i class="m">-jsonType jsonType</i>? ?<i class="m">objVar</i>?</dt>
          <dd>Creates a new 'empty' DOM document object without any
          element node. <i class="m">objVar</i> controls the memory handling as
          explained above. If the option -jsonType is given the
          created document node will be of the given JSON type.</dd>
        

        
        <dt>
<b class="cmd">dom</b> <b class="method">createFromTypedList</b> <i class="m">typedList</i> ?<i class="m">objVar</i>?</dt>
          <dd>
<p>Creates a new DOM document from the argument <i class="m">typedList</i>.
          The <i class="m">objVar</i> argument controls the memory handling as
          explained above.</p>

          <p>The <i class="m">typedList</i> argument must be a Tcl list and must
          follow the format of the output of the document command
          method <i class="m">asTypedList</i>, see there.</p>
</dd>
        
        
        
          <dt>
<b class="cmd">dom</b> <b class="method">createNodeCmd</b>
<i class="m">?-returnNodeCmd?</i> <i class="m">?-tagName name?</i> <i class="m">?-jsonType jsonType?</i> <i class="m">?-namespace URI?</i> <i class="m">(element|comment|text|cdata|pi)Node</i> <i class="m">commandName</i>
</dt>
          <dd>This method creates Tcl commands, which in turn create
          tDOM nodes. Tcl commands created by this command are only
484
485
486
487
488
489
490
491
492




493
494
495
496
497
498
499

<p>If the first argument of the method is <i class="m">textNode</i>, the command
will create a text node. If the <i class="m">-jsonType</i> option was given then
the created text node will have that JSON type. The syntax of the
created command is:</p>

<pre class="syntax">
<b class="cmd">textNodeCmd</b> ?-disableOutputEscaping? <i class="m">data</i>
</pre>





<p>If the optional flag <i class="m">-disableOutputEscaping</i> is given, the
escaping of the ampersand character (&amp;) and the left angle bracket (&lt;)
inside the data is disabled. You should use this flag carefully.</p>

<p>If the first argument of the method is <i class="m">commentNode</i> or 
<i class="m">cdataNode</i> the command will create an comment node or CDATA section 







|

>
>
>
>







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522

<p>If the first argument of the method is <i class="m">textNode</i>, the command
will create a text node. If the <i class="m">-jsonType</i> option was given then
the created text node will have that JSON type. The syntax of the
created command is:</p>

<pre class="syntax">
<b class="cmd">textNodeCmd</b> ?-disableOutputEscaping? <i class="m">?data?</i>
</pre>

<p>If the json type of the created text node is NULL, TRUE or FALSE
then the <i class="m">data</i> argument is optional, otherwise it this argument
must be given.</p>

<p>If the optional flag <i class="m">-disableOutputEscaping</i> is given, the
escaping of the ampersand character (&amp;) and the left angle bracket (&lt;)
inside the data is disabled. You should use this flag carefully.</p>

<p>If the first argument of the method is <i class="m">commentNode</i> or 
<i class="m">cdataNode</i> the command will create an comment node or CDATA section 
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
                    are build in.</dd>
                
            </dl>
            </dd>   
        
    </dl>

<h2><a name="SECTid0x5607ea09d0c0">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|







806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
                    are build in.</dd>
                
            </dl>
            </dd>   
        
    </dl>

<h2><a name="SECTid0x55a5a8a61600">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

Changes to doc/dom.n.

307
308
309
310
311
312
313
314

315
316


317
318
319
320
321
322
323
In order to avoid using excess stack space, any JSON
input that has more than a certain levels of nesting
is considered invalid. The default maximum nesting is
2000. The option -jsonmaxnesting allows the user to
adjust that.
.IP "\fB--\fR"
The option \fI--\fR marks the end of options.
While respected in general this option is only needed

in case of parsing JSON data, which may start with a
"-".


.IP "\fB-keepEmpties\fR"
If \fI-keepEmpties\fR is
specified then text nodes which contain only whitespaces will be part of the
resulting DOM tree. In default case (\fI-keepEmpties\fR not given) those empty
text nodes are removed at parsing time.
.IP "\fB-keepCDATA\fR"
If \fI-keepCDATA\fR is







|
>
|
|
>
>







307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
In order to avoid using excess stack space, any JSON
input that has more than a certain levels of nesting
is considered invalid. The default maximum nesting is
2000. The option -jsonmaxnesting allows the user to
adjust that.
.IP "\fB--\fR"
The option \fI--\fR marks the end of options.
To give this option isn't strictly necessary even in
the case of JSON parsing, for which valid data may
start with a "-". If parsing json and if the second to
last or last argument start with a "-" and isn't a
known option name it will be treated as JSON
data.
.IP "\fB-keepEmpties\fR"
If \fI-keepEmpties\fR is
specified then text nodes which contain only whitespaces will be part of the
resulting DOM tree. In default case (\fI-keepEmpties\fR not given) those empty
text nodes are removed at parsing time.
.IP "\fB-keepCDATA\fR"
If \fI-keepCDATA\fR is
481
482
483
484
485
486
487
488
489
490















491
492
493
494
495
496
497
.TP
\&\fB\fBdom\fP \fBcreateDocumentNS\fP \fIuri\fB \fIdocElemName\fB ?\fIobjVar\fB?
\&\fRCreates a new DOM document object with one element node with
node name \fIdocElemName\fR. \fIUri\fR gives the namespace of the
document element to create. The \fIobjVar\fR controls the
memory handling as explained above.
.TP
\&\fB\fBdom\fP \fBcreateDocumentNode\fP ?\fIobjVar\fB?
\&\fRCreates a new 'empty' DOM document object without any element
node. \fIobjVar\fR controls the memory handling as explained above.















.TP
\&\fB\fBdom\fP \fBcreateNodeCmd\fP \fI?-returnNodeCmd?\fB \fI?-tagName name?\fB \fI?-jsonType jsonType?\fB \fI?-namespace URI?\fB \fI(element|comment|text|cdata|pi)Node\fB \fIcommandName\fB
\&\fRThis method creates Tcl commands, which in turn create
tDOM nodes. Tcl commands created by this command are only
available inside a script given to the domNode methods
\&\fIappendFromScript\fR or \fIinsertBeforeFromScript\fR. If
a command created with \fIcreateNodeCmd\fR is invoked in







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







484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
.TP
\&\fB\fBdom\fP \fBcreateDocumentNS\fP \fIuri\fB \fIdocElemName\fB ?\fIobjVar\fB?
\&\fRCreates a new DOM document object with one element node with
node name \fIdocElemName\fR. \fIUri\fR gives the namespace of the
document element to create. The \fIobjVar\fR controls the
memory handling as explained above.
.TP
\&\fB\fBdom\fP \fBcreateDocumentNode\fP ?\fI-jsonType jsonType\fB? ?\fIobjVar\fB?
\&\fRCreates a new 'empty' DOM document object without any
element node. \fIobjVar\fR controls the memory handling as
explained above. If the option -jsonType is given the
created document node will be of the given JSON type.
.TP
\&\fB\fBdom\fP \fBcreateFromTypedList\fP \fItypedList\fB ?\fIobjVar\fB?
\&\fR
.RS
.PP
Creates a new DOM document from the argument \fItypedList\fR.
The \fIobjVar\fR argument controls the memory handling as
explained above.
.PP
The \fItypedList\fR argument must be a Tcl list and must
follow the format of the output of the document command
method \fIasTypedList\fR, see there.
.RE
.TP
\&\fB\fBdom\fP \fBcreateNodeCmd\fP \fI?-returnNodeCmd?\fB \fI?-tagName name?\fB \fI?-jsonType jsonType?\fB \fI?-namespace URI?\fB \fI(element|comment|text|cdata|pi)Node\fB \fIcommandName\fB
\&\fRThis method creates Tcl commands, which in turn create
tDOM nodes. Tcl commands created by this command are only
available inside a script given to the domNode methods
\&\fIappendFromScript\fR or \fIinsertBeforeFromScript\fR. If
a command created with \fIcreateNodeCmd\fR is invoked in
562
563
564
565
566
567
568
569
570
571




572
573
574
575
576
577
578
the created text node will have that JSON type. The syntax of the
created command is:



.CS

\&\fBtextNodeCmd\fP ?-disableOutputEscaping? \fIdata\fR

.CE




.PP
If the optional flag \fI-disableOutputEscaping\fR is given, the
escaping of the ampersand character (&) and the left angle bracket (<)
inside the data is disabled. You should use this flag carefully.
.PP
If the first argument of the method is \fIcommentNode\fR or
\&\fIcdataNode\fR the command will create an comment node or CDATA section







|


>
>
>
>







580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
the created text node will have that JSON type. The syntax of the
created command is:



.CS

\&\fBtextNodeCmd\fP ?-disableOutputEscaping? \fI?data?\fR

.CE
.PP
If the json type of the created text node is NULL, TRUE or FALSE
then the \fIdata\fR argument is optional, otherwise it this argument
must be given.
.PP
If the optional flag \fI-disableOutputEscaping\fR is given, the
escaping of the ampersand character (&) and the left angle bracket (<)
inside the data is disabled. You should use this flag carefully.
.PP
If the first argument of the method is \fIcommentNode\fR or
\&\fIcdataNode\fR the command will create an comment node or CDATA section

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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a7f548c2f0">NAME</a> · <a href="#SECTid0x55a7f54b52a0">SYNOPSIS</a> · <a href="#SECTid0x55a7f54b5700"> DESCRIPTION </a> · <a href="#SECTid0x55a7f54a8d60">SEE ALSO</a> · <a href="#SECTid0x55a7f5428f40">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a7f548c2f0">NAME</a></h2><p class="namesection">
<b class="names">domNode - </b><br>Manipulates an instance of a DOM node object</p>



  <h2><a name="SECTid0x55a7f54b52a0">SYNOPSIS</a></h2><pre class="syntax"> $nodeObject <i class="m">method</i>  <i class="m">arg arg ...</i>
</pre>
  <h2><a name="SECTid0x55a7f54b5700"> 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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a887ef80">NAME</a> · <a href="#SECTid0x55a5a8a3c5b0">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a638a0"> DESCRIPTION </a> · <a href="#SECTid0x55a5a8a4f8c0">SEE ALSO</a> · <a href="#SECTid0x55a5a8a4fc50">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a5a887ef80">NAME</a></h2><p class="namesection">
<b class="names">domNode - </b><br>Manipulates an instance of a DOM node object</p>



  <h2><a name="SECTid0x55a5a8a3c5b0">SYNOPSIS</a></h2><pre class="syntax"> $nodeObject <i class="m">method</i>  <i class="m">arg arg ...</i>
</pre>
  <h2><a name="SECTid0x55a5a8a638a0"> 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
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
        <dt><i class="m">@attrName</i></dt>
        <dd>Returns the value of the attribute <i class="m">attrName</i>.  Short cut
for <i class="m">getAttribute</i>.</dd>
      

      
        <dt>
<b class="method">jsonType</b> <i class="m">?OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?</i>
</dt>
        <dd>Only element and text nodes may have a JSON type and
        only this types of nodes support the <i class="m">jsonType</i> method;
        the other node types return error if called with this method.
        Returns the jsonType of the node. If the optional argument is
        given, the JSON type of the node is set to the given type and
        returned. Valid type arguments for element nodes are OBJECT,
        ARRAY and NONE. Valid type arguments for text nodes are
        STRING, NUMBER, TRUE, FALSE, NULL and NONE.</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="SECTid0x55a7f54a8d60">SEE ALSO</a></h2><p class="seealso">dom, domDoc</p>
  
  <h2><a name="SECTid0x55a7f5428f40">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|
















|

|








761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
        <dt><i class="m">@attrName</i></dt>
        <dd>Returns the value of the attribute <i class="m">attrName</i>.  Short cut
for <i class="m">getAttribute</i>.</dd>
      

      
        <dt>
<b class="method">jsonType</b> <i class="m">?(OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?</i>
</dt>
        <dd>Only element and text nodes may have a JSON type and
        only this types of nodes support the <i class="m">jsonType</i> method;
        the other node types return error if called with this method.
        Returns the jsonType of the node. If the optional argument is
        given, the JSON type of the node is set to the given type and
        returned. Valid type arguments for element nodes are OBJECT,
        ARRAY and NONE. Valid type arguments for text nodes are
        STRING, NUMBER, TRUE, FALSE, NULL and NONE.</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="SECTid0x55a5a8a4f8c0">SEE ALSO</a></h2><p class="seealso">dom, domDoc</p>
  
  <h2><a name="SECTid0x55a5a8a4fc50">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

Changes to doc/domNode.n.

708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
if given, is set to the empty string.
.RE
.TP
\&\fB\fI@attrName\fB
\&\fRReturns the value of the attribute \fIattrName\fR.  Short cut
for \fIgetAttribute\fR.
.TP
\&\fB\fBjsonType\fP \fI?OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?\fB
\&\fROnly element and text nodes may have a JSON type and
only this types of nodes support the \fIjsonType\fR method;
the other node types return error if called with this method.
Returns the jsonType of the node. If the optional argument is
given, the JSON type of the node is set to the given type and
returned. Valid type arguments for element nodes are OBJECT,
ARRAY and NONE. Valid type arguments for text nodes are







|







708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
if given, is set to the empty string.
.RE
.TP
\&\fB\fI@attrName\fB
\&\fRReturns the value of the attribute \fIattrName\fR.  Short cut
for \fIgetAttribute\fR.
.TP
\&\fB\fBjsonType\fP \fI?(OBJECT|ARRAY|NONE)|(STRING|NUMBER|TRUE|FALSE|NULL|NONE)?\fB
\&\fROnly element and text nodes may have a JSON type and
only this types of nodes support the \fIjsonType\fR method;
the other node types return error if called with this method.
Returns the jsonType of the node. If the optional argument is
given, the JSON type of the node is set to the given type and
returned. Valid type arguments for element nodes are OBJECT,
ARRAY and NONE. Valid type arguments for text nodes are

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
47
<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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea0e6b50">NAME</a> · <a href="#SECTid0x5607ea113710">SYNOPSIS</a> · <a href="#SECTid0x5607ea096f40">DESCRIPTION</a> · <a href="#SECTid0x5607ea0f5a00">COMMAND OPTIONS</a> · <a href="#SECTid0x5607ea11dac0"> COMMAND METHODS </a> · <a href="#SECTid0x5607e9fa88b0">Callback Command Return Codes</a> · <a href="#SECTid0x5607e9fa90b0">SEE ALSO</a> · <a href="#SECTid0x5607e9fa9470">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x5607ea0e6b50">NAME</a></h2><p class="namesection">
<b class="names">expat - </b><br>Creates an instance of an expat parser object</p>



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

<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="SECTid0x5607ea096f40">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 always check for XML well-formedness of the input (and
report error, if the input isn't well-formed). They 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). If you use the -validateCmd
option (see there), the input is additionally validated.</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="SECTid0x5607ea0f5a00">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
47
<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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5587897674b0">NAME</a> · <a href="#SECTid0x5587897a6530">SYNOPSIS</a> · <a href="#SECTid0x558789873440">DESCRIPTION</a> · <a href="#SECTid0x558789874030">COMMAND OPTIONS</a> · <a href="#SECTid0x5587898d0a30"> COMMAND METHODS </a> · <a href="#SECTid0x5587898d8160">Callback Command Return Codes</a> · <a href="#SECTid0x5587898d8cf0">SEE ALSO</a> · <a href="#SECTid0x5587898d90b0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x5587897674b0">NAME</a></h2><p class="namesection">
<b class="names">expat - </b><br>Creates an instance of an expat parser object</p>



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

<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="SECTid0x558789873440">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 always check for XML well-formedness of the input (and
report error, if the input isn't well-formed). They 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). If you use the -validateCmd
option (see there), the input is additionally validated.</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="SECTid0x558789874030">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
135
136
137
138
139
140
141


















142
143
144
145
146
147
148
          callback. If this is done the programm probably will crash
          but also may execute arbitrary code.</p>

          <p>The callback handler installed while this option is on
          will not be traced by executing them. </p>
</dd>
        


















        
        
          <dt>
<b>-elementstartcommand</b> <i>script</i>
</dt>
          








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







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
          callback. If this is done the programm probably will crash
          but also may execute arbitrary code.</p>

          <p>The callback handler installed while this option is on
          will not be traced by executing them. </p>
</dd>
        

        
          <dt>
<b>-keepTextStart</b> <i>boolean</i>
</dt>
          

          <dd><p>By default this option is 0 (off). If this option
          is on then the position information of the start of a text
          or CDATA node is keeped over collecting the sometimes by
          expat delivered cdata pieces. With this option on the
          position information returned by the parser in a
          -characterdatacommand proc will be correct, otherwise not.
          Called in all other handler code the parser always return
          the correct position results, no matter what value this
          option have. It is off by default because it is rarely
          needed and saves a few cpu cyles this way.</p></dd>
        
        
        
          <dt>
<b>-elementstartcommand</b> <i>script</i>
</dt>
          

208
209
210
211
212
213
214

215
216
217
218
219
220
221
222
223
224
225
          

          <dd>
<p>Specifies a Tcl command to associate with character data in
the document, ie. text. The actual command consists of this option followed by
one argument: the text.</p>


<p>It is not guaranteed that character data will be passed to the application
in a single call to this command. That is, the application should be prepared
to receive multiple invocations of this callback with no intervening callbacks
from other features.</p>

<p>Example: </p>

<pre class="example">proc HandleText {data} {
    puts stderr "Character data ==&gt; $data"
}








>
|
|
<
<







226
227
228
229
230
231
232
233
234
235


236
237
238
239
240
241
242
          

          <dd>
<p>Specifies a Tcl command to associate with character data in
the document, ie. text. The actual command consists of this option followed by
one argument: the text.</p>

<p>Other than with the C API of the expat parser it is guaranteed that
character data will be passed to the application in a single call to
this command.</p>



<p>Example: </p>

<pre class="example">proc HandleText {data} {
    puts stderr "Character data ==&gt; $data"
}

705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
            should never need to use this option, because the
            default value (8388608) should work for any real data.
            If you ever need to increase this value for non-attack
            payload, please report.</dd>
        

      </dl>
    <h2><a name="SECTid0x5607ea11dac0"> 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>







|







722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
            should never need to use this option, because the
            default value (8388608) should work for any real data.
            If you ever need to increase this value for non-attack
            payload, please report.</dd>
        

      </dl>
    <h2><a name="SECTid0x5587898d0a30"> 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>
787
788
789
790
791
792
793

794
795




796
797
798
799
800

801
802




803
804
805
806
807

808
809




810
811
812
813
814

815
816




817
818
819
820
821
822
823
attribute/value pair counts as 2; thus this corresponds to an index into the
attributes list passed to the elementstartcommand.</p></dd>
              
              
              
                <dt><b>-currentbytecount</b></dt>


                <dd><p>Return the number of bytes in the current event.
Returns 0 if the event is in an internal entity.</p></dd>




              

              
                <dt><b>-currentlinenumber</b></dt>


                <dd><p> Returns the line number of the current parse
location.</p></dd>




              

              
                <dt><b>-currentcolumnnumber</b></dt>


                <dd><p> Returns the column number of the current parse
location.</p></dd>




              

              
                <dt><b>-currentbyteindex</b></dt>


                <dd><p> Returns the byte index of the current parse
location.</p></dd>




              
            </dl>
<p>Only one value may be requested at a time.</p>
</dd>
        

        







>
|
|
>
>
>
>





>
|
|
>
>
>
>





>
|
|
>
>
>
>





>
|
|
>
>
>
>







804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
attribute/value pair counts as 2; thus this corresponds to an index into the
attributes list passed to the elementstartcommand.</p></dd>
              
              
              
                <dt><b>-currentbytecount</b></dt>

                <dd>
<p>Return the number of bytes in the current event.
                Returns 0 if the event is in an internal entity.</p>

                <p>If you use this option consider if you may need the
                parser option <i class="m">-keepTextStart</i>.</p>
                </dd>
              

              
                <dt><b>-currentlinenumber</b></dt>

                <dd>
<p> Returns the line number of the current parse
                location.</p>

                <p>If you use this option consider if you may need the
                parser option <i class="m">-keepTextStart</i>.</p>
                </dd>
              

              
                <dt><b>-currentcolumnnumber</b></dt>

                <dd>
<p> Returns the column number of the current
                parse location.</p>

                <p>If you use this option consider if you may need the
                parser option <i class="m">-keepTextStart</i>.</p>
                </dd>
              

              
                <dt><b>-currentbyteindex</b></dt>

                <dd>
<p> Returns the byte index of the current parse
                location.</p>

                <p>If you use this option consider if you may need the
                parser option <i class="m">-keepTextStart</i>.</p>
                </dd>
              
            </dl>
<p>Only one value may be requested at a time.</p>
</dd>
        

        
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
          <dd><p>Resets the parser in preparation for parsing another
document. A parser cannot be reset 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="SECTid0x5607e9fa88b0">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><p>If a callback script returns a "return" error
code then parsing is canceled altogether, but no error is raised.</p>

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

    <h2><a name="SECTid0x5607e9fa9470">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-SAX">SAX</a>, <a class="keyword" href="keyword-index.html#KW-push">push</a>, <a class="keyword" href="keyword-index.html#KW-pushparser">pushparser</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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|













|



|







902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
          <dd><p>Resets the parser in preparation for parsing another
document. A parser cannot be reset 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="SECTid0x5587898d8160">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><p>If a callback script returns a "return" error
code then parsing is canceled altogether, but no error is raised.</p>

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

    <h2><a name="SECTid0x5587898d90b0">KEYWORDS</a></h2><p class="keywords">
<a class="keyword" href="keyword-index.html#KW-SAX">SAX</a>, <a class="keyword" href="keyword-index.html#KW-push">push</a>, <a class="keyword" href="keyword-index.html#KW-pushparser">pushparser</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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

Changes to doc/expat.n.

268
269
270
271
272
273
274














275
276
277
278
279
280
281
must not be removed or re-defined as long as it is used as
callback. If this is done the programm probably will crash
but also may execute arbitrary code.
.PP
The callback handler installed while this option is on
will not be traced by executing them.
.RE














.IP "\fB-elementstartcommand  \fIscript\fP\fR"
.RS
.PP
Specifies a Tcl command to associate with the start tag of
an element. The actual command consists of this option followed by at least two
arguments: the element type name and the attribute list.
.PP







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







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
must not be removed or re-defined as long as it is used as
callback. If this is done the programm probably will crash
but also may execute arbitrary code.
.PP
The callback handler installed while this option is on
will not be traced by executing them.
.RE
.IP "\fB-keepTextStart  \fIboolean\fP\fR"
.RS
.PP
By default this option is 0 (off). If this option
is on then the position information of the start of a text
or CDATA node is keeped over collecting the sometimes by
expat delivered cdata pieces. With this option on the
position information returned by the parser in a
-characterdatacommand proc will be correct, otherwise not.
Called in all other handler code the parser always return
the correct position results, no matter what value this
option have. It is off by default because it is rarely
needed and saves a few cpu cyles this way.
.RE
.IP "\fB-elementstartcommand  \fIscript\fP\fR"
.RS
.PP
Specifies a Tcl command to associate with the start tag of
an element. The actual command consists of this option followed by at least two
arguments: the element type name and the attribute list.
.PP
339
340
341
342
343
344
345

346
347
348
349
350
351
352
353
354
355
356
.IP "\fB-characterdatacommand  \fIscript\fP\fR"
.RS
.PP
Specifies a Tcl command to associate with character data in
the document, ie. text. The actual command consists of this option followed by
one argument: the text.
.PP

It is not guaranteed that character data will be passed to the application
in a single call to this command. That is, the application should be prepared
to receive multiple invocations of this callback with no intervening callbacks
from other features.
.PP
Example:



.CS
proc HandleText {data} {







>
|
|
<
<







353
354
355
356
357
358
359
360
361
362


363
364
365
366
367
368
369
.IP "\fB-characterdatacommand  \fIscript\fP\fR"
.RS
.PP
Specifies a Tcl command to associate with character data in
the document, ie. text. The actual command consists of this option followed by
one argument: the text.
.PP
Other than with the C API of the expat parser it is guaranteed that
character data will be passed to the application in a single call to
this command.


.PP
Example:



.CS
proc HandleText {data} {
848
849
850
851
852
853
854



855
856
857
858
859
860



861
862
863
864
865
866



867
868
869
870
871
872



873
874
875
876
877
878
879
attributes list passed to the elementstartcommand.
.RE
.IP "\fB-currentbytecount\fR"
.RS
.PP
Return the number of bytes in the current event.
Returns 0 if the event is in an internal entity.



.RE
.IP "\fB-currentlinenumber\fR"
.RS
.PP
Returns the line number of the current parse
location.



.RE
.IP "\fB-currentcolumnnumber\fR"
.RS
.PP
Returns the column number of the current parse
location.



.RE
.IP "\fB-currentbyteindex\fR"
.RS
.PP
Returns the byte index of the current parse
location.



.RE
.PP
Only one value may be requested at a time.
.RE
.TP
\&\fB\fBparser\fP \fBparse\fP \fIdata\fB
\&\fR







>
>
>






>
>
>




|
|
>
>
>






>
>
>







861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
attributes list passed to the elementstartcommand.
.RE
.IP "\fB-currentbytecount\fR"
.RS
.PP
Return the number of bytes in the current event.
Returns 0 if the event is in an internal entity.
.PP
If you use this option consider if you may need the
parser option \fI-keepTextStart\fR.
.RE
.IP "\fB-currentlinenumber\fR"
.RS
.PP
Returns the line number of the current parse
location.
.PP
If you use this option consider if you may need the
parser option \fI-keepTextStart\fR.
.RE
.IP "\fB-currentcolumnnumber\fR"
.RS
.PP
Returns the column number of the current
parse location.
.PP
If you use this option consider if you may need the
parser option \fI-keepTextStart\fR.
.RE
.IP "\fB-currentbyteindex\fR"
.RS
.PP
Returns the byte index of the current parse
location.
.PP
If you use this option consider if you may need the
parser option \fI-keepTextStart\fR.
.RE
.PP
Only one value may be requested at a time.
.RE
.TP
\&\fB\fBparser\fP \fBparse\fP \fIdata\fB
\&\fR

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 (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea0e36a0">NAME</a> · <a href="#SECTid0x5607ea0968a0">SYNOPSIS</a> · <a href="#SECTid0x5607ea0ad2b0">ARGUMENTS</a> · <a href="#SECTid0x5607ea110ac0">DESCRIPTION</a> · <a href="#SECTid0x5607ea113650">SEE ALSO</a> · <a href="#SECTid0x5607ea113890">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x5607ea0e36a0">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="SECTid0x5607ea0968a0">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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a8a3c780">NAME</a> · <a href="#SECTid0x55a5a8a5a8e0">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a6bbc0">ARGUMENTS</a> · <a href="#SECTid0x55a5a89eae50">DESCRIPTION</a> · <a href="#SECTid0x55a5a8a75cd0">SEE ALSO</a> · <a href="#SECTid0x55a5a8a465f0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x55a5a8a3c780">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="SECTid0x55a5a8a5a8e0">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="SECTid0x5607ea0ad2b0">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="SECTid0x55a5a8a6bbc0">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="SECTid0x5607ea110ac0">DESCRIPTION</a></h2><p>The functions described in this manual allows one 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 a 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="SECTid0x55a5a89eae50">DESCRIPTION</a></h2><p>The functions described in this manual allows one 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 a 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 {
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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="SECTid0x5607ea113650">SEE ALSO</a></h2><p class="seealso">expat</p>

  <h2><a name="SECTid0x5607ea113890">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|

|





195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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="SECTid0x55a5a8a75cd0">SEE ALSO</a></h2><p class="seealso">expat</p>

  <h2><a name="SECTid0x55a5a8a465f0">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

Changes to doc/pullparser.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
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: pullparser</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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea0e38c0">NAME</a> · <a href="#SECTid0x5607ea10d0f0">SYNOPSIS</a> · <a href="#SECTid0x5607e9f8a2c0">DESCRIPTION </a> · <a href="#SECTid0x5607ea0a9d30">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x5607ea0e38c0">NAME</a></h2><p class="namesection">
<b class="names">tdom::pullparser - </b><br>Create an XML pull parser command</p>

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

    <b class="cmd">tdom::pullparser</b> <i class="m">cmdName</i>  ? -ignorewhitecdata ? 
    </pre>

  <h2><a name="SECTid0x5607e9f8a2c0">DESCRIPTION </a></h2><p>This command creates XML pull parser commands with a simple
    API, along the lines of a simple StAX parser. After creation,
    you've to set an input source, to do anything useful with the pull
    parser. For this see the methods <i class="m">input</i>, <i class="m">inputchannel</i>
    and <i class="m">inputfile</i>.</p><p>The parser has always a <i class="m">state</i>. You start parsing the XML
    data until some next state, do what has to be done and skip again
    to the next state. XML well-formedness errors along the way will
    be reported as TCL_ERROR with additional info in the error






|


|


|




|







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
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: pullparser</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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a89ecc30">NAME</a> · <a href="#SECTid0x55a5a8a67560">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a67ae0">DESCRIPTION </a> · <a href="#SECTid0x55a5a8a74ca0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a5a89ecc30">NAME</a></h2><p class="namesection">
<b class="names">tdom::pullparser - </b><br>Create an XML pull parser command</p>

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

    <b class="cmd">tdom::pullparser</b> <i class="m">cmdName</i>  ? -ignorewhitecdata ? 
    </pre>

  <h2><a name="SECTid0x55a5a8a67ae0">DESCRIPTION </a></h2><p>This command creates XML pull parser commands with a simple
    API, along the lines of a simple StAX parser. After creation,
    you've to set an input source, to do anything useful with the pull
    parser. For this see the methods <i class="m">input</i>, <i class="m">inputchannel</i>
    and <i class="m">inputfile</i>.</p><p>The parser has always a <i class="m">state</i>. You start parsing the XML
    data until some next state, do what has to be done and skip again
    to the next state. XML well-formedness errors along the way will
    be reported as TCL_ERROR with additional info in the error
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position. Column counting starts
        with 0.</dd>
      
    </dl>

  <h2><a name="SECTid0x5607ea0a9d30">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-pull">pull</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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
        <dd>This method is valid in all parser states except READY
        and TEXT. It returns the offset, from the beginning of the
        current line, of the parsing position. Column counting starts
        with 0.</dd>
      
    </dl>

  <h2><a name="SECTid0x55a5a8a74ca0">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-pull">pull</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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

Changes to doc/schema.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
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: schema</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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607e9fc6db0">NAME</a> · <a href="#SECTid0x5607ea0e0900">SYNOPSIS</a> · <a href="#SECTid0x5607ea107860">DESCRIPTION </a> · <a href="#SECTid0x5607ea10a6e0">Schema definition scripts</a> · <a href="#SECTid0x5607ea0f1310">Quantity specifier</a> · <a href="#SECTid0x5607ea1347b0">Text constraint scripts</a> · <a href="#SECTid0x5607ea12c6c0">Local key constraints</a> · <a href="#SECTid0x5607ea097eb0">Recovering</a> · <a href="#SECTid0x5607ea099af0">Examples</a> · <a href="#SECTid0x5607ea11a850">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x5607e9fc6db0">NAME</a></h2><p class="namesection">
<b class="names">tdom::schema - </b><br>Creates a schema validation command</p>

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

<b class="cmd">tdom::schema</b> <i class="m">?create?</i> <i class="m">cmdName</i>
    </pre>

  <h2><a name="SECTid0x5607ea107860">DESCRIPTION </a></h2><p>Every call of this command creates a new validation command. A
    validation command has methods to define a schema and is able
    to validate XML data or to post-validate a tDOM DOM tree (and to
    some degree other kind of hierarchical data) against this
    schema.</p><p>Also, a validation command may be used as argument to the
    <i class="m">-validateCmd</i> option of the <i class="m">dom parse</i> and the
    <i class="m">expat</i> commands to enable validation additionally to what
    they do otherwise.</p><p>The methods of created commands are:</p><dl class="commandlist">






|


|


|




|







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
<html>
<head>
<link rel="stylesheet" href="manpage.css"><title>tDOM manual: schema</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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a8a90790">NAME</a> · <a href="#SECTid0x55a5a8a58e10">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a634e0">DESCRIPTION </a> · <a href="#SECTid0x55a5a8a31fe0">Schema definition scripts</a> · <a href="#SECTid0x55a5a88fb1d0">Quantity specifier</a> · <a href="#SECTid0x55a5a8a2c0a0">Text constraint scripts</a> · <a href="#SECTid0x55a5a8a04420">Local key constraints</a> · <a href="#SECTid0x55a5a8a65260">Recovering</a> · <a href="#SECTid0x55a5a8a67010">Examples</a> · <a href="#SECTid0x55a5a8a270c0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a5a8a90790">NAME</a></h2><p class="namesection">
<b class="names">tdom::schema - </b><br>Creates a schema validation command</p>

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

<b class="cmd">tdom::schema</b> <i class="m">?create?</i> <i class="m">cmdName</i>
    </pre>

  <h2><a name="SECTid0x55a5a8a634e0">DESCRIPTION </a></h2><p>Every call of this command creates a new validation command. A
    validation command has methods to define a schema and is able
    to validate XML data or to post-validate a tDOM DOM tree (and to
    some degree other kind of hierarchical data) against this
    schema.</p><p>Also, a validation command may be used as argument to the
    <i class="m">-validateCmd</i> option of the <i class="m">dom parse</i> and the
    <i class="m">expat</i> commands to enable validation additionally to what
    they do otherwise.</p><p>The methods of created commands are:</p><dl class="commandlist">
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
            <dt>DOM_KEYCONSTRAINT</dt><dd></dd>
            <dt>DOM_XPATH_BOOLEAN</dt><dd></dd>
            <dt>INVALID_KEYREF</dt><dd></dd>
            <dt>INVALID_VALUE</dt><dd></dd>
            <dt>UNKNOWN_GLOBAL_ID</dt><dd></dd>
            <dt>UNKNOWN_ID</dt><dd></dd>
        </dl>
        <p> For more detailed information see section <a href="#SECTid0x5607ea097eb0">Recovering</a>.</p>
        </dd>
      

      
        <dt><b class="method">delete</b></dt>
        <dd>This method deletes the validation command.</dd>
      







|







343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
            <dt>DOM_KEYCONSTRAINT</dt><dd></dd>
            <dt>DOM_XPATH_BOOLEAN</dt><dd></dd>
            <dt>INVALID_KEYREF</dt><dd></dd>
            <dt>INVALID_VALUE</dt><dd></dd>
            <dt>UNKNOWN_GLOBAL_ID</dt><dd></dd>
            <dt>UNKNOWN_ID</dt><dd></dd>
        </dl>
        <p> For more detailed information see section <a href="#SECTid0x55a5a8a65260">Recovering</a>.</p>
        </dd>
      

      
        <dt><b class="method">delete</b></dt>
        <dd>This method deletes the validation command.</dd>
      
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
        <dt><b class="method">reset</b></dt>
        <dd>This method resets the validation command into state
        READY (while preserving the defined grammar).</dd>
      

    </dl>

  <h2><a name="SECTid0x5607ea10a6e0">Schema definition scripts</a></h2><p>Schema definition scripts are ordinary Tcl scripts evaluated in
    the namespace tdom::schema. The schema definition commands listed
    below in this Tcl namespace allow the definition of a wide variety
    of document structures. Every schema definition command
    establishes a validation constraint on the content which has to
    match or must be optional to qualify the content as valid. It is a
    validation error if there is additional (not matched) content.
    White-space-only text (in the XML sense of white space) between







|







582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
        <dt><b class="method">reset</b></dt>
        <dd>This method resets the validation command into state
        READY (while preserving the defined grammar).</dd>
      

    </dl>

  <h2><a name="SECTid0x55a5a8a31fe0">Schema definition scripts</a></h2><p>Schema definition scripts are ordinary Tcl scripts evaluated in
    the namespace tdom::schema. The schema definition commands listed
    below in this Tcl namespace allow the definition of a wide variety
    of document structures. Every schema definition command
    establishes a validation constraint on the content which has to
    match or must be optional to qualify the content as valid. It is a
    validation error if there is additional (not matched) content.
    White-space-only text (in the XML sense of white space) between
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
        call would. It is meant as top-level command of a <i>schemacmd
        define</i> script. This command is not allowed nested in
        another definition script command and will raise error, if you
        call it there.</dd>
      
    </dl>

  <h2><a name="SECTid0x5607ea0f1310">Quantity specifier</a></h2><p>Several schema definition commands expect a quantifier as
    one of their arguments which determines how often the content
    particle specified by the command is expected. The valid values
    for a <i class="m">quant</i> argument are:</p><dl class="optlist">
      
        <dt><b>!</b></dt>
        <dd>The content particle has to occur exactly once in valid
        documents.</dd>







|







904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
        call would. It is meant as top-level command of a <i>schemacmd
        define</i> script. This command is not allowed nested in
        another definition script command and will raise error, if you
        call it there.</dd>
      
    </dl>

  <h2><a name="SECTid0x55a5a88fb1d0">Quantity specifier</a></h2><p>Several schema definition commands expect a quantifier as
    one of their arguments which determines how often the content
    particle specified by the command is expected. The valid values
    for a <i class="m">quant</i> argument are:</p><dl class="optlist">
      
        <dt><b>!</b></dt>
        <dd>The content particle has to occur exactly once in valid
        documents.</dd>
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
        second list element is the character *, then there is no upper
        limit. Otherwise the second list element must be an integer
        with n &lt; m.</dd>
      
    </dl><p>If an optional quantifier is not given, it defaults to * in
    case of the <i class="m">mixed</i> command and to ! for all other commands.</p>

  <h2><a name="SECTid0x5607ea1347b0">Text constraint scripts</a></h2><p>Text (parsed character data, as XML calls it) sometimes has to
    be of a certain kind or comply with certain rules to be valid. The
    text constraint script arguments to text, attribute, nsattribute
    and deftexttype commands are evaluated in the Tcl namespace
    <i class="m">tdom::schema::text</i> namespace and allow the ensuing text
    constraint commands to check text for certain properties. The
    commands are defined in the Tcl namespace
    <i class="m">tdom::schema::text</i>. They raise error in case they are
    called outside of a text constraint script.</p><p>A few of the ensuing text type commands are exposed as general
    Tcl commands. They are defined in the namespace tdom::type and are
    called as documented below with the text to check appended to the
    argument list. They return a logical value. Please note that the
    commands may not accept starting or ending white space. If a
    command is available in the tdom::type namespace is recorded in
    its documentation.
    </p>
        <h3><a name="SECTid0x5607ea135060">The tcl text constraint command</a></h3>
        <p>The <i class="m">tcl</i> text constraint command dispatches the check
        to an arbitrary Tcl command, thus enable any programmable
        decision rules.</p>
        <dl class="commandlist">
            
                <dt>
<b class="cmd">tcl</b> <i class="m">tclcmd</i> <i class="m">?arg arg ...?</i>
</dt>
                <dd>Evaluates the Tcl script <i class="m">tclcmd arg arg ... </i> and
                the text to validate appended to the argument list. The return
                value of the Tcl command is interpreted as a boolean.</dd>
            
        </dl>
    
        <h3><a name="SECTid0x5607ea135e40">Basic XML types</a></h3>
        <dl class="commandlist">
            
                <dt><b class="cmd">name</b></dt>
                <dd>This text constraint matches if the text value
                matches the XML name production
                <a href="https://www.w3.org/TR/xml/#NT-Name">https://www.w3.org/TR/xml/#NT-Name</a>. This
                means that the text value must start with a letter,







|















|














|







951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
        second list element is the character *, then there is no upper
        limit. Otherwise the second list element must be an integer
        with n &lt; m.</dd>
      
    </dl><p>If an optional quantifier is not given, it defaults to * in
    case of the <i class="m">mixed</i> command and to ! for all other commands.</p>

  <h2><a name="SECTid0x55a5a8a2c0a0">Text constraint scripts</a></h2><p>Text (parsed character data, as XML calls it) sometimes has to
    be of a certain kind or comply with certain rules to be valid. The
    text constraint script arguments to text, attribute, nsattribute
    and deftexttype commands are evaluated in the Tcl namespace
    <i class="m">tdom::schema::text</i> namespace and allow the ensuing text
    constraint commands to check text for certain properties. The
    commands are defined in the Tcl namespace
    <i class="m">tdom::schema::text</i>. They raise error in case they are
    called outside of a text constraint script.</p><p>A few of the ensuing text type commands are exposed as general
    Tcl commands. They are defined in the namespace tdom::type and are
    called as documented below with the text to check appended to the
    argument list. They return a logical value. Please note that the
    commands may not accept starting or ending white space. If a
    command is available in the tdom::type namespace is recorded in
    its documentation.
    </p>
        <h3><a name="SECTid0x55a5a8a2c950">The tcl text constraint command</a></h3>
        <p>The <i class="m">tcl</i> text constraint command dispatches the check
        to an arbitrary Tcl command, thus enable any programmable
        decision rules.</p>
        <dl class="commandlist">
            
                <dt>
<b class="cmd">tcl</b> <i class="m">tclcmd</i> <i class="m">?arg arg ...?</i>
</dt>
                <dd>Evaluates the Tcl script <i class="m">tclcmd arg arg ... </i> and
                the text to validate appended to the argument list. The return
                value of the Tcl command is interpreted as a boolean.</dd>
            
        </dl>
    
        <h3><a name="SECTid0x55a5a8a2d730">Basic XML types</a></h3>
        <dl class="commandlist">
            
                <dt><b class="cmd">name</b></dt>
                <dd>This text constraint matches if the text value
                matches the XML name production
                <a href="https://www.w3.org/TR/xml/#NT-Name">https://www.w3.org/TR/xml/#NT-Name</a>. This
                means that the text value must start with a letter,
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
                <dd>This text constraint matches if the text value
                matches the XML nmtokens production
                <a href="https://www.w3.org/TR/xml/#NT-Nmtokens">https://www.w3.org/TR/xml/#NT-Nmtokens</a>
</dd>
            
        </dl>
    
        <h3><a name="SECTid0x5607ea1297c0">Basic type tests</a></h3>
        <p>
        </p>
        <dl class="commandlist">
            
                <dt>
<b class="cmd">integer</b> <i class="m">?(xsd|tcl)?</i>
</dt>







|







1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
                <dd>This text constraint matches if the text value
                matches the XML nmtokens production
                <a href="https://www.w3.org/TR/xml/#NT-Nmtokens">https://www.w3.org/TR/xml/#NT-Nmtokens</a>
</dd>
            
        </dl>
    
        <h3><a name="SECTid0x55a5a8a3eba0">Basic type tests</a></h3>
        <p>
        </p>
        <dl class="commandlist">
            
                <dt>
<b class="cmd">integer</b> <i class="m">?(xsd|tcl)?</i>
</dt>
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
                is a xsd:long. This is an integer between
                -9223372036854775808 and 9223372036854775807, both
                included, optionally preceded by a + or a - sign and
                leading zeros.</dd>
            
        </dl>
    
        <h3><a name="SECTid0x5607ea123fd0">Logical constructs</a></h3>
        <dl class="commandlist">
        
            <dt>
<b class="cmd">oneOf</b> <i class="m">&lt;constraint script&gt;</i>
</dt>
            <dd>This text constraint matches if one of the text
            constraints defined in the argument <i class="m">constraint script</i>







|







1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
                is a xsd:long. This is an integer between
                -9223372036854775808 and 9223372036854775807, both
                included, optionally preceded by a + or a - sign and
                leading zeros.</dd>
            
        </dl>
    
        <h3><a name="SECTid0x55a5a89efa20">Logical constructs</a></h3>
        <dl class="commandlist">
        
            <dt>
<b class="cmd">oneOf</b> <i class="m">&lt;constraint script&gt;</i>
</dt>
            <dd>This text constraint matches if one of the text
            constraints defined in the argument <i class="m">constraint script</i>
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
<b class="cmd">type</b> <i class="m">text type name</i>
</dt>
            <dd>This text constraint matches if the text type given
            as argument matches.</dd>
        
        </dl>
    
        <h3><a name="SECTid0x5607ea12f510">Constraints on processed text value</a></h3>
        <dl class="commandlist">
            
            <dt>
<b class="cmd">whitespace</b> <i class="m">(preserve|replace|collapse)</i> <i class="m">&lt;constraint script&gt;</i>
</dt>
            <dd>This text constraint command does white-space (#x20
            (space, ' '), #x9 (tab, \t), #xA (linefeed, \n), and #xD







|







1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
<b class="cmd">type</b> <i class="m">text type name</i>
</dt>
            <dd>This text constraint matches if the text type given
            as argument matches.</dd>
        
        </dl>
    
        <h3><a name="SECTid0x55a5a8a50ac0">Constraints on processed text value</a></h3>
        <dl class="commandlist">
            
            <dt>
<b class="cmd">whitespace</b> <i class="m">(preserve|replace|collapse)</i> <i class="m">&lt;constraint script&gt;</i>
</dt>
            <dd>This text constraint command does white-space (#x20
            (space, ' '), #x9 (tab, \t), #xA (linefeed, \n), and #xD
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
</dt>
            <dd>This text constraint command tests all text constraints
            in the evaluated <i class="m">constraint script&gt;</i> with the text to
            test stripped of all white space at start and end.</dd>
        
        </dl>
    
        <h3><a name="SECTid0x5607ea0f92c0">Various other string properties</a></h3>
        <dl class="commandlist">
        
            <dt>
<b class="cmd">fixed</b> <i class="m">value</i>
</dt>
            <dd>The text constraint only matches if the text value is
            string equal to the given value.</dd>







|







1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
</dt>
            <dd>This text constraint command tests all text constraints
            in the evaluated <i class="m">constraint script&gt;</i> with the text to
            test stripped of all white space at start and end.</dd>
        
        </dl>
    
        <h3><a name="SECTid0x55a5a8a53260">Various other string properties</a></h3>
        <dl class="commandlist">
        
            <dt>
<b class="cmd">fixed</b> <i class="m">value</i>
</dt>
            <dd>The text constraint only matches if the text value is
            string equal to the given value.</dd>
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
            constraint command. The possible types are <i class="m">NULL</i>,
            <i class="m">TRUE</i>, <i class="m">FALSE</i>, <i class="m">STRING</i> and
            <i class="m">NUMBER</i>.</dd>
        
        </dl>
    

  <h2><a name="SECTid0x5607ea12c6c0">Local key constraints</a></h2><p>Document wide uniqueness and foreign key constraints are
    available with the text constraint commands id and idref.
    Keyspaces allow for sub-tree local uniqueness and foreign key
    constraints.</p><dl class="commandlist">
        
            <dt>
<b class="cmd">keyspace</b> <i class="m">&lt;names list&gt;</i> <i class="m">&lt;constraint script&gt;</i>
</dt>







|







1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
            constraint command. The possible types are <i class="m">NULL</i>,
            <i class="m">TRUE</i>, <i class="m">FALSE</i>, <i class="m">STRING</i> and
            <i class="m">NUMBER</i>.</dd>
        
        </dl>
    

  <h2><a name="SECTid0x55a5a8a04420">Local key constraints</a></h2><p>Document wide uniqueness and foreign key constraints are
    available with the text constraint commands id and idref.
    Keyspaces allow for sub-tree local uniqueness and foreign key
    constraints.</p><dl class="commandlist">
        
            <dt>
<b class="cmd">keyspace</b> <i class="m">&lt;names list&gt;</i> <i class="m">&lt;constraint script&gt;</i>
</dt>
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
            active always matches. If the keyspace is active then
            reports error if there is still no key as the value at the
            end of the keyspace <i class="m">&lt;name&gt;</i>. Otherwise, it
            matches.</dd>
        
    </dl>

  <h2><a name="SECTid0x5607ea097eb0">Recovering</a></h2><p>By default the validation engine stops at the first detected
      validation violation and reports that finding. It does so by
      return false (and sets, if given, the result variable with an
      error message) in case the schema command itself is used to
      validate input. If the schema command is used by a SAX parser or
      the DOM parser, it does so by throwing error.</p><p>If a <i class="m">reportcmd</i> is set this command is called on global
      level appended with the schema command and an error type as
      arguments in case a validation violation is detected. Then the







|







1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
            active always matches. If the keyspace is active then
            reports error if there is still no key as the value at the
            end of the keyspace <i class="m">&lt;name&gt;</i>. Otherwise, it
            matches.</dd>
        
    </dl>

  <h2><a name="SECTid0x55a5a8a65260">Recovering</a></h2><p>By default the validation engine stops at the first detected
      validation violation and reports that finding. It does so by
      return false (and sets, if given, the result variable with an
      error message) in case the schema command itself is used to
      validate input. If the schema command is used by a SAX parser or
      the DOM parser, it does so by throwing error.</p><p>If a <i class="m">reportcmd</i> is set this command is called on global
      level appended with the schema command and an error type as
      arguments in case a validation violation is detected. Then the
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
      element end event of the subtree.</p><p>Returning "ignore" from the recovering script in case of
      error type MISSING_ELEMENT recovers by ignoring the failed
      constraint and continues to match the event further against the
      schema.</p><p>Returning "vanish" from the recover script in case of the
      error types MISSING_ELEMENT and UNEXPECTED_ELEMENT recovers by
      ignoring the event.</p>

  <h2><a name="SECTid0x5607ea099af0">Examples</a></h2><p>The XML Schema Part 0: Primer Second Edition
    (<a href="https://www.w3.org/TR/xmlschema-0/">https://www.w3.org/TR/xmlschema-0/</a>) starts with this
    example schema:</p><pre class="example">
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;

  &lt;xsd:annotation&gt;
    &lt;xsd:documentation xml:lang="en"&gt;
     Purchase order schema for Example.com.







|







1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
      element end event of the subtree.</p><p>Returning "ignore" from the recovering script in case of
      error type MISSING_ELEMENT recovers by ignoring the failed
      constraint and continues to match the event further against the
      schema.</p><p>Returning "vanish" from the recover script in case of the
      error types MISSING_ELEMENT and UNEXPECTED_ELEMENT recovers by
      ignoring the event.</p>

  <h2><a name="SECTid0x55a5a8a67010">Examples</a></h2><p>The XML Schema Part 0: Primer Second Edition
    (<a href="https://www.w3.org/TR/xmlschema-0/">https://www.w3.org/TR/xmlschema-0/</a>) starts with this
    example schema:</p><pre class="example">
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;

  &lt;xsd:annotation&gt;
    &lt;xsd:documentation xml:lang="en"&gt;
     Purchase order schema for Example.com.
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
    foreach e {name email} {
        defelement $e text
    }
}
      
    </pre>

<h2><a name="SECTid0x5607ea11a850">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-Postvalidation">Postvalidation</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|







1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
    foreach e {name email} {
        defelement $e text
    }
}
      
    </pre>

<h2><a name="SECTid0x55a5a8a270c0">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-Postvalidation">Postvalidation</a>, <a class="keyword" href="keyword-index.html#KW-DOM">DOM</a>, <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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>

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
<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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea0e6d90">NAME</a> · <a href="#SECTid0x5607ea10bb40">SYNOPSIS</a> · <a href="#SECTid0x5607ea10bd50">DESCRIPTION</a> · <a href="#SECTid0x5607e9f25ae0">SEE ALSO</a> · <a href="#SECTid0x5607e9f25e40">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x5607ea0e6d90">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="SECTid0x5607ea10bb40">SYNOPSIS</a></h2><pre class="syntax">package require tdom

set parser [expat]

tdom $parser enable</pre>

  <h2><a name="SECTid0x5607ea10bd50">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">
      






|


|




|





|







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: 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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a8a662e0">NAME</a> · <a href="#SECTid0x55a5a88e16d0">SYNOPSIS</a> · <a href="#SECTid0x55a5a8a2bb20">DESCRIPTION</a> · <a href="#SECTid0x55a5a8a3c310">SEE ALSO</a> · <a href="#SECTid0x55a5a8a3c670">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
    <h2><a name="SECTid0x55a5a8a662e0">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="SECTid0x55a5a88e16d0">SYNOPSIS</a></h2><pre class="syntax">package require tdom

set parser [expat]

tdom $parser enable</pre>

  <h2><a name="SECTid0x55a5a8a2bb20">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">
      
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<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="SECTid0x5607e9f25ae0">SEE ALSO</a></h2><p class="seealso">dom, expat</p>

  <h2><a name="SECTid0x5607e9f25e40">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>







|

|








73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<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="SECTid0x55a5a8a3c310">SEE ALSO</a></h2><p class="seealso">dom, expat</p>

  <h2><a name="SECTid0x55a5a8a3c670">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> · <a class="navaid" href="http://tdom.org">Repository</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: tmml-html.xsl,v $ $Revision: 1.11 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x5607ea1e22c0">NAME</a> · <a href="#SECTid0x5607ea1c7460">SYNOPSIS</a> · <a href="#SECTid0x5607ea1c7680">DESCRIPTION</a> · <a href="#SECTid0x5607ea1ef2e0">BUGS</a> · <a href="#SECTid0x5607ea1ef9a0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x5607ea1e22c0">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="SECTid0x5607ea1c7460">SYNOPSIS</a></h2><pre class="syntax">package require tdom
package require tnc

set parser [expat]

tnc $parser enable</pre>

  <h2><a name="SECTid0x5607ea1c7680">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 $"><meta charset="utf-8">
</head><body>
<div class="header">
<div class="navbar" align="center">
<a href="#SECTid0x55a5a8a669e0">NAME</a> · <a href="#SECTid0x55a5a8a478e0">SYNOPSIS</a> · <a href="#SECTid0x55a5a89eb680">DESCRIPTION</a> · <a href="#SECTid0x55a5a8a03ee0">BUGS</a> · <a href="#SECTid0x55a5a8a045e0">KEYWORDS</a>
</div><hr class="navsep">
</div><div class="body">
  <h2><a name="SECTid0x55a5a8a669e0">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="SECTid0x55a5a8a478e0">SYNOPSIS</a></h2><pre class="syntax">package require tdom
package require tnc

set parser [expat]

tnc $parser enable</pre>

  <h2><a name="SECTid0x55a5a89eb680">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="SECTid0x5607ea1ef2e0">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="SECTid0x5607ea1ef9a0">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> · <a class="navaid" href="http://tdom.org">Repository</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="SECTid0x55a5a8a03ee0">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="SECTid0x55a5a8a045e0">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> · <a class="navaid" href="http://tdom.org">Repository</a>
</div>
</body>
</html>