Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch dom_featureinfo Excluding Merge-Ins
This is equivalent to a diff from 02675cd3c8 to d40d0f4c10
2013-09-26
| ||
01:35 | Added dom method featureinfo. check-in: 9ab65ed6fc user: rolf tags: trunk | |
01:30 | Added tests. Documentation tweak. Closed-Leaf check-in: d40d0f4c10 user: rolf tags: dom_featureinfo | |
2013-09-25
| ||
00:47 | Updated and regenerated doc. check-in: 8ccb6f120b user: rolf tags: dom_featureinfo | |
00:09 | Updated from trunk. check-in: 3a3b825826 user: rolf tags: dom_featureinfo | |
00:03 | More work on OASIS-suite.tcl. check-in: 02675cd3c8 user: rolf tags: trunk | |
2013-09-24
| ||
22:50 | Added a Relax NG compact tmml schema definition (generated by trang from the tmml.dtd and a minor modification. check-in: 1189b8bada user: rolf tags: trunk | |
Changes to doc/dom.html.
1 2 | 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> |
︙ | |||
414 415 416 417 418 419 420 | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + - - - + + - - - - | <i class="m">string</i> </dt> <dd>Returns 1, if <i class="m">string</i> is valid according to production 16 of the <a href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</a> recommendation. Otherwise it returns 0.</dd> <dt> <b class="cmd">dom</b> <b class="method">featureinfo</b> <i class="m">feature</i> </dt> <dd>This method provides information about the used build options and the expat version. The valid values for the <i class="m">feature</i> argument are: <dl class="optlist"> <dt><b>expatversion</b></dt> <dd>Returns the version of the underlyling expat version as string, something like "exapt_2.1.0". This is. what the expat API function XML_ExpatVersion() returns.</dd> <dt><b>expatmajorversion</b></dt> <dd>Returns the major version of the underlyling expat version as integer.</dd> <dt><b>expatminorversion</b></dt> <dd>Returns the minor version of the underlyling expat version as integer.</dd> <dt><b>expatmicroversion</b></dt> <dd>Returns the micro version of the underlyling expat version as integer.</dd> <dt><b>dtd</b></dt> <dd>Returns as boolean, if build with <i class="m">--enable-dtd</i>.</dd> <dt><b>ns</b></dt> <dd>Returns as boolean, if build with <i class="m">--enable-ns</i>.</dd> <dt><b>unknown</b></dt> <dd>Returns as boolean, if build with <i class="m">--enable-unknown</i>.</dd> <dt><b>tdomalloc</b></dt> <dd>Returns as boolean, if build with <i class="m">--enable-tdomalloc</i>.</dd> <dt><b>lessns</b></dt> <dd>Returns as boolean, if build with <i class="m">--enable-lessns</i>.</dd> |
Changes to doc/dom.n.
︙ | |||
486 487 488 489 490 491 492 493 494 | 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | valid according to production 20 of the XML 1.0 recommendation. Otherwise it returns 0. .TP \&\fB\fBdom\fP \fBisPIValue\fP \fIstring\fB \&\fRReturns 1, if \fIstring\fR is valid according to production 16 of the XML 1.0 recommendation. Otherwise it returns 0. .TP \&\fB\fBdom\fP \fBfeatureinfo\fP \fIfeature\fB \&\fRThis method provides information about the used build options and the expat version. The valid values for the \fIfeature\fR argument are: .RS .IP "\fBexpatversion\fR" Returns the version of the underlyling expat version as string, something like "exapt_2.1.0". This is. what the expat API function XML_ExpatVersion() returns. .IP "\fBexpatmajorversion\fR" Returns the major version of the underlyling expat version as integer. .IP "\fBexpatminorversion\fR" Returns the minor version of the underlyling expat version as integer. .IP "\fBexpatmicroversion\fR" Returns the micro version of the underlyling expat version as integer. .IP "\fBdtd\fR" Returns as boolean, if build with \&\fI--enable-dtd\fR. .IP "\fBns\fR" Returns as boolean, if build with \&\fI--enable-ns\fR. .IP "\fBunknown\fR" Returns as boolean, if build with \&\fI--enable-unknown\fR. .IP "\fBtdomalloc\fR" Returns as boolean, if build with \&\fI--enable-tdomalloc\fR. .IP "\fBlessns\fR" Returns as boolean, if build with \&\fI--enable-lessns\fR. .RE .SH KEYWORDS XML, DOM, document, node, parsing |
Changes to doc/dom.xml.
︙ | |||
386 387 388 389 390 391 392 | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + | <command><cmd>dom</cmd> <method>isPIValue</method> <m>string</m></command> <desc>Returns 1, if <m>string</m> is valid according to production 16 of the <ref href="http://www.w3.org/TR/2000/REC-xml-20001006.html">XML 1.0</ref> recommendation. Otherwise it returns 0.</desc> </commanddef> <commanddef> <command><cmd>dom</cmd> <method>featureinfo</method> <m>feature</m></command> <desc>This method provides information about the used build options and the expat version. The valid values for the <m>feature</m> argument are: <optlist> <optdef> <optname>expatversion</optname> <desc>Returns the version of the underlyling expat version as string, something like "exapt_2.1.0". This is. what the expat API function XML_ExpatVersion() returns.</desc> </optdef> <optdef> <optname>expatmajorversion</optname> <desc>Returns the major version of the underlyling expat version as integer.</desc> </optdef> <optdef> <optname>expatminorversion</optname> <desc>Returns the minor version of the underlyling expat version as integer.</desc> </optdef> <optdef> <optname>expatmicroversion</optname> <desc>Returns the micro version of the underlyling expat version as integer.</desc> </optdef> <optdef> <optname>dtd</optname> <desc>Returns as boolean, if build with <m>--enable-dtd</m>.</desc> </optdef> <optdef> <optname>ns</optname> <desc>Returns as boolean, if build with <m>--enable-ns</m>.</desc> </optdef> <optdef> <optname>unknown</optname> <desc>Returns as boolean, if build with <m>--enable-unknown</m>.</desc> </optdef> <optdef> <optname>tdomalloc</optname> <desc>Returns as boolean, if build with <m>--enable-tdomalloc</m>.</desc> </optdef> <optdef> <optname>lessns</optname> <desc>Returns as boolean, if build with <m>--enable-lessns</m>.</desc> </optdef> </optlist> </desc> </commanddef> |
Changes to doc/domDoc.html.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + - + - + - + - + | <html> <head> |
︙ | |||
176 177 178 179 180 181 182 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | + - - + + | <dd>Returns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value.</dd> <dt> |
︙ | |||
502 503 504 505 506 507 508 | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | + - - + + | set root [$doc documentElement] set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child]</pre> </dd> <dt> |
︙ | |||
545 546 547 548 549 550 551 | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | - + - + | </dl><p>Otherwise, if an unknown method name is given, the command with the same name as the given metho within the namespace <tt class="samp">::dom::domDoc</tt> is tried to be executed. This allows quick method additions on Tcl level.</p><p>Newly created nodes are appended to a hidden fragment list. If they are not moved into the tree they are automaticaly deleted, when the whole document gets deleted.</p> |
Changes to doc/domDoc.n.
︙ | |||
280 281 282 283 284 285 286 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | - + | .TP \&\fB\fBsystemId\fP \fI?systemId?\fB \&\fRReturns the system identifier of the doctype declaration of the document, if there is one, otherwise the empty string. If there is a value given to the method, the system identifier of the document is set to this value. .TP |
︙ | |||
532 533 534 535 536 537 538 | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | - + | set doc [dom parse {<doc xmlns="http://www.defaultnamespace.org"><child/></doc>}] set root [$doc documentElement] set childNodes [$root selectNodes -namespaces {default http://www.defaultnamespace.org} default:child] .CE .RE .TP |
︙ |
Changes to doc/domNode.html.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + - + - + - + | <html> <head> <link rel="stylesheet" href="manpage.css"><title>tDOM manual: domNode</title><meta name="xsl-processor" content="Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."><meta name="generator" content="$RCSfile: tmml-html.xsl,v $ $Revision: 1.11 $"> </head><body> <div class="header"> <div class="navbar" align="center"> |
︙ | |||
558 559 560 561 562 563 564 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | + - - + + + - - + + | <dd>Translate the subtree starting at the object node according to the specifications in <i class="m">specifications</i> and outputs the result in the variable <i class="m">outputVar</i> . The translation is very similar to Cost Simple mode.</dd> <dt> |
︙ | |||
663 664 665 666 667 668 669 | 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 | - + - + | for <i class="m">getAttribute</i>.</dd> </dl><p>Otherwise, if an unknown method name is given, the command with the same name as the given method within the namespace <tt class="l">::dom::domNode</tt> is tried to be executed. This allows quick method additions on Tcl level.</p> |
Changes to doc/domNode.n.
︙ | |||
533 534 535 536 537 538 539 | 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | - + - + | .TP \&\fB\fBsimpleTranslate\fP \fIoutputVar\fB \fIspecifications\fB \&\fRTranslate the subtree starting at the object node according to the specifications in \fIspecifications\fR and outputs the result in the variable \fIoutputVar\fR . The translation is very similar to Cost Simple mode. .TP |
︙ |
Changes to doc/expat.html.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - + - + - + - + - + - + | <html> <head> |
︙ | |||
612 613 614 615 616 617 618 | 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | - + - + - | -paramentityparsing value of "never" (which is the default) suppresses any call to the -externalentitycommand script. Pleace notice, that, if the document also doesn't have an internal subset, the -startdoctypedeclcommand and enddoctypedeclcommand scripts, if set, are not called.</dd> </dl> |
︙ | |||
752 753 754 755 756 757 758 | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | - + - + - + | <dd><p>Resets the parser in preparation for parsing another document. A parser cannot be reseted from within one of its handler callbacks (neither directly nor indirectly) and will raise a tcl error in this cases.</p></dd> </dl> |
Changes to doc/expat.n.
︙ | |||
710 711 712 713 714 715 716 | 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | - + | \&\fR .RS .PP Sets configuration options for the parser. Every command option, except \fI-namespace\fR can be set or modified with this method. .RE .TP |
︙ |
Changes to doc/expatapi.html.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + - + - + - + | <html> <head> |
︙ | |||
31 32 33 34 35 36 37 | 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> |
︙ | |||
57 58 59 60 61 62 63 | 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> |
︙ | |||
100 101 102 103 104 105 106 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - + | XML_NotationDeclHandler notationcommand; /* C func for external entity */ XML_ExternalEntityRefHandler externalentitycommand; /* C func for unknown encoding */ XML_UnknownEncodingHandler unknownencodingcommand; /* C func for comments */ XML_CommentHandler commentCommand; |
︙ | |||
163 164 165 166 167 168 169 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + - + - + - + - - - + + - - - | char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; static char *exampleMethods[] = { |
Changes to doc/manpage.css.
1 | 1 2 3 4 5 6 7 8 9 | - + | /* |
︙ |
Changes to doc/tdomcmd.html.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + - + - + - + - - + + - + | <html> <head> |
︙ | |||
45 46 47 48 49 50 51 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | - + - + - + - + - - - + - - - + + - - - | <dt> <b class="cmd">tdom</b> <i class="m">parserObj</i> <b class="method">setResultEncoding</b> </dt> <dd><p>See the method <tt class="samp">setResultEncoding</tt> of the |
Changes to doc/tnc.html.
1 2 | 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> |
︙ | |||
116 117 118 119 120 121 122 | 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> |
Changes to generic/tcldom.c.
︙ | |||
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | + | " isComment string \n" " isCDATA string \n" " isPIValue string \n" " isName string \n" " isQName string \n" " isNCName string \n" " isPIName string \n" " featureinfo feature \n" ; static char doc_usage[] = "Usage domDoc <method> <args>, where method can be:\n" " documentElement ?objVar? \n" " getElementsByTagName name \n" " getElementsByTagNameNS uri localname \n" |
︙ | |||
5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 | 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return tcldom_returnDocumentObj (interp, doc, setVariable, newObjName, 1, 0); #endif } /*---------------------------------------------------------------------------- | tcldom_featureinfo | \---------------------------------------------------------------------------*/ static int tcldom_featureinfo ( ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { int featureIndex, result; static CONST84 char *features[] = { "expatversion", "expatmajorversion", "expatminorversion", "expatmicroversion", "dtd", "ns", "unknown", "tdomalloc", "lessns", NULL }; enum feature { o_expatversion, o_expatmajorversion, o_expatminorversion, o_expatmicroversion, o_dtd, o_ns, o_unknown, o_tdomalloc, o_lessns }; if (Tcl_GetIndexFromObj(interp, objv[1], features, "feature", 0, &featureIndex) != TCL_OK) { return TCL_ERROR; } switch ((enum feature) featureIndex) { case o_expatversion: SetResult(XML_ExpatVersion()); break; case o_expatmajorversion: SetIntResult(XML_MAJOR_VERSION); break; case o_expatminorversion: SetIntResult(XML_MINOR_VERSION); break; case o_expatmicroversion: SetIntResult(XML_MICRO_VERSION); break; case o_dtd: #ifdef XML_DTD result = 1; #else result = 0; #endif SetBooleanResult(result); break; case o_ns: #ifdef XML_NS result = 1; #else result = 0; #endif SetBooleanResult(result); break; case o_unknown: #ifdef TDOM_NO_UNKNOWN_CMD result = 0; #else result = 1; #endif SetBooleanResult(result); break; case o_tdomalloc: #ifdef USE_NORMAL_ALLOCATOR result = 0; #else result = 1; #endif SetBooleanResult(result); break; case o_lessns: #ifdef TDOM_LESS_NS result = 1; #else result = 0; #endif SetBooleanResult(result); break; } return TCL_OK; } /*---------------------------------------------------------------------------- | tcldom_DomObjCmd | \---------------------------------------------------------------------------*/ int tcldom_DomObjCmd ( ClientData clientData, |
︙ | |||
5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 | 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 | + - + + | static CONST84 char *domMethods[] = { "createDocument", "createDocumentNS", "createNodeCmd", "parse", "setResultEncoding", "setStoreLineColumn", "isCharData", "isName", "isPIName", "isQName", "isComment", "isCDATA", "isPIValue", "isNCName", "createDocumentNode", "setNameCheck", "setTextCheck", "setObjectCommands", "featureinfo", #ifdef TCL_THREADS "attachDocument", "detachDocument", #endif NULL }; enum domMethod { m_createDocument, m_createDocumentNS, m_createNodeCmd, m_parse, m_setResultEncoding, m_setStoreLineColumn, m_isCharData, m_isName, m_isPIName, m_isQName, m_isComment, m_isCDATA, m_isPIValue, m_isNCName, m_createDocumentNode, |
︙ | |||
5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 | 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 | + + + | return TCL_OK; case m_isNCName: CheckArgs(3,3,2,"string"); SetBooleanResult(domIsNCNAME(Tcl_GetString(objv[2]))); return TCL_OK; case m_featureinfo: CheckArgs(3,3,2,"feature") return tcldom_featureinfo(clientData, interp, --objc, objv+1); } SetResult( dom_usage); return TCL_ERROR; } #ifdef TCL_THREADS |
︙ |
Changes to tests/dom.test.
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + | # dom-4.*: parse -useForeignDTD # dom-5.*: external entities # dom-6.*: use in slave interpreter # dom-7.*: setNameCheck, setTextCheck # dom-8.*: createDocumentNode, documentNodes # dom-9.*: setObjectCommands # dom-10.*: createNodeCmd # dom-11.*: featureinfo # # Copyright (c) 2002, 2003, 2004 Rolf Ade. source [file join [file dir [info script]] loadtdom.tcl] test dom-1.1 {createDocument with root node name not a XML Name} { list [catch {dom createDocument "root node"} msg] $msg |
︙ | |||
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 | + + + + + + + + + + + + + + + + | nodeCmds::e1 { nodeCmds::t "Some text" }} errMsg] lappend result $errMsg } {{<docRoot><e1>Some text</e1></docRoot>} 1 {called outside domNode context}} namespace delete nodeCmds test dom-11.1 {featureinfo - expatversion} -body { dom featureinfo expatversion } -match regexp -result {expat_.*} test dom-11.2 {featureinfo - invalid arg} -body { catch {dom featureinfo foo} errMsg } -result 1 test dom-11.3 {featureinfo - expatmajorversion} -body { dom featureinfo expatmajorversion } -match regexp -result {(1|2)} test dom-11.4 {featureinfo - dtd} -body { dom featureinfo dtd } -match regexp -result {(0|1)} # cleanup ::tcltest::cleanupTests return |