├── CHANGES ├── ChangeLog ├── LICENSE ├── Makefile.in ├── NPL-1_1Final.html ├── README ├── README.AOL ├── aclocal.m4 ├── apps └── xslt.tcl ├── configure ├── configure-tcl8.0.5 ├── configure.in ├── doc ├── INDEX.MAP ├── README ├── category-index.html ├── dom.html ├── dom.n ├── dom.xml ├── domDoc.html ├── domDoc.n ├── domDoc.xml ├── domNode.html ├── domNode.n ├── domNode.xml ├── expat.html ├── expat.n ├── expat.xml ├── expatapi.html ├── expatapi.n ├── expatapi.xml ├── index.html ├── keyword-index.html ├── manpage.css ├── tDOM.xml ├── tdomcmd.html ├── tdomcmd.n ├── tdomcmd.xml ├── tmml.dtd ├── tmml.options ├── tmml.rnc ├── tnc.html ├── tnc.n └── tnc.xml ├── encodings ├── GenCompactCodings ├── ascii.enc ├── cp1250.enc ├── cp1251.enc ├── cp1252.enc ├── cp1253.enc ├── cp1254.enc ├── cp1255.enc ├── cp1256.enc ├── cp437.enc ├── cp850.enc ├── iso8859-1.enc ├── iso8859-2.enc ├── iso8859-3.enc ├── iso8859-4.enc ├── iso8859-5.enc ├── iso8859-6.enc ├── iso8859-7.enc ├── iso8859-8.enc ├── iso8859-9.enc └── koi8-r.enc ├── expat ├── COPYING ├── Changes ├── README ├── VERSION ├── amigaconfig.h ├── ascii.h ├── asciitab.h ├── expat.h ├── expat_external.h ├── iasciitab.h ├── internal.h ├── latin1tab.h ├── macconfig.h ├── nametab.h ├── utf8tab.h ├── winconfig.h ├── xmlparse.c ├── xmlrole.c ├── xmlrole.h ├── xmltok.c ├── xmltok.h ├── xmltok_impl.c ├── xmltok_impl.h └── xmltok_ns.c ├── extensions ├── example │ ├── Makefile.in │ ├── aclocal.m4 │ ├── configure │ ├── configure.in │ ├── example.c │ ├── exampletest.tcl │ ├── install-sh │ ├── mkinstalldirs │ ├── pkgIndex.tcl.in │ └── tcl.m4 ├── tdomhtml │ ├── CONFIG │ ├── Makefile.in │ ├── configure │ ├── configure.in │ ├── doc │ │ ├── tdomhtml.n │ │ └── tdomhtml.tmml │ ├── install-sh │ ├── mkinstalldirs │ ├── pkgIndex.tcl.in │ └── tdomhtml.tcl └── tnc │ ├── Makefile.in │ ├── aclocal.m4 │ ├── configure │ ├── configure.in │ ├── install-sh │ ├── makefile.vc │ ├── mkinstalldirs │ ├── pkgIndex.tcl.in │ ├── test.tcl │ ├── tests │ ├── all.tcl │ ├── loadtnc.tcl │ └── tnc.test │ └── tnc.c ├── generic ├── aolstub.cpp ├── dom.c ├── dom.h ├── domalloc.c ├── domalloc.h ├── domhtml.c ├── domhtml.h ├── domlock.c ├── domxpath.c ├── domxpath.h ├── domxslt.c ├── domxslt.h ├── encodings.inc ├── expat_config.h ├── nodecmd.c ├── nodecmd.h ├── tcldom.c ├── tcldom.h ├── tclexpat.c ├── tclexpat.h ├── tdom.decls ├── tdom.h ├── tdomDecls.h ├── tdomStubInit.c ├── tdomStubLib.c ├── tdominit.c ├── utf8conv.c ├── utf8conv.h ├── win32.h ├── xmlsimple.c └── xmlsimple.h ├── lib └── tdom.tcl ├── mac ├── PrecompHeaders │ ├── CoreHeadersMach-O.c │ ├── CoreHeadersMach-O.h │ └── CoreHeadersMach-O.pch ├── Prefix │ ├── expatPrefix.h │ ├── expatPrefix_OSX.h │ ├── tDOMPrefix.h │ ├── tDOMPrefix_OSX.h │ ├── tncPrefix.h │ └── tncPrefix_OSX.h ├── Readme_Mac_Compiling ├── macconfig.h ├── tDOM.exp ├── tDOM.prj.xml ├── tDOM.r ├── tDOM │ ├── pkgIndex.tcl │ └── tdom.tcl ├── tDOM_OSX.prj.xml ├── tnc.exp └── tnc.r ├── macosx └── README ├── tclconfig ├── README.txt ├── install-sh └── tcl.m4 ├── tdom.m4 ├── tdomConfig.sh.in ├── tests ├── OASIS-suite.tcl ├── all-bench.tcl ├── all.tcl ├── attribute.test ├── cdata.test ├── comment.test ├── data │ ├── REC-xslt-19991116.xml │ ├── books.xml │ ├── domCmd1.dtd │ ├── domCmd2.dtd │ ├── dtd-5.1.dtd │ ├── dtd-5.2.dtd │ ├── dtd-6.1.dtd │ ├── dtd-6.2.dtd │ ├── dtd-6.3.dtd │ ├── dtd-6.4.dtd │ ├── dtd-6.5.dtd │ ├── dtd-6.6.dtd │ ├── i18n_1.xml │ ├── i18n_2.xml │ ├── mondial-europe.xml │ └── xslt_1.xsl ├── decls.test ├── doctype.test ├── dom.bench ├── dom.test ├── domDoc.test ├── domNode.bench ├── domNode.test ├── domnamespace.test ├── element.test ├── entity.test ├── htmlreader.test ├── i18n.test ├── loadtdom.tcl ├── namespace.test ├── parser.test ├── pcdata.test ├── pi.test ├── stackedhdl.test ├── tdomcmd.test ├── xmlsimple.test ├── xmltest.test ├── xpath.bench ├── xpath.test └── xslt.test ├── unix ├── CONFIG └── tclAppInit.c ├── win ├── config.h ├── makefile.vc ├── makefile805.vc ├── mkd.bat ├── nmakehlp.c ├── pkgIndex.tcl ├── rules.vc └── tdom.rc └── xe ├── README ├── xe ├── xe-input └── xe.bat /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/ChangeLog -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 3 | The tDOM specific source files come with the Mozilla Public License 4 | Version 1.1. 5 | If you want to distribute/use tDOM under a different license please 6 | feel free to contact the author (loewerj@hotmail.com). 7 | 8 | 9 | For Expat XML parser package license look into the directory expat. 10 | 11 | -------------------------------------------------------------------------------- /NPL-1_1Final.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/NPL-1_1Final.html -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | 3 | tDOM - a XML/DOM/XPath/XSLT implementation for Tcl 4 | (Version 0.8.3) 5 | 6 | Jochen Loewer (loewerj@hotmail.com) 7 | Rolf Ade (rolf@pointsman.de) 8 | 9 | with some contributions by: 10 | 11 | Zoran Vasiljevic (zv@archiware.com) 12 | 13 | 14 | This directory contains a freely distributable (under the Mozilla Public 15 | License) thread-safe extension to Tcl/Tk called tDOM. 16 | 17 | 18 | tDOM contains: 19 | 20 | * the newest version of Expat, the XML parser from James Clark, 21 | including namespace and DTD support. 22 | 23 | * a modified version of Steve Ball's Tclexpat, the Tcl interface to 24 | expat, for event-like (SAX-like) XML parsing. The modifications 25 | are for performance improvements, to make the newest Expat 26 | features (XML namespace) available and for some additional features. 27 | 28 | * a (partial) DOM I and II implementation in C for maximum 29 | performance and minimum memory need following the W3C DOM Core 30 | Level 1 recommendation using a OO-like syntax. 31 | 32 | * a very complete, compliant and fast XPath implementation in C 33 | following the November 99 W3C recommendation. 34 | 35 | * a fast XSLT implementation in C following the W3C Recommendation 36 | 16 November 1999. 37 | 38 | * a (partial) implementation in C of the XPointer (97) navigational 39 | functions. 40 | 41 | * UTF-8 to 8 bit encoding back conversion functionality to support 42 | Tcl version < 8.1x 43 | 44 | * optional DTD validation 45 | 46 | * additional convenience methods 47 | 48 | * documentation in TMML, HTML and nroff format 49 | 50 | 51 | COMPILING/USING tDOM 52 | 53 | Depending on your platform, (unix or win) go to the corresponding 54 | directory and invoke the configure script: 55 | 56 | ../configure 57 | make 58 | make test 59 | make install 60 | 61 | Alternatively, you can build the tDOM package in just about any 62 | directory elsewhere on the fileystem (since TEA-compatible). 63 | 64 | You might also want to do "../configure --help" to get list of all 65 | supported options of the configure script. In the "unix" directory 66 | there is a "CONFIG" file containing some examples on how to invoke 67 | the "configure" script for some common cases. You can peek 68 | there. This file also includes a short description of the tDOM 69 | specific configure options. 70 | 71 | Since tDOM is TEA-compatible you should be able to build it using 72 | the MinGW build environment for Windows. There is also the MSVC 73 | nmake file so you can compile the package with Microsoft tools. 74 | 75 | The compile process will build the tDOM shared library suitable for 76 | loading into the Tcl shell using standard "package require" mechanism. 77 | 78 | Have fun! 79 | 80 | - EOF - 81 | -------------------------------------------------------------------------------- /README.AOL: -------------------------------------------------------------------------------- 1 | 2 | 3 | tDOM - a XML/DOM/XPath/XSLT implementation for Tcl 4 | (Version 0.8.3) 5 | 6 | Jochen Loewer (loewerj@hotmail.com) 7 | Rolf Ade (rolf@pointsman.de) 8 | 9 | with some contributions by: 10 | 11 | Zoran Vasiljevic (zv@archiware.com) 12 | 13 | 14 | This file contains some remarks about using tDOM package under the 15 | AOLserver, a webserver from America Online. 16 | For general information, look in the "README" file in this directory. 17 | 18 | 19 | COMPILING tDOM 20 | -------------- 21 | 22 | Change to "unix" directory, edit the CONFIG file to select 23 | the correct configuration defaults and then do: 24 | 25 | sh CONFIG 26 | make 27 | 28 | 29 | INSTALLING tDOM 30 | --------------- 31 | 32 | Depending on whether you use the AOLserver 3.x or 4.x series, 33 | you need to install the library in a different way. 34 | 35 | For AOLserver 3.x: 36 | 37 | The tDOM is build as AOLserver module. Please consult the 38 | AOLserver documentation how to setup the server to load 39 | AOLserver module(s). 40 | 41 | For AOLserver 4.x: 42 | 43 | You can build tDOM as a regular AOLserver module or Tcl 44 | loadable extension. There are examples in the CONFIG file 45 | how to do either. 46 | 47 | When building the tDOM as AOLserver module, you will have 48 | to manually setup the servers's startup script to load the 49 | module. Please consult the AOLserver documentation how to 50 | do this. 51 | 52 | When building the tDOM as Tcl loadable extension, there is 53 | nothing special related to the AOLserver itself, except for 54 | the target directory/ies where the tDOM files will be 55 | installed when you do: 56 | 57 | make install 58 | 59 | All you need to do then is to use "ns_eval package require tdom" 60 | to load the library. This will make sure the tDOM is loaded in 61 | every connection (or other) thread. You should add this command 62 | to some of the Tcl startup files in modules/tcl, so it loads the 63 | library on every server startup. 64 | 65 | - EOF - 66 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # 2 | # Include the TEA standard macro set 3 | # 4 | builtin(include,tclconfig/tcl.m4) 5 | 6 | # 7 | # Add here whatever m4 macros you want to define for your package 8 | # 9 | builtin(include,tdom.m4) 10 | 11 | -------------------------------------------------------------------------------- /apps/xslt.tcl: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------------------- 2 | # Copyright (c) 1999-2001 Jochen Loewer (loewerj@hotmail.com) 3 | #---------------------------------------------------------------------------- 4 | # 5 | # $Id$ 6 | # 7 | # 8 | # A simple command line XSLT processor using tDOMs XSLT engine. 9 | # 10 | # 11 | # The contents of this file are subject to the Mozilla Public License 12 | # Version 1.1 (the "License"); you may not use this file except in 13 | # compliance with the License. You may obtain a copy of the License at 14 | # http://www.mozilla.org/MPL/ 15 | # 16 | # Software distributed under the License is distributed on an "AS IS" 17 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 18 | # License for the specific language governing rights and limitations 19 | # under the License. 20 | # 21 | # The Original Code is tDOM. 22 | # 23 | # The Initial Developer of the Original Code is Jochen Loewer 24 | # Portions created by Jochen Loewer are Copyright (C) 1998, 1999 25 | # Jochen Loewer. All Rights Reserved. 26 | # 27 | # Contributor(s): 28 | # 29 | # 30 | # 31 | # written by Rolf Ade 32 | # August, 2001 33 | # 34 | #---------------------------------------------------------------------------- 35 | 36 | package require tdom 0.8.1 37 | 38 | # The following is not needed, given, that tDOM is correctly 39 | # installed. This code only ensures, that the tDOM script library gets 40 | # sourced, if the script is called with a tcldomsh out of the build 41 | # dir of a complete tDOM source installation. 42 | if {[lsearch [namespace children] ::tDOM] == -1} { 43 | # tcldomsh without the script library. Source the lib. 44 | source [file join [file dir [info script]] ../lib tdom.tcl] 45 | } 46 | 47 | # Import the tDOM helper procs 48 | namespace import tDOM::* 49 | 50 | # Argument check 51 | if {[llength $argv] != 2 && [llength $argv] != 3} { 52 | puts stderr "usage: $argv0 \ 53 | ?output_method (asHTML|asXML|asText)?" 54 | exit 1 55 | } 56 | foreach { xmlFile xsltFile outputOpt } $argv break 57 | 58 | 59 | # This is the callback proc for xslt:message elements. This proc is 60 | # called once every time an xslt:message element is encountered during 61 | # processing the stylesheet. The callback proc simply sends the text 62 | # message to stderr. 63 | proc xsltmsgcmd {msg terminate} { 64 | puts stderr "xslt message: $msg" 65 | } 66 | 67 | #set ::tDOM::extRefHandlerDebug 1 68 | 69 | set xmldoc [dom parse -baseurl [baseURL $xmlFile] \ 70 | -externalentitycommand extRefHandler \ 71 | -keepEmpties \ 72 | [xmlReadFile $xmlFile] ] 73 | 74 | dom setStoreLineColumn 1 75 | set xsltdoc [dom parse -baseurl [baseURL $xsltFile] \ 76 | -externalentitycommand extRefHandler \ 77 | -keepEmpties \ 78 | [xmlReadFile $xsltFile] ] 79 | dom setStoreLineColumn 0 80 | if {[catch {$xmldoc xslt -xsltmessagecmd xsltmsgcmd $xsltdoc resultDoc} \ 81 | errMsg]} { 82 | puts stderr $errMsg 83 | exit 1 84 | } 85 | 86 | if {$outputOpt == ""} { 87 | set outputOpt [$resultDoc getDefaultOutputMethod] 88 | } 89 | 90 | set doctypeDeclaration 0 91 | if {[$resultDoc systemId] != ""} { 92 | set doctypeDeclaration 1 93 | } 94 | 95 | switch $outputOpt { 96 | asXML - 97 | xml { 98 | if {[$resultDoc indent]} { 99 | set indent 4 100 | } else { 101 | set indent no 102 | } 103 | puts [$resultDoc asXML -indent $indent -escapeNonASCII \ 104 | -doctypeDeclaration $doctypeDeclaration] 105 | } 106 | asHTML - 107 | html { 108 | puts [$resultDoc asHTML -escapeNonASCII -htmlEntities \ 109 | -doctypeDeclaration $doctypeDeclaration] 110 | } 111 | asText - 112 | text { 113 | puts [$resultDoc asText] 114 | } 115 | default { 116 | puts stderr "Unknown output method '$outputOpt'!" 117 | exit 1 118 | } 119 | } 120 | 121 | proc exit args {} 122 | -------------------------------------------------------------------------------- /doc/INDEX.MAP: -------------------------------------------------------------------------------- 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 | 48 | 49 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | 2 | The documentation is written in TMML (developed by Joe English). See 3 | http://tmml.sourceforge.net/ for informations about TMML. 4 | 5 | The HTML files and man pages are created from the TMML sources. 6 | 7 | To process the TMML files you need: 8 | 9 | o tDOM 10 | 11 | tDOM must be already successfully installed. 12 | 13 | o TMML 14 | 15 | VERY IMPORTANT: Make sure, you have the current CVS HEAD of 16 | TMML. The latest TMML distribution dates from August 2000 and could 17 | not used for the steps, described below. Informations about how to 18 | get TMML CVS HEAD could be found at 19 | http://sourceforge.net/cvs/?group_id=16386 20 | 21 | You only need to check out the actual version of TMML, no further 22 | installation or modification is needed. 23 | 24 | o tcllib 25 | 26 | The TMML tools uses a module out of tcllib. Any recent distribution 27 | should do. If you really don't have it already, it's worth to 28 | install it, regardless of this TMML stuff. Installation should be 29 | completely painless. Find it at 30 | http://sourceforge.net/project/showfiles.php?group_id=12883 31 | 32 | If you have all requirements in place, just do: 33 | 34 | tclsh path/to/your/tmml/tools/tmml.tcl toman dom.xml ?domDoc.xml ...? 35 | 36 | This creates nroff man pages of the accordingly documentation in the sub dir 37 | man (which will be automatically created, if it doesn't exist.) 38 | 39 | The next command creates the HTML pages: 40 | 41 | tclsh path/to/your/tmml/tools/tmml.tcl tohtml dom.xml ?domDoc.xml ...? 42 | 43 | This creates the HTML pages in the html sub dir (also, will be 44 | created, if needed). 45 | 46 | And you may do 47 | 48 | tclsh path/to/your/tmml/tools/tmml.tcl navpages 49 | 50 | This will create an index.html, the category-index.html and the 51 | keyword-index.html for the HTML version of the documentation. 52 | -------------------------------------------------------------------------------- /doc/category-index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/category-index.html -------------------------------------------------------------------------------- /doc/dom.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/dom.html -------------------------------------------------------------------------------- /doc/domDoc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/domDoc.html -------------------------------------------------------------------------------- /doc/domNode.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/domNode.html -------------------------------------------------------------------------------- /doc/expat.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/expat.html -------------------------------------------------------------------------------- /doc/expatapi.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/expatapi.html -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/index.html -------------------------------------------------------------------------------- /doc/keyword-index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/keyword-index.html -------------------------------------------------------------------------------- /doc/manpage.css: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: manpage.css,v 1.4 2002/06/20 00:44:17 jenglish Exp $ 3 | * Author: Joe English, 4 | * Created: 26 Jun 2000 5 | * Description: CSS stylesheet for TCL man pages 6 | */ 7 | 8 | HTML { 9 | background: #FFFFFF; 10 | color: black; 11 | } 12 | 13 | BODY { 14 | background: #FFFFFF; 15 | color: black; 16 | } 17 | 18 | DIV.body { 19 | margin-left: 10%; 20 | margin-right: 10%; 21 | } 22 | DIV.header,DIV.footer { 23 | width: 100%; 24 | margin-left: 0%; 25 | margin-right: 0%; 26 | } 27 | 28 | DIV.body H1,DIV.body H2 { 29 | margin-left: -5%; 30 | } 31 | 32 | /* Navigation material: */ 33 | 34 | DIV.navbar { 35 | width: 100%; 36 | margin-top: 5pt; 37 | margin-bottom: 5pt; 38 | margin-left: 0%; 39 | margin-right: 0%; 40 | padding-top: 5pt; 41 | padding-bottom: 5pt; 42 | background: #DDDDDD; 43 | color: black; 44 | border: 1px solid black; 45 | text-align: center; 46 | font-size: small; 47 | font-family: sans-serif; 48 | } 49 | 50 | P.navaid { 51 | text-align: center; 52 | } 53 | .navaid { 54 | font-size: small; 55 | font-family: sans-serif; 56 | } 57 | 58 | A.navaid:link { color: green; background: transparent; } 59 | A.navaid:visited { color: green; background: transparent; } 60 | A.navaid:active { color: yellow; background: transparent; } 61 | 62 | /* For most anchors, we should leave colors up to the user's preferences. */ 63 | /*-- 64 | A:link { color: blue; background: transparent; } 65 | A:visited { color: purple; background: transparent; } 66 | A:active { color: red; background: transparent; } 67 | --*/ 68 | 69 | H1, H2, H3, H4 { 70 | margin-top: 1em; 71 | font-family: sans-serif; 72 | font-size: large; 73 | color: #005A9C; 74 | background: transparent; 75 | text-align: left; 76 | } 77 | 78 | H1.title { 79 | text-align: center; 80 | } 81 | 82 | UL,OL { 83 | margin-right: 0em; 84 | margin-top: 3pt; 85 | margin-bottom: 3pt; 86 | } 87 | UL LI { 88 | list-style: disc; 89 | } 90 | OL LI { 91 | list-style: decimal; 92 | } 93 | 94 | DT { 95 | padding-top: 1ex; 96 | } 97 | 98 | DL.toc { 99 | font: normal 12pt/16pt sans-serif; 100 | margin-left: 10%; 101 | } 102 | 103 | UL.toc,UL.toc UL, UL.toc UL UL { 104 | font: normal 12pt/14pt serif; 105 | list-style: none; 106 | } 107 | LI.tocentry,LI.tocheading { 108 | list-style: none; 109 | margin-left: 0em; 110 | text-indent: 0em; 111 | padding: 0em; 112 | } 113 | 114 | .tocheading { 115 | font-family: sans-serif; 116 | font-weight: bold; 117 | color: #005A9C; 118 | background: transparent; 119 | } 120 | 121 | PRE { 122 | display: block; 123 | font-family: monospace; 124 | white-space: pre; 125 | margin: 0%; 126 | padding-top: 0.5ex; 127 | padding-bottom: 0.5ex; 128 | padding-left: 1ex; 129 | padding-right: 1ex; 130 | width: 100%; 131 | } 132 | PRE.syntax { 133 | color: black; 134 | background: #80ffff; 135 | border: 1px solid black; 136 | font-family: serif; 137 | } 138 | PRE.example { 139 | color: black; 140 | background: #f5dcb3; 141 | border: 1px solid black; 142 | } 143 | 144 | DIV.arglist { 145 | border: 1px solid black; 146 | width: 100%; 147 | } 148 | TH, THEAD TR, TR.heading { 149 | color: #005A9C; 150 | background: #DDDDDD; 151 | text-align: center; 152 | font-family: sans-serif; 153 | font-weight: bold; 154 | } 155 | TR.syntax { 156 | color: black; 157 | background: #80ffff; 158 | } 159 | TR.desc { 160 | color: black; 161 | background: #f5dcb3; 162 | } 163 | 164 | /* TR.row[01] are used to get alternately colored table rows. 165 | * Could probably choose better colors here... 166 | */ 167 | TR.row0 { 168 | color: black; 169 | background: #efffef; 170 | } 171 | 172 | TR.row1 { 173 | color: black; 174 | background: #efefff; 175 | } 176 | 177 | /* Workaround for Netscape bugs: 178 | * Netscape doesn't seem to compute table widths properly. 179 | * unless they're wrapped inside a DIV. (Additionally, 180 | * it appears to require a non-zero border-width.) 181 | */ 182 | DIV.table { 183 | border-width: 1px; 184 | border-color: white; 185 | width: 100%; 186 | } 187 | DIV.menu { /* Wrapper for TABLE class="menu" */ 188 | margin-top: 10px; 189 | margin-bottom: 10px; 190 | border: thin solid #005A9C; 191 | width: 100%; 192 | margin-left: 5%; 193 | } 194 | 195 | VAR { 196 | font-style: italic; 197 | } 198 | 199 | /* For debugging: highlight unrecognized elements: */ 200 | .unrecognized { 201 | color: red; background: green; 202 | } 203 | 204 | /* EOF */ 205 | -------------------------------------------------------------------------------- /doc/tDOM.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ]> 10 | 11 | tDOM manual 12 | 13 | &dom; 14 | 15 | &domDoc; 16 | 17 | &domNode; 18 | 19 | &expat; 20 | 21 | &expatapi; 22 | 23 | &tdomcmd; 24 | 25 | &tnc; 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc/tdomcmd.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/tdomcmd.html -------------------------------------------------------------------------------- /doc/tdomcmd.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Generated from tdomcmd.xml 3 | '\" 4 | '\" BEGIN man.macros 5 | .if t .wh -1.3i ^B 6 | .nr ^l \n(.l 7 | .ad b 8 | .de AP 9 | .ie !"\\$4"" .TP \\$4 10 | .el \{\ 11 | . ie !"\\$2"" .TP \\n()Cu 12 | . el .TP 15 13 | .\} 14 | .ta \\n()Au \\n()Bu 15 | .ie !"\\$3"" \{\ 16 | \&\\$1 \\fI\\$2\\fP (\\$3) 17 | .\".b 18 | .\} 19 | .el \{\ 20 | .br 21 | .ie !"\\$2"" \{\ 22 | \&\\$1 \\fI\\$2\\fP 23 | .\} 24 | .el \{\ 25 | \&\\fI\\$1\\fP 26 | .\} 27 | .\} 28 | .. 29 | .de AS 30 | .nr )A 10n 31 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n 32 | .nr )B \\n()Au+15n 33 | .\" 34 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n 35 | .nr )C \\n()Bu+\\w'(in/out)'u+2n 36 | .. 37 | .AS Tcl_Interp Tcl_CreateInterp in/out 38 | .de BS 39 | .br 40 | .mk ^y 41 | .nr ^b 1u 42 | .if n .nf 43 | .if n .ti 0 44 | .if n \l'\\n(.lu\(ul' 45 | .if n .fi 46 | .. 47 | .de BE 48 | .nf 49 | .ti 0 50 | .mk ^t 51 | .ie n \l'\\n(^lu\(ul' 52 | .el \{\ 53 | .\" Draw four-sided box normally, but don't draw top of 54 | .\" box if the box started on an earlier page. 55 | .ie !\\n(^b-1 \{\ 56 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' 57 | .\} 58 | .el \}\ 59 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' 60 | .\} 61 | .\} 62 | .fi 63 | .br 64 | .nr ^b 0 65 | .. 66 | .de VS 67 | .if !"\\$2"" .br 68 | .mk ^Y 69 | .ie n 'mc \s12\(br\s0 70 | .el .nr ^v 1u 71 | .. 72 | .de VE 73 | .ie n 'mc 74 | .el \{\ 75 | .ev 2 76 | .nf 77 | .ti 0 78 | .mk ^t 79 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' 80 | .sp -1 81 | .fi 82 | .ev 83 | .\} 84 | .nr ^v 0 85 | .. 86 | .de ^B 87 | .ev 2 88 | 'ti 0 89 | 'nf 90 | .mk ^t 91 | .if \\n(^b \{\ 92 | .\" Draw three-sided box if this is the box's first page, 93 | .\" draw two sides but no top otherwise. 94 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c 95 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c 96 | .\} 97 | .if \\n(^v \{\ 98 | .nr ^x \\n(^tu+1v-\\n(^Yu 99 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c 100 | .\} 101 | .bp 102 | 'fi 103 | .ev 104 | .if \\n(^b \{\ 105 | .mk ^y 106 | .nr ^b 2 107 | .\} 108 | .if \\n(^v \{\ 109 | .mk ^Y 110 | .\} 111 | .. 112 | .de DS 113 | .RS 114 | .nf 115 | .sp 116 | .. 117 | .de DE 118 | .fi 119 | .RE 120 | .sp 121 | .. 122 | .de SO 123 | .SH "STANDARD OPTIONS" 124 | .LP 125 | .nf 126 | .ta 5.5c 11c 127 | .ft B 128 | .. 129 | .de SE 130 | .fi 131 | .ft R 132 | .LP 133 | See the \\fBoptions\\fR manual entry for details on the standard options. 134 | .. 135 | .de OP 136 | .LP 137 | .nf 138 | .ta 4c 139 | Command-Line Name: \\fB\\$1\\fR 140 | Database Name: \\fB\\$2\\fR 141 | Database Class: \\fB\\$3\\fR 142 | .fi 143 | .IP 144 | .. 145 | .de CS 146 | .RS 147 | .nf 148 | .ta .25i .5i .75i 1i 149 | .if t .ft C 150 | .. 151 | .de CE 152 | .fi 153 | .if t .ft R 154 | .RE 155 | .. 156 | .de UL 157 | \\$1\l'|0\(ul'\\$2 158 | .. 159 | '\" END man.macros 160 | .TH tdom n "" Tcl "" 161 | .BS 162 | .SH NAME 163 | tdom \- tdom is an expat parser object extension to create an in-memory 164 | DOM tree from the input while parsing. 165 | .SH SYNOPSIS 166 | .nf 167 | package require tdom 168 | 169 | set parser [expat] 170 | 171 | tdom $parser enable 172 | .fi 173 | .BE 174 | .SH DESCRIPTION 175 | .PP 176 | \&\fItdom\fR adds the C handler set "tdom" to an tcl expat 177 | parser obj. This handler set builds an in-memory DOM tree out of the input, 178 | parsed by the parser. A DOM tree created this way behave exactly like a DOM 179 | tree created by the "dom" command (see there). In fact, tdom is only 180 | another interface to the same functionality; it uses the code behind the 181 | \&\fBdom\fR code for building the DOM tree. 182 | .TP 183 | \&\fB\fBtdom\fP \fIparserObj\fB \fBenable\fP 184 | \&\fR 185 | .RS 186 | .PP 187 | Adds the tdom C handler set to a Tcl expat parser object. Next 188 | time, the parser parses input, the tdom C handler functions create an in-memory 189 | DOM tree. 190 | .RE 191 | .TP 192 | \&\fB\fBtdom\fP \fIparserObj\fB \fBgetdoc\fP 193 | \&\fR 194 | .RS 195 | .PP 196 | Returns the DOM tree as domDoc (see there) object. 197 | .RE 198 | .TP 199 | \&\fB\fBtdom\fP \fIparserObj\fB \fBsetResultEncoding\fP 200 | \&\fR 201 | .RS 202 | .PP 203 | See the method \fBsetResultEncoding\fR of the 204 | \&\fBdom\fP command. 205 | .RE 206 | .TP 207 | \&\fB\fBtdom\fP \fIparserObj\fB \fBsetStoreLineColumn\fP ?\fIboolean\fB? 208 | \&\fR 209 | .RS 210 | .PP 211 | See the method \fBsetStoreLineColumn\fR of the 212 | \&\fBdom\fP command. 213 | .RE 214 | .TP 215 | \&\fB\fBtdom\fP \fIparserObj\fB \fBremove\fP 216 | \&\fR 217 | .RS 218 | .PP 219 | Removes the tdom C handler set from the parser 220 | object. 221 | .RE 222 | .TP 223 | \&\fB\fBtdom\fP \fIparserObj\fB \fBkeepEmpties\fP 224 | \&\fR 225 | .RS 226 | .PP 227 | See the option \fB-keepEmpties\fR of the \fBdom\fP command. 228 | .RE 229 | .TP 230 | \&\fB\fBtdom\fP \fIparserObj\fB \fBsetExternalEntityResolver\fP \fIscript\fB 231 | \&\fR 232 | .SH "SEE ALSO" 233 | dom, expat 234 | .SH KEYWORDS 235 | DOM, SAX, C handler set 236 | -------------------------------------------------------------------------------- /doc/tdomcmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tdom 4 | 5 | tdom is an expat parser object extension to create an in-memory 6 | DOM tree from the input while parsing. 7 | 8 | 9 | 10 | 11 | package require tdom 12 | 13 | set parser [expat] 14 | 15 | tdom $parser enable 16 | 17 | 18 |
19 | DESCRIPTION 20 | 21 |

tdom adds the C handler set "tdom" to an tcl expat 22 | parser obj. This handler set builds an in-memory DOM tree out of the input, 23 | parsed by the parser. A DOM tree created this way behave exactly like a DOM 24 | tree created by the "dom" command (see there). In fact, tdom is only 25 | another interface to the same functionality; it uses the code behind the 26 | dom code for building the DOM tree.

27 | 28 | 29 | 30 | tdom parserObj enable 31 | 32 |

Adds the tdom C handler set to a Tcl expat parser object. Next 33 | time, the parser parses input, the tdom C handler functions create an in-memory 34 | DOM tree.

35 |
36 | 37 | 38 | tdom parserObj getdoc 39 | 40 |

Returns the DOM tree as domDoc (see there) object.

41 |
42 | 43 | 44 | tdom parserObj setResultEncoding 45 | 46 |

See the method setResultEncoding of the 47 | dom command.

48 |
49 | 50 | 51 | tdom parserObj setStoreLineColumn ?boolean? 52 | 53 |

See the method setStoreLineColumn of the 54 | dom command.

55 |
56 | 57 | 58 | tdom parserObj remove 59 | 60 |

Removes the tdom C handler set from the parser 61 | object.

62 |
63 | 64 | 65 | tdom parserObj keepEmpties 66 | 67 |

See the option -keepEmpties of the dom command.

68 |
69 | 70 | 71 | tdom parserObj setExternalEntityResolver script 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | dom 80 | expat 81 | 82 | 83 | 84 | DOM 85 | SAX 86 | C handler set 87 | 88 | 89 |
90 | 91 | 92 | -------------------------------------------------------------------------------- /doc/tmml.options: -------------------------------------------------------------------------------- 1 | array set Options { 2 | xsltProcessor tdom 3 | masterDocument "tDOM.xml" 4 | tomanOptions -soelim 5 | htmlDirectory . 6 | nroffDirectory . 7 | } 8 | -------------------------------------------------------------------------------- /doc/tnc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/doc/tnc.html -------------------------------------------------------------------------------- /doc/tnc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tnc 4 | tnc is an expat parser object extension, that validates the XML 5 | stream against the document DTD while parsing. 6 | 7 | 8 | 9 | package require tdom 10 | package require tnc 11 | 12 | set parser [expat] 13 | 14 | tnc $parser enable 15 | 16 | 17 |
18 | DESCRIPTION 19 | 20 |

tnc adds the C handler set "tnc" to a tcl expat parser 21 | obj. This handler set is a simple DTD validator. If the validator detects a 22 | validation error, it sets the interp result, signals error and stops 23 | parsing. There isn't any validation error recovering. As a consequence, only 24 | valid documents are completely parsed.

25 | 26 |

This handler set has only three methods:

27 | 28 | 29 | 30 | tnc parserObj enable 31 | 32 |

Adds the tnc C handler set to a Tcl expat parser object.

33 |
34 | 35 | 36 | tnc parserObj remove 37 | 38 |

Removes the tnc validatore from the parser parserObj 39 | and frees all information, stored by it.

40 |
41 | 42 | 43 | tnc parserObj getValidateCmd 44 | 45 |

Returns a new created validation command, if one is avaliable 46 | from the parser command, otherwise it signals error. The name of the validation 47 | command is the validateCmdName, if this optional argument was given, or 48 | a random choosen name. A validation command is avaliable in a parser command, 49 | if the parser with tnc enabled was previously used, to parse an XML document 50 | with a valid doctype declaration, a valid external subset, if one was given by 51 | the doctype declaration, and a valid internal subset. The further document 52 | doesn't need to be valid, to make the validation command avaliable. The 53 | validation command can only get received one time from the parser command. The 54 | created validation command has this syntax:

55 | 56 | validationCmd method ?args? 57 | 58 |

The valid methods are:

59 | 60 | 61 | 62 | validateDocument domDocument ?varName? 63 | Checks, if the given domDocument is valid against the DTD 64 | information represented by the validation command. Returns 1, if the document 65 | ist valid, 0 otherwise. If the varName argument is given, then the 66 | variable it names is set to the detected reason for the validation error or to 67 | the empty string in case of a valid document. 68 | 69 | 70 | 71 | validateTree elementNode ?varName? 72 | 73 | Checks, if the given subtree with domNode as root element 74 | is a posible valid subtree of a document conforming to the DTD information 75 | represented by teh validation command. IDREF could not checked, while 76 | validating only a subtree, but it is checked, that every known ID attribute in 77 | the subtree is unique. Returns 1, if the subtree is OK, 0 otherwise. If the 78 | varName argument is given, then the variable it names is set to the 79 | detected reason for the validation error or to the empty string in case of 80 | a valid subtree. 81 | 82 | 83 | 84 | 85 | validateAttributes elementNode ?varName? 86 | 87 | Checks, if there is an element declaration for the name of the 88 | elementNode in the DTD represented by the validation command and, if 89 | yes, if the attributes of the elementNode are conform to the ATTLIST 90 | declarations for that element in the DTD. Returns 1, if the attributes and 91 | there value types are OK, 0 otherwise. If the varName argument is given, 92 | then the variable it names is set to the detected reason for the validation 93 | error or to the empty string in case the element has all its required 94 | attributes, only declared attributes and the values of the attributes matches 95 | there type. 96 | 97 | 98 | 99 | 100 | delete 101 | Deletes the validation command and frees the memory used by 102 | it. Returns the empty string. 103 | 104 | 105 | 106 |
107 |
108 |
109 |
110 | 111 |
112 | BUGS 113 | 114 |

The validation error reports could be much more informative and 115 | user-friendly.

116 | 117 |

The validator doesn't detect ambiguous content models (see XML 118 | recomendation Section 3.2.1 and Appendix E). Most Java validators also doesn't, 119 | but handle such content models right anyhow. Tnc does not; if your DTD has 120 | such ambiguous content models, tnc can not used to validate documents against 121 | such (not completely XML spec compliant) DTDs.

122 | 123 |

It isn't possible to validate XML documents with standalone="yes" in the 124 | XML Declaration

125 | 126 |

Violations of the validity constraints Proper Group/PE Nesting and 127 | Proper Conditional Section/PE Nesting are not detected. They could only happen 128 | inside a invalid DTD, not in the content of a document.

129 | 130 |
131 | 132 | Validation 133 | DTD 134 | 135 | 136 |
137 | -------------------------------------------------------------------------------- /encodings/ascii.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: ascii, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E0000 13 | 0000000000000000000000000000000000000000000000000000000000000000 14 | 0000000000000000000000000000000000000000000000000000000000000000 15 | 0000000000000000000000000000000000000000000000000000000000000000 16 | 0000000000000000000000000000000000000000000000000000000000000000 17 | 0000000000000000000000000000000000000000000000000000000000000000 18 | 0000000000000000000000000000000000000000000000000000000000000000 19 | 0000000000000000000000000000000000000000000000000000000000000000 20 | 0000000000000000000000000000000000000000000000000000000000000000 21 | -------------------------------------------------------------------------------- /encodings/cp1250.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1250, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00800081201A0083201E2026202020210088203001602039015A0164017D0179 14 | 009020182019201C201D202220132014009821220161203A015B0165017E017A 15 | 00A002C702D8014100A4010400A600A700A800A9015E00AB000000AD00AE017B 16 | 00B000B102DB014200B400B500B600B700B80105015F00BB013D02DD013E017C 17 | 015400C100C2010200C40139010600C7010C00C9011800CB011A00CD00CE010E 18 | 01100143014700D300D4015000D600D70158016E00DA017000DC00DD016200DF 19 | 015500E100E2010300E4013A010700E7010D00E9011900EB011B00ED00EE010F 20 | 01110144014800F300F4015100F600F70159016F00FA017100FC00FD016302D9 21 | -------------------------------------------------------------------------------- /encodings/cp1251.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1251, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 04020403201A0453201E2026202020210088203004092039040A040C040B040F 14 | 045220182019201C201D202220132014009821220459203A045A045C045B045F 15 | 00A0040E045E040800A4049000A600A7040100A9040400AB00AC00AD00AE0407 16 | 00B000B104060456049100B500B600B704512116045400BB0458040504550457 17 | 0410041104120413041404150416041704180419041A041B041C041D041E041F 18 | 0420042104220423042404250426042704280429042A042B042C042D042E042F 19 | 0430043104320433043404350436043704380439043A043B043C043D043E043F 20 | 0440044104420443044404450446044704480449044A044B044C044D044E044F 21 | -------------------------------------------------------------------------------- /encodings/cp1252.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1252, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00800081201A0192201E20262020202102C62030016020390152008D008E008F 14 | 009020182019201C201D20222013201402DC21220161203A0153009D009E0178 15 | 00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF 17 | 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF 18 | 00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF 19 | 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF 20 | 00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF 21 | -------------------------------------------------------------------------------- /encodings/cp1253.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1253, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00800081201A0192201E20262020202100882030008A2039008C008D008E008F 14 | 009020182019201C201D20222013201400982122009A203A009C009D009E009F 15 | 00A00385038600A300A400A500A600A700A800A9000000AB00AC00AD00AE2015 16 | 00B000B100B200B3038400B500B600B703880389038A00BB038C00BD038E038F 17 | 0390039103920393039403950396039703980399039A039B039C039D039E039F 18 | 03A003A1000003A303A403A503A603A703A803A903AA03AB03AC03AD03AE03AF 19 | 03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF 20 | 03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE0000 21 | -------------------------------------------------------------------------------- /encodings/cp1254.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1254, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00800081201A0192201E20262020202102C62030016020390152008D008E008F 14 | 009020182019201C201D20222013201402DC21220161203A0153009D009E0178 15 | 00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF 17 | 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF 18 | 011E00D100D200D300D400D500D600D700D800D900DA00DB00DC0130015E00DF 19 | 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF 20 | 011F00F100F200F300F400F500F600F700F800F900FA00FB00FC0131015F00FF 21 | -------------------------------------------------------------------------------- /encodings/cp1255.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1255, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00800081201A0192201E20262020202102C62030008A2039008C008D008E008F 14 | 009020182019201C201D20222013201402DC2122009A203A009C009D009E009F 15 | 00A0000000A200A320AA00A500A600A700A800A9000000AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B7000000B9000000BB00BC00BD00BE0000 17 | 05B005B105B205B305B405B505B605B705B805B905BA05BB05BC05BD05BE05BF 18 | 05C005C105C205C305F005F105F2000000000000000000000000000000000000 19 | 05D005D105D205D305D405D505D605D705D805D905DA05DB05DC05DD05DE05DF 20 | 05E005E105E205E305E405E505E605E705E805E905EA00000000200E200F0000 21 | -------------------------------------------------------------------------------- /encodings/cp1256.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp1256, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080067E201A0192201E20262020202102C62030008A2039015206860698008F 14 | 06AF20182019201C201D20222013201400982122009A203A0153200C200D009F 15 | 00A0060C00A200A300A400A500A600A700A800A9000000AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B700B800B9061B00BB00BC00BD00BE061F 17 | 0000062106220623062406250626062706280629062A062B062C062D062E062F 18 | 063006310632063306340635063600D7063706380639063A0640064106420643 19 | 00E0064400E2064506460647064800E700E800E900EA00EB0649064A00EE00EF 20 | 064B064C064D064E00F4064F065000F7065100F9065200FB00FC200E200F0000 21 | -------------------------------------------------------------------------------- /encodings/cp437.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp437, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 14 | 00C900E600C600F400F600F200FB00F900FF00D600DC00A200A300A520A70192 15 | 00E100ED00F300FA00F100D100AA00BA00BF231000AC00BD00BC00A100AB00BB 16 | 259125922593250225242561256225562555256325512557255D255C255B2510 17 | 25142534252C251C2500253C255E255F255A25542569256625602550256C2567 18 | 2568256425652559255825522553256B256A2518250C25882584258C25902580 19 | 03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229 20 | 226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0 21 | -------------------------------------------------------------------------------- /encodings/cp850.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: cp850, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 00C700FC00E900E200E400E000E500E700EA00EB00E800EF00EE00EC00C400C5 14 | 00C900E600C600F400F600F200FB00F900FF00D600DC00F800A300D800D70192 15 | 00E100ED00F300FA00F100D100AA00BA00BF00AE00AC00BD00BC00A100AB00BB 16 | 2591259225932502252400C100C200C000A9256325512557255D00A200A52510 17 | 25142534252C251C2500253C00E300C3255A25542569256625602550256C00A4 18 | 00F000D000CA00CB00C8013100CD00CE00CF2518250C2588258400A600CC2580 19 | 00D300DF00D400D200F500D500B500FE00DE00DA00DB00D900FD00DD00AF00B4 20 | 00AD00B1201700BE00B600A700F700B800B000A800B700B900B300B225A000A0 21 | -------------------------------------------------------------------------------- /encodings/iso8859-1.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-1, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF 17 | 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF 18 | 00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF 19 | 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF 20 | 00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF 21 | -------------------------------------------------------------------------------- /encodings/iso8859-2.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-2, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A0010402D8014100A4013D015A00A700A80160015E0164017900AD017D017B 16 | 00B0010502DB014200B4013E015B02C700B80161015F0165017A02DD017E017C 17 | 015400C100C2010200C40139010600C7010C00C9011800CB011A00CD00CE010E 18 | 01100143014700D300D4015000D600D70158016E00DA017000DC00DD016200DF 19 | 015500E100E2010300E4013A010700E7010D00E9011900EB011B00ED00EE010F 20 | 01110144014800F300F4015100F600F70159016F00FA017100FC00FD016302D9 21 | -------------------------------------------------------------------------------- /encodings/iso8859-3.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-3, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A0012602D800A300A40000012400A700A80130015E011E013400AD0000017B 16 | 00B0012700B200B300B400B5012500B700B80131015F011F013500BD0000017C 17 | 00C000C100C2000000C4010A010800C700C800C900CA00CB00CC00CD00CE00CF 18 | 000000D100D200D300D4012000D600D7011C00D900DA00DB00DC016C015C00DF 19 | 00E000E100E2000000E4010B010900E700E800E900EA00EB00EC00ED00EE00EF 20 | 000000F100F200F300F4012100F600F7011D00F900FA00FB00FC016D015D02D9 21 | -------------------------------------------------------------------------------- /encodings/iso8859-4.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-4, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A001040138015600A40128013B00A700A8016001120122016600AD017D00AF 16 | 00B0010502DB015700B40129013C02C700B80161011301230167014A017E014B 17 | 010000C100C200C300C400C500C6012E010C00C9011800CB011600CD00CE012A 18 | 01100145014C013600D400D500D600D700D8017200DA00DB00DC0168016A00DF 19 | 010100E100E200E300E400E500E6012F010D00E9011900EB011700ED00EE012B 20 | 01110146014D013700F400F500F600F700F8017300FA00FB00FC0169016B02D9 21 | -------------------------------------------------------------------------------- /encodings/iso8859-5.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-5, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A0040104020403040404050406040704080409040A040B040C00AD040E040F 16 | 0410041104120413041404150416041704180419041A041B041C041D041E041F 17 | 0420042104220423042404250426042704280429042A042B042C042D042E042F 18 | 0430043104320433043404350436043704380439043A043B043C043D043E043F 19 | 0440044104420443044404450446044704480449044A044B044C044D044E044F 20 | 2116045104520453045404550456045704580459045A045B045C00A7045E045F 21 | -------------------------------------------------------------------------------- /encodings/iso8859-6.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-6, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0660066106620663066406650666066706680669003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A000000000000000A40000000000000000000000000000060C00AD00000000 16 | 00000000000000000000000000000000000000000000061B000000000000061F 17 | 0000062106220623062406250626062706280629062A062B062C062D062E062F 18 | 0630063106320633063406350636063706380639063A00000000000000000000 19 | 0640064106420643064406450646064706480649064A064B064C064D064E064F 20 | 0650065106520000000000000000000000000000000000000000000000000000 21 | -------------------------------------------------------------------------------- /encodings/iso8859-7.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-7, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A002BD02BC00A30000000000A600A700A800A9000000AB00AC00AD00002015 16 | 00B000B100B200B303840385038600B703880389038A00BB038C00BD038E038F 17 | 0390039103920393039403950396039703980399039A039B039C039D039E039F 18 | 03A003A1000003A303A403A503A603A703A803A903AA03AB03AC03AD03AE03AF 19 | 03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF 20 | 03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE0000 21 | -------------------------------------------------------------------------------- /encodings/iso8859-8.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-8, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A0000000A200A300A400A500A600A700A800A900D700AB00AC00AD00AE203E 16 | 00B000B100B200B300B400B500B600B700B800B900F700BB00BC00BD00BE0000 17 | 0000000000000000000000000000000000000000000000000000000000000000 18 | 0000000000000000000000000000000000000000000000000000000000002017 19 | 05D005D105D205D305D405D505D605D705D805D905DA05DB05DC05DD05DE05DF 20 | 05E005E105E205E305E405E505E605E705E805E905EA00000000000000000000 21 | -------------------------------------------------------------------------------- /encodings/iso8859-9.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: iso8859-9, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 0080008100820083008400850086008700880089008A008B008C008D008E008F 14 | 0090009100920093009400950096009700980099009A009B009C009D009E009F 15 | 00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF 16 | 00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF 17 | 00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF 18 | 011E00D100D200D300D400D500D600D700D800D900DA00DB00DC0130015E00DF 19 | 00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF 20 | 011F00F100F200F300F400F500F600F700F800F900FA00FB00FC0131015F00FF 21 | -------------------------------------------------------------------------------- /encodings/koi8-r.enc: -------------------------------------------------------------------------------- 1 | # Encoding file: koi8-r, single-byte 2 | S 3 | 003F 0 1 4 | 00 5 | 0000000100020003000400050006000700080009000A000B000C000D000E000F 6 | 0010001100120013001400150016001700180019001A001B001C001D001E001F 7 | 0020002100220023002400250026002700280029002A002B002C002D002E002F 8 | 0030003100320033003400350036003700380039003A003B003C003D003E003F 9 | 0040004100420043004400450046004700480049004A004B004C004D004E004F 10 | 0050005100520053005400550056005700580059005A005B005C005D005E005F 11 | 0060006100620063006400650066006700680069006A006B006C006D006E006F 12 | 0070007100720073007400750076007700780079007A007B007C007D007E007F 13 | 25002502250C251025142518251C2524252C2534253C258025842588258C2590 14 | 259125922593232025A02219221A22482264226500A0232100B000B200B700F7 15 | 25502551255204512553255425552556255725582559255A255B255C255D255E 16 | 255F25602561040125622563256425652566256725682569256A256B256C00A9 17 | 044E0430043104460434043504440433044504380439043A043B043C043D043E 18 | 043F044F044004410442044304360432044C044B04370448044D04490447044A 19 | 042E0410041104260414041504240413042504180419041A041B041C041D041E 20 | 041F042F042004210422042304160412042C042B04170428042D04290427042A 21 | -------------------------------------------------------------------------------- /expat/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | and Clark Cooper 3 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /expat/VERSION: -------------------------------------------------------------------------------- 1 | expat-2.1.0 2 | -------------------------------------------------------------------------------- /expat/amigaconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef AMIGACONFIG_H 2 | #define AMIGACONFIG_H 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 4321 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #undef HAVE_CHECK_H 12 | 13 | /* Define to 1 if you have the `memmove' function. */ 14 | #define HAVE_MEMMOVE 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_UNISTD_H 1 18 | 19 | /* whether byteorder is bigendian */ 20 | #define WORDS_BIGENDIAN 21 | 22 | /* Define to specify how much context to retain around the current parse 23 | point. */ 24 | #define XML_CONTEXT_BYTES 1024 25 | 26 | /* Define to make parameter entity parsing functionality available. */ 27 | #define XML_DTD 28 | 29 | /* Define to make XML Namespaces functionality available. */ 30 | #define XML_NS 31 | 32 | #endif /* AMIGACONFIG_H */ 33 | -------------------------------------------------------------------------------- /expat/ascii.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define ASCII_A 0x41 6 | #define ASCII_B 0x42 7 | #define ASCII_C 0x43 8 | #define ASCII_D 0x44 9 | #define ASCII_E 0x45 10 | #define ASCII_F 0x46 11 | #define ASCII_G 0x47 12 | #define ASCII_H 0x48 13 | #define ASCII_I 0x49 14 | #define ASCII_J 0x4A 15 | #define ASCII_K 0x4B 16 | #define ASCII_L 0x4C 17 | #define ASCII_M 0x4D 18 | #define ASCII_N 0x4E 19 | #define ASCII_O 0x4F 20 | #define ASCII_P 0x50 21 | #define ASCII_Q 0x51 22 | #define ASCII_R 0x52 23 | #define ASCII_S 0x53 24 | #define ASCII_T 0x54 25 | #define ASCII_U 0x55 26 | #define ASCII_V 0x56 27 | #define ASCII_W 0x57 28 | #define ASCII_X 0x58 29 | #define ASCII_Y 0x59 30 | #define ASCII_Z 0x5A 31 | 32 | #define ASCII_a 0x61 33 | #define ASCII_b 0x62 34 | #define ASCII_c 0x63 35 | #define ASCII_d 0x64 36 | #define ASCII_e 0x65 37 | #define ASCII_f 0x66 38 | #define ASCII_g 0x67 39 | #define ASCII_h 0x68 40 | #define ASCII_i 0x69 41 | #define ASCII_j 0x6A 42 | #define ASCII_k 0x6B 43 | #define ASCII_l 0x6C 44 | #define ASCII_m 0x6D 45 | #define ASCII_n 0x6E 46 | #define ASCII_o 0x6F 47 | #define ASCII_p 0x70 48 | #define ASCII_q 0x71 49 | #define ASCII_r 0x72 50 | #define ASCII_s 0x73 51 | #define ASCII_t 0x74 52 | #define ASCII_u 0x75 53 | #define ASCII_v 0x76 54 | #define ASCII_w 0x77 55 | #define ASCII_x 0x78 56 | #define ASCII_y 0x79 57 | #define ASCII_z 0x7A 58 | 59 | #define ASCII_0 0x30 60 | #define ASCII_1 0x31 61 | #define ASCII_2 0x32 62 | #define ASCII_3 0x33 63 | #define ASCII_4 0x34 64 | #define ASCII_5 0x35 65 | #define ASCII_6 0x36 66 | #define ASCII_7 0x37 67 | #define ASCII_8 0x38 68 | #define ASCII_9 0x39 69 | 70 | #define ASCII_TAB 0x09 71 | #define ASCII_SPACE 0x20 72 | #define ASCII_EXCL 0x21 73 | #define ASCII_QUOT 0x22 74 | #define ASCII_AMP 0x26 75 | #define ASCII_APOS 0x27 76 | #define ASCII_MINUS 0x2D 77 | #define ASCII_PERIOD 0x2E 78 | #define ASCII_COLON 0x3A 79 | #define ASCII_SEMI 0x3B 80 | #define ASCII_LT 0x3C 81 | #define ASCII_EQUALS 0x3D 82 | #define ASCII_GT 0x3E 83 | #define ASCII_LSQB 0x5B 84 | #define ASCII_RSQB 0x5D 85 | #define ASCII_UNDERSCORE 0x5F 86 | #define ASCII_LPAREN 0x28 87 | #define ASCII_RPAREN 0x29 88 | #define ASCII_FF 0x0C 89 | #define ASCII_SLASH 0x2F 90 | #define ASCII_HASH 0x23 91 | #define ASCII_PIPE 0x7C 92 | #define ASCII_COMMA 0x2C 93 | -------------------------------------------------------------------------------- /expat/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /expat/expat_external.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef Expat_External_INCLUDED 6 | #define Expat_External_INCLUDED 1 7 | 8 | /* External API definitions */ 9 | 10 | #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) 11 | #define XML_USE_MSC_EXTENSIONS 1 12 | #endif 13 | 14 | /* Expat tries very hard to make the API boundary very specifically 15 | defined. There are two macros defined to control this boundary; 16 | each of these can be defined before including this header to 17 | achieve some different behavior, but doing so it not recommended or 18 | tested frequently. 19 | 20 | XMLCALL - The calling convention to use for all calls across the 21 | "library boundary." This will default to cdecl, and 22 | try really hard to tell the compiler that's what we 23 | want. 24 | 25 | XMLIMPORT - Whatever magic is needed to note that a function is 26 | to be imported from a dynamically loaded library 27 | (.dll, .so, or .sl, depending on your platform). 28 | 29 | The XMLCALL macro was added in Expat 1.95.7. The only one which is 30 | expected to be directly useful in client code is XMLCALL. 31 | 32 | Note that on at least some Unix versions, the Expat library must be 33 | compiled with the cdecl calling convention as the default since 34 | system headers may assume the cdecl convention. 35 | */ 36 | #ifndef XMLCALL 37 | #if defined(_MSC_VER) 38 | #define XMLCALL __cdecl 39 | #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) 40 | #define XMLCALL __attribute__((cdecl)) 41 | #else 42 | /* For any platform which uses this definition and supports more than 43 | one calling convention, we need to extend this definition to 44 | declare the convention used on that platform, if it's possible to 45 | do so. 46 | 47 | If this is the case for your platform, please file a bug report 48 | with information on how to identify your platform via the C 49 | pre-processor and how to specify the same calling convention as the 50 | platform's malloc() implementation. 51 | */ 52 | #define XMLCALL 53 | #endif 54 | #endif /* not defined XMLCALL */ 55 | 56 | 57 | #if !defined(XML_STATIC) && !defined(XMLIMPORT) 58 | #ifndef XML_BUILDING_EXPAT 59 | /* using Expat from an application */ 60 | 61 | #ifdef XML_USE_MSC_EXTENSIONS 62 | #define XMLIMPORT __declspec(dllimport) 63 | #endif 64 | 65 | #endif 66 | #endif /* not defined XML_STATIC */ 67 | 68 | 69 | /* If we didn't define it above, define it away: */ 70 | #ifndef XMLIMPORT 71 | #define XMLIMPORT 72 | #endif 73 | 74 | 75 | #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL 76 | 77 | #ifdef __cplusplus 78 | extern "C" { 79 | #endif 80 | 81 | #ifdef XML_UNICODE_WCHAR_T 82 | #define XML_UNICODE 83 | #endif 84 | 85 | #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ 86 | #ifdef XML_UNICODE_WCHAR_T 87 | typedef wchar_t XML_Char; 88 | typedef wchar_t XML_LChar; 89 | #else 90 | typedef unsigned short XML_Char; 91 | typedef char XML_LChar; 92 | #endif /* XML_UNICODE_WCHAR_T */ 93 | #else /* Information is UTF-8 encoded. */ 94 | typedef char XML_Char; 95 | typedef char XML_LChar; 96 | #endif /* XML_UNICODE */ 97 | 98 | #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ 99 | #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 100 | typedef __int64 XML_Index; 101 | typedef unsigned __int64 XML_Size; 102 | #else 103 | typedef long long XML_Index; 104 | typedef unsigned long long XML_Size; 105 | #endif 106 | #else 107 | typedef long XML_Index; 108 | typedef unsigned long XML_Size; 109 | #endif /* XML_LARGE_SIZE */ 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif /* not Expat_External_INCLUDED */ 116 | -------------------------------------------------------------------------------- /expat/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /expat/internal.h: -------------------------------------------------------------------------------- 1 | /* internal.h 2 | 3 | Internal definitions used by Expat. This is not needed to compile 4 | client code. 5 | 6 | The following calling convention macros are defined for frequently 7 | called functions: 8 | 9 | FASTCALL - Used for those internal functions that have a simple 10 | body and a low number of arguments and local variables. 11 | 12 | PTRCALL - Used for functions called though function pointers. 13 | 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. 15 | 16 | inline - Used for selected internal functions for which inlining 17 | may improve performance on some platforms. 18 | 19 | Note: Use of these macros is based on judgement, not hard rules, 20 | and therefore subject to change. 21 | */ 22 | 23 | #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) 24 | /* We'll use this version by default only where we know it helps. 25 | 26 | regparm() generates warnings on Solaris boxes. See SF bug #692878. 27 | 28 | Instability reported with egcs on a RedHat Linux 7.3. 29 | Let's comment out: 30 | #define FASTCALL __attribute__((stdcall, regparm(3))) 31 | and let's try this: 32 | */ 33 | #define FASTCALL __attribute__((regparm(3))) 34 | #define PTRFASTCALL __attribute__((regparm(3))) 35 | #endif 36 | 37 | /* Using __fastcall seems to have an unexpected negative effect under 38 | MS VC++, especially for function pointers, so we won't use it for 39 | now on that platform. It may be reconsidered for a future release 40 | if it can be made more effective. 41 | Likely reason: __fastcall on Windows is like stdcall, therefore 42 | the compiler cannot perform stack optimizations for call clusters. 43 | */ 44 | 45 | /* Make sure all of these are defined if they aren't already. */ 46 | 47 | #ifndef FASTCALL 48 | #define FASTCALL 49 | #endif 50 | 51 | #ifndef PTRCALL 52 | #define PTRCALL 53 | #endif 54 | 55 | #ifndef PTRFASTCALL 56 | #define PTRFASTCALL 57 | #endif 58 | 59 | #ifndef XML_MIN_SIZE 60 | #if !defined(__cplusplus) && !defined(inline) 61 | #ifdef __GNUC__ 62 | #define inline __inline 63 | #endif /* __GNUC__ */ 64 | #endif 65 | #endif /* XML_MIN_SIZE */ 66 | 67 | #ifdef __cplusplus 68 | #define inline inline 69 | #else 70 | #ifndef inline 71 | #define inline 72 | #endif 73 | #endif 74 | -------------------------------------------------------------------------------- /expat/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /expat/macconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | ** 9 | */ 10 | 11 | #ifndef MACCONFIG_H 12 | #define MACCONFIG_H 13 | 14 | 15 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 16 | #define BYTEORDER 4321 17 | 18 | /* Define to 1 if you have the `bcopy' function. */ 19 | #undef HAVE_BCOPY 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #define HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have a working `mmap' system call. */ 25 | #undef HAVE_MMAP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* whether byteorder is bigendian */ 31 | #define WORDS_BIGENDIAN 32 | 33 | /* Define to specify how much context to retain around the current parse 34 | point. */ 35 | #undef XML_CONTEXT_BYTES 36 | 37 | /* Define to make parameter entity parsing functionality available. */ 38 | #define XML_DTD 39 | 40 | /* Define to make XML Namespaces functionality available. */ 41 | #define XML_NS 42 | 43 | /* Define to empty if `const' does not conform to ANSI C. */ 44 | #undef const 45 | 46 | /* Define to `long' if does not define. */ 47 | #define off_t long 48 | 49 | /* Define to `unsigned' if does not define. */ 50 | #undef size_t 51 | 52 | 53 | #endif /* ifndef MACCONFIG_H */ 54 | -------------------------------------------------------------------------------- /expat/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /expat/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | #define XML_NS 1 21 | #define XML_DTD 1 22 | #define XML_CONTEXT_BYTES 1024 23 | 24 | /* we will assume all Windows platforms are little endian */ 25 | #define BYTEORDER 1234 26 | 27 | /* Windows has memmove() available. */ 28 | #define HAVE_MEMMOVE 29 | 30 | #endif /* ndef WINCONFIG_H */ 31 | -------------------------------------------------------------------------------- /expat/xmlrole.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #ifndef XmlRole_INCLUDED 6 | #define XmlRole_INCLUDED 1 7 | 8 | #ifdef __VMS 9 | /* 0 1 2 3 0 1 2 3 10 | 1234567890123456789012345678901 1234567890123456789012345678901 */ 11 | #define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt 12 | #endif 13 | 14 | #include "xmltok.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | enum { 21 | XML_ROLE_ERROR = -1, 22 | XML_ROLE_NONE = 0, 23 | XML_ROLE_XML_DECL, 24 | XML_ROLE_INSTANCE_START, 25 | XML_ROLE_DOCTYPE_NONE, 26 | XML_ROLE_DOCTYPE_NAME, 27 | XML_ROLE_DOCTYPE_SYSTEM_ID, 28 | XML_ROLE_DOCTYPE_PUBLIC_ID, 29 | XML_ROLE_DOCTYPE_INTERNAL_SUBSET, 30 | XML_ROLE_DOCTYPE_CLOSE, 31 | XML_ROLE_GENERAL_ENTITY_NAME, 32 | XML_ROLE_PARAM_ENTITY_NAME, 33 | XML_ROLE_ENTITY_NONE, 34 | XML_ROLE_ENTITY_VALUE, 35 | XML_ROLE_ENTITY_SYSTEM_ID, 36 | XML_ROLE_ENTITY_PUBLIC_ID, 37 | XML_ROLE_ENTITY_COMPLETE, 38 | XML_ROLE_ENTITY_NOTATION_NAME, 39 | XML_ROLE_NOTATION_NONE, 40 | XML_ROLE_NOTATION_NAME, 41 | XML_ROLE_NOTATION_SYSTEM_ID, 42 | XML_ROLE_NOTATION_NO_SYSTEM_ID, 43 | XML_ROLE_NOTATION_PUBLIC_ID, 44 | XML_ROLE_ATTRIBUTE_NAME, 45 | XML_ROLE_ATTRIBUTE_TYPE_CDATA, 46 | XML_ROLE_ATTRIBUTE_TYPE_ID, 47 | XML_ROLE_ATTRIBUTE_TYPE_IDREF, 48 | XML_ROLE_ATTRIBUTE_TYPE_IDREFS, 49 | XML_ROLE_ATTRIBUTE_TYPE_ENTITY, 50 | XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, 51 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, 52 | XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, 53 | XML_ROLE_ATTRIBUTE_ENUM_VALUE, 54 | XML_ROLE_ATTRIBUTE_NOTATION_VALUE, 55 | XML_ROLE_ATTLIST_NONE, 56 | XML_ROLE_ATTLIST_ELEMENT_NAME, 57 | XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, 58 | XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, 59 | XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, 60 | XML_ROLE_FIXED_ATTRIBUTE_VALUE, 61 | XML_ROLE_ELEMENT_NONE, 62 | XML_ROLE_ELEMENT_NAME, 63 | XML_ROLE_CONTENT_ANY, 64 | XML_ROLE_CONTENT_EMPTY, 65 | XML_ROLE_CONTENT_PCDATA, 66 | XML_ROLE_GROUP_OPEN, 67 | XML_ROLE_GROUP_CLOSE, 68 | XML_ROLE_GROUP_CLOSE_REP, 69 | XML_ROLE_GROUP_CLOSE_OPT, 70 | XML_ROLE_GROUP_CLOSE_PLUS, 71 | XML_ROLE_GROUP_CHOICE, 72 | XML_ROLE_GROUP_SEQUENCE, 73 | XML_ROLE_CONTENT_ELEMENT, 74 | XML_ROLE_CONTENT_ELEMENT_REP, 75 | XML_ROLE_CONTENT_ELEMENT_OPT, 76 | XML_ROLE_CONTENT_ELEMENT_PLUS, 77 | XML_ROLE_PI, 78 | XML_ROLE_COMMENT, 79 | #ifdef XML_DTD 80 | XML_ROLE_TEXT_DECL, 81 | XML_ROLE_IGNORE_SECT, 82 | XML_ROLE_INNER_PARAM_ENTITY_REF, 83 | #endif /* XML_DTD */ 84 | XML_ROLE_PARAM_ENTITY_REF 85 | }; 86 | 87 | typedef struct prolog_state { 88 | int (PTRCALL *handler) (struct prolog_state *state, 89 | int tok, 90 | const char *ptr, 91 | const char *end, 92 | const ENCODING *enc); 93 | unsigned level; 94 | int role_none; 95 | #ifdef XML_DTD 96 | unsigned includeLevel; 97 | int documentEntity; 98 | int inEntityValue; 99 | #endif /* XML_DTD */ 100 | } PROLOG_STATE; 101 | 102 | void XmlPrologStateInit(PROLOG_STATE *); 103 | #ifdef XML_DTD 104 | void XmlPrologStateInitExternalEntity(PROLOG_STATE *); 105 | #endif /* XML_DTD */ 106 | 107 | #define XmlTokenRole(state, tok, ptr, end, enc) \ 108 | (((state)->handler)(state, tok, ptr, end, enc)) 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* not XmlRole_INCLUDED */ 115 | -------------------------------------------------------------------------------- /expat/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /expat/xmltok_ns.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* This file is included! */ 6 | #ifdef XML_TOK_NS_C 7 | 8 | const ENCODING * 9 | NS(XmlGetUtf8InternalEncoding)(void) 10 | { 11 | return &ns(internal_utf8_encoding).enc; 12 | } 13 | 14 | const ENCODING * 15 | NS(XmlGetUtf16InternalEncoding)(void) 16 | { 17 | #if BYTEORDER == 1234 18 | return &ns(internal_little2_encoding).enc; 19 | #elif BYTEORDER == 4321 20 | return &ns(internal_big2_encoding).enc; 21 | #else 22 | const short n = 1; 23 | return (*(const char *)&n 24 | ? &ns(internal_little2_encoding).enc 25 | : &ns(internal_big2_encoding).enc); 26 | #endif 27 | } 28 | 29 | static const ENCODING * const NS(encodings)[] = { 30 | &ns(latin1_encoding).enc, 31 | &ns(ascii_encoding).enc, 32 | &ns(utf8_encoding).enc, 33 | &ns(big2_encoding).enc, 34 | &ns(big2_encoding).enc, 35 | &ns(little2_encoding).enc, 36 | &ns(utf8_encoding).enc /* NO_ENC */ 37 | }; 38 | 39 | static int PTRCALL 40 | NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 41 | const char **nextTokPtr) 42 | { 43 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 44 | XML_PROLOG_STATE, ptr, end, nextTokPtr); 45 | } 46 | 47 | static int PTRCALL 48 | NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 49 | const char **nextTokPtr) 50 | { 51 | return initScan(NS(encodings), (const INIT_ENCODING *)enc, 52 | XML_CONTENT_STATE, ptr, end, nextTokPtr); 53 | } 54 | 55 | int 56 | NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, 57 | const char *name) 58 | { 59 | int i = getEncodingIndex(name); 60 | if (i == UNKNOWN_ENC) 61 | return 0; 62 | SET_INIT_ENC_INDEX(p, i); 63 | p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); 64 | p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); 65 | p->initEnc.updatePosition = initUpdatePosition; 66 | p->encPtr = encPtr; 67 | *encPtr = &(p->initEnc); 68 | return 1; 69 | } 70 | 71 | static const ENCODING * 72 | NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) 73 | { 74 | #define ENCODING_MAX 128 75 | char buf[ENCODING_MAX]; 76 | char *p = buf; 77 | int i; 78 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); 79 | if (ptr != end) 80 | return 0; 81 | *p = 0; 82 | if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) 83 | return enc; 84 | i = getEncodingIndex(buf); 85 | if (i == UNKNOWN_ENC) 86 | return 0; 87 | return NS(encodings)[i]; 88 | } 89 | 90 | int 91 | NS(XmlParseXmlDecl)(int isGeneralTextEntity, 92 | const ENCODING *enc, 93 | const char *ptr, 94 | const char *end, 95 | const char **badPtr, 96 | const char **versionPtr, 97 | const char **versionEndPtr, 98 | const char **encodingName, 99 | const ENCODING **encoding, 100 | int *standalone) 101 | { 102 | return doParseXmlDecl(NS(findEncoding), 103 | isGeneralTextEntity, 104 | enc, 105 | ptr, 106 | end, 107 | badPtr, 108 | versionPtr, 109 | versionEndPtr, 110 | encodingName, 111 | encoding, 112 | standalone); 113 | } 114 | 115 | #endif /* XML_TOK_NS_C */ 116 | -------------------------------------------------------------------------------- /extensions/example/aclocal.m4: -------------------------------------------------------------------------------- 1 | # 2 | # Include the TEA standard macro set 3 | # 4 | builtin(include,../../tclconfig/tcl.m4) 5 | 6 | # 7 | # Add here whatever m4 macros you want to define for your package 8 | # 9 | builtin(include,../../tdom.m4) 10 | -------------------------------------------------------------------------------- /extensions/example/exampletest.tcl: -------------------------------------------------------------------------------- 1 | #!tclsh 2 | 3 | load ../../unix/libtdom0.8.3.so 4 | load ./libexample1.0.so 5 | 6 | set counter1 0 7 | set counter2 0 8 | 9 | proc eh1 {args} { 10 | global counter1 11 | 12 | incr counter1 13 | } 14 | proc eh2 {args} { 15 | global counter2 16 | 17 | incr counter2 18 | } 19 | 20 | set parser [expat] 21 | $parser configure -elementstartcommand eh1 \ 22 | -handlerset doMore \ 23 | -elementstartcommand eh2 24 | example $parser enable 25 | tdom $parser enable 26 | 27 | set fd [open ../../tests/data/books.xml] 28 | $parser parse [read $fd] 29 | 30 | puts "First tcl element start handler has counted the elements" 31 | puts "(and 42 isn't a bad answer at all)" 32 | puts "counter1: $counter1" 33 | puts "\nSecond tcl element start handler has also counted the elements" 34 | puts "(and should therefore report the same reasonable result)" 35 | puts "counter2: $counter2" 36 | 37 | puts "\nthe example C level handler set also counts the elements..." 38 | puts "(and should maybe do some validation, instead of this ridiculous counting..)" 39 | puts "example result: [example $parser getresult]" 40 | set doc [tdom $parser getdoc] 41 | 42 | set root [$doc documentElement] 43 | puts "\n... but the second C level handler has done some serious work" 44 | puts "DOM result tree root: [$root nodeName]" 45 | 46 | puts "\nOK, reset the parser..." 47 | $parser reset 48 | puts "\nSome senseless fiddling with the result encoding" 49 | puts [tdom $parser setResultEncoding] 50 | puts [tdom $parser setResultEncoding iso8859-1] 51 | puts [tdom $parser setResultEncoding] 52 | 53 | puts "\nRemove the tdom handler set and parse again" 54 | tdom $parser remove 55 | 56 | seek $fd 0 start 57 | $parser parse [read $fd] 58 | 59 | puts "\nthe both tcl counters count further, thats OK" 60 | puts "counter1: $counter1" 61 | puts "counter2: $counter2" 62 | puts "\nthe example counter is reseted because of the parser reset" 63 | puts "example result: [example $parser getresult]" 64 | puts "\nthe DOM tree created in the first parser run is still alive" 65 | puts [$root childNodes] 66 | 67 | 68 | -------------------------------------------------------------------------------- /extensions/example/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # install - install a program, script, or datafile 5 | # This comes from X11R5; it is not part of GNU. 6 | # 7 | # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ 8 | # 9 | # This script is compatible with the BSD install script, but was written 10 | # from scratch. 11 | # 12 | 13 | 14 | # set DOITPROG to echo to test this script 15 | 16 | # Don't use :- since 4.3BSD and earlier shells don't like it. 17 | doit="${DOITPROG-}" 18 | 19 | 20 | # put in absolute paths if you don't have them in your path; or use env. vars. 21 | 22 | mvprog="${MVPROG-mv}" 23 | cpprog="${CPPROG-cp}" 24 | chmodprog="${CHMODPROG-chmod}" 25 | chownprog="${CHOWNPROG-chown}" 26 | chgrpprog="${CHGRPPROG-chgrp}" 27 | stripprog="${STRIPPROG-strip}" 28 | rmprog="${RMPROG-rm}" 29 | 30 | instcmd="$mvprog" 31 | chmodcmd="" 32 | chowncmd="" 33 | chgrpcmd="" 34 | stripcmd="" 35 | rmcmd="$rmprog -f" 36 | mvcmd="$mvprog" 37 | src="" 38 | dst="" 39 | 40 | while [ x"$1" != x ]; do 41 | case $1 in 42 | -c) instcmd="$cpprog" 43 | shift 44 | continue;; 45 | 46 | -m) chmodcmd="$chmodprog $2" 47 | shift 48 | shift 49 | continue;; 50 | 51 | -o) chowncmd="$chownprog $2" 52 | shift 53 | shift 54 | continue;; 55 | 56 | -g) chgrpcmd="$chgrpprog $2" 57 | shift 58 | shift 59 | continue;; 60 | 61 | -s) stripcmd="$stripprog" 62 | shift 63 | continue;; 64 | 65 | *) if [ x"$src" = x ] 66 | then 67 | src=$1 68 | else 69 | dst=$1 70 | fi 71 | shift 72 | continue;; 73 | esac 74 | done 75 | 76 | if [ x"$src" = x ] 77 | then 78 | echo "install: no input file specified" 79 | exit 1 80 | fi 81 | 82 | if [ x"$dst" = x ] 83 | then 84 | echo "install: no destination specified" 85 | exit 1 86 | fi 87 | 88 | 89 | # If destination is a directory, append the input filename; if your system 90 | # does not like double slashes in filenames, you may need to add some logic 91 | 92 | if [ -d $dst ] 93 | then 94 | dst="$dst"/`basename $src` 95 | fi 96 | 97 | # Make a temp file name in the proper directory. 98 | 99 | dstdir=`dirname $dst` 100 | dsttmp=$dstdir/#inst.$$# 101 | 102 | # Move or copy the file name to the temp name 103 | 104 | $doit $instcmd $src $dsttmp 105 | 106 | # and set any options; do chmod last to preserve setuid bits 107 | 108 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi 109 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi 110 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi 111 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi 112 | 113 | # Now rename the file to the real destination. 114 | 115 | $doit $rmcmd $dst 116 | $doit $mvcmd $dsttmp $dst 117 | 118 | 119 | exit 0 120 | -------------------------------------------------------------------------------- /extensions/example/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id$ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /extensions/example/pkgIndex.tcl.in: -------------------------------------------------------------------------------- 1 | # tDOM Tcl package index file 2 | 3 | package ifneeded example @VERSION@ \ 4 | "package require expat; \ 5 | [list load [file join $dir example@VERSION@[info sharedlibextension] ] example]" 6 | -------------------------------------------------------------------------------- /extensions/tdomhtml/CONFIG: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is a small collection of example settings you can use to 4 | # compile tdom on different platforms. Just uncomment the line(s) 5 | # you need and run this script with "sh CONFIG". 6 | # 7 | # 8 | # Tcl on Unix (uses public Tcl library) 9 | # -------------------------------------------- 10 | # ./configure 11 | # 12 | # Mac OS X. Uses public Tcl library. 13 | # -------------------------------------------- 14 | # ./configure \ 15 | # --mandir=/usr/local/share/man \ 16 | # --libdir=/Library/Tcl 17 | # 18 | # EOF 19 | -------------------------------------------------------------------------------- /extensions/tdomhtml/doc/tdomhtml.n: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/extensions/tdomhtml/doc/tdomhtml.n -------------------------------------------------------------------------------- /extensions/tdomhtml/doc/tdomhtml.tmml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/extensions/tdomhtml/doc/tdomhtml.tmml -------------------------------------------------------------------------------- /extensions/tdomhtml/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # install - install a program, script, or datafile 5 | # This comes from X11R5; it is not part of GNU. 6 | # 7 | # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ 8 | # 9 | # This script is compatible with the BSD install script, but was written 10 | # from scratch. 11 | # 12 | 13 | 14 | # set DOITPROG to echo to test this script 15 | 16 | # Don't use :- since 4.3BSD and earlier shells don't like it. 17 | doit="${DOITPROG-}" 18 | 19 | 20 | # put in absolute paths if you don't have them in your path; or use env. vars. 21 | 22 | mvprog="${MVPROG-mv}" 23 | cpprog="${CPPROG-cp}" 24 | chmodprog="${CHMODPROG-chmod}" 25 | chownprog="${CHOWNPROG-chown}" 26 | chgrpprog="${CHGRPPROG-chgrp}" 27 | stripprog="${STRIPPROG-strip}" 28 | rmprog="${RMPROG-rm}" 29 | 30 | instcmd="$mvprog" 31 | chmodcmd="" 32 | chowncmd="" 33 | chgrpcmd="" 34 | stripcmd="" 35 | rmcmd="$rmprog -f" 36 | mvcmd="$mvprog" 37 | src="" 38 | dst="" 39 | 40 | while [ x"$1" != x ]; do 41 | case $1 in 42 | -c) instcmd="$cpprog" 43 | shift 44 | continue;; 45 | 46 | -m) chmodcmd="$chmodprog $2" 47 | shift 48 | shift 49 | continue;; 50 | 51 | -o) chowncmd="$chownprog $2" 52 | shift 53 | shift 54 | continue;; 55 | 56 | -g) chgrpcmd="$chgrpprog $2" 57 | shift 58 | shift 59 | continue;; 60 | 61 | -s) stripcmd="$stripprog" 62 | shift 63 | continue;; 64 | 65 | *) if [ x"$src" = x ] 66 | then 67 | src=$1 68 | else 69 | dst=$1 70 | fi 71 | shift 72 | continue;; 73 | esac 74 | done 75 | 76 | if [ x"$src" = x ] 77 | then 78 | echo "install: no input file specified" 79 | exit 1 80 | fi 81 | 82 | if [ x"$dst" = x ] 83 | then 84 | echo "install: no destination specified" 85 | exit 1 86 | fi 87 | 88 | 89 | # If destination is a directory, append the input filename; if your system 90 | # does not like double slashes in filenames, you may need to add some logic 91 | 92 | if [ -d $dst ] 93 | then 94 | dst="$dst"/`basename $src` 95 | fi 96 | 97 | # Make a temp file name in the proper directory. 98 | 99 | dstdir=`dirname $dst` 100 | dsttmp=$dstdir/#inst.$$# 101 | 102 | # Move or copy the file name to the temp name 103 | 104 | $doit $instcmd $src $dsttmp 105 | 106 | # and set any options; do chmod last to preserve setuid bits 107 | 108 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi 109 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi 110 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi 111 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi 112 | 113 | # Now rename the file to the real destination. 114 | 115 | $doit $rmcmd $dst 116 | $doit $mvcmd $dsttmp $dst 117 | 118 | 119 | exit 0 120 | -------------------------------------------------------------------------------- /extensions/tdomhtml/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id$ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /extensions/tdomhtml/pkgIndex.tcl.in: -------------------------------------------------------------------------------- 1 | package ifneeded tdomhtml @VERSION@ "set _V_ @VERSION@; source [list [file join $dir tdomhtml.tcl]]" 2 | 3 | -------------------------------------------------------------------------------- /extensions/tnc/aclocal.m4: -------------------------------------------------------------------------------- 1 | # 2 | # Include the TEA standard macro set 3 | # 4 | builtin(include,../../tclconfig/tcl.m4) 5 | 6 | # 7 | # Add here whatever m4 macros you want to define for your package 8 | # 9 | builtin(include,../../tdom.m4) 10 | -------------------------------------------------------------------------------- /extensions/tnc/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id$ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /extensions/tnc/pkgIndex.tcl.in: -------------------------------------------------------------------------------- 1 | # tnc Tcl package index file 2 | 3 | package ifneeded tnc @PACKAGE_VERSION@ \ 4 | "package require tdom; \ 5 | [list load [file join $dir @PKG_LIB_FILE@] tnc]" 6 | -------------------------------------------------------------------------------- /extensions/tnc/test.tcl: -------------------------------------------------------------------------------- 1 | 2 | if {[catch {package require tnc 0.3} errMsg]} { 3 | if {[catch {load ./libtnc0.3.0.so}]} { 4 | puts $errMsg 5 | exit 1 6 | } 7 | } 8 | if {[lsearch [namespace children] ::tDOM] == -1} { 9 | # tcldomsh without the script library. Source the lib. 10 | source [file join [file dir [info script]] ../../lib tdom.tcl] 11 | } 12 | 13 | if {[llength $argv] != 1} { 14 | puts stderr "usage: $argv0 " 15 | exit 1 16 | } 17 | 18 | set parser [expat \ 19 | -baseurl [tDOM::baseURL $argv] \ 20 | -externalentitycommand tDOM::extRefHandler \ 21 | -paramentityparsing notstandalone] 22 | 23 | tnc $parser enable 24 | 25 | $parser parsefile $argv 26 | 27 | -------------------------------------------------------------------------------- /extensions/tnc/tests/all.tcl: -------------------------------------------------------------------------------- 1 | # all.tcl -- 2 | # 3 | # This file contains a top-level script to run all of the Tcl 4 | # tests. Execute it by invoking "tclsh all.test". 5 | # 6 | # Copyright (c) 1998-1999 by Scriptics Corporation. 7 | # All rights reserved. 8 | # 9 | # RCS: @(#) $Id$ 10 | # 11 | 12 | source [file join [file dir [info script]] loadtnc.tcl] 13 | 14 | if {$tcl_version >= 8.1} { 15 | if {[lsearch [info proc ::tcltest::testConstraint] \ 16 | ::tcltest::testConstraint] == -1} { 17 | set ::tcltest::testConfig(need_i18n) 1 18 | set ::tcltest::testConstraints(need_i18n) 1 19 | } else { 20 | ::tcltest::testConstraint need_i18n 1 21 | } 22 | } 23 | 24 | set timeCmd {clock format [clock seconds]} 25 | 26 | set ::tcltest::testSingleFile false 27 | 28 | puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" 29 | 30 | if {$tcl_version < 8.2} { 31 | set TESTS_DIR [file join [pwd] [file dirname [info script]]] 32 | set currentDir [pwd] 33 | 34 | set globPattern [file join $TESTS_DIR *.test] 35 | foreach file [lsort [glob $globPattern]] { 36 | set tail [file tail $file] 37 | if {[string match l.*.test $tail]} { 38 | # This is an SCCS lockfile; ignore it 39 | continue 40 | } 41 | puts stdout $tail 42 | if {[catch {source $file} msg]} { 43 | puts stdout $msg 44 | } 45 | } 46 | } else { 47 | set ::tcltest::testsDirectory [file dir [info script]] 48 | 49 | puts stdout "Tests running in working dir: $::tcltest::testsDirectory" 50 | if {[llength $::tcltest::skip] > 0} { 51 | puts stdout "Skipping tests that match: $::tcltest::skip" 52 | } 53 | if {[llength $::tcltest::match] > 0} { 54 | puts stdout "Only running tests that match: $::tcltest::match" 55 | } 56 | 57 | if {[llength $::tcltest::skipFiles] > 0} { 58 | puts stdout "Skipping test files that match: $::tcltest::skipFiles" 59 | } 60 | if {[llength $::tcltest::matchFiles] > 0} { 61 | puts stdout "Only sourcing test files that match: $::tcltest::matchFiles" 62 | } 63 | 64 | puts stdout "Tests began at [eval $timeCmd]" 65 | 66 | # source each of the specified tests 67 | foreach file [lsort [::tcltest::getMatchingFiles]] { 68 | set tail [file tail $file] 69 | puts stdout $tail 70 | if {[catch {source $file} msg]} { 71 | puts stdout $msg 72 | } 73 | } 74 | } 75 | 76 | # cleanup 77 | puts stdout "\nTests ended at [eval $timeCmd]" 78 | ::tcltest::cleanupTests 1 79 | 80 | # Just a dirty trick, to make life of mem leak debuggers a bit easier. 81 | # See http://mini.net/tcl/3248 82 | proc exit args {} 83 | 84 | -------------------------------------------------------------------------------- /extensions/tnc/tests/loadtnc.tcl: -------------------------------------------------------------------------------- 1 | catch {load ../../../unix/libtdom0.8.3.so} 2 | catch {load ../libtnc0.3.0.so} 3 | catch {load ../../unix/libtdom0.8.3.so} 4 | catch {load libtnc0.3.0.so} 5 | # loadtnc.tcl -- 6 | # 7 | # This file is [source]d by all.tcl and all test files, to ensure, that 8 | # the tcltest package and the lastest tnc build is present. 9 | 10 | if {[lsearch [namespace children] ::tcltest] == -1} { 11 | if {$tcl_version < 8.2} { 12 | puts stderr "sourcing def.tcl" 13 | source [file join [file dir [info script]] defs.tcl] 14 | set auto_path [pwd] 15 | } else { 16 | package require tcltest 17 | namespace import ::tcltest::* 18 | } 19 | } 20 | 21 | if {[catch {package present tdom}]} { 22 | package require tdom 23 | } 24 | 25 | if {[catch {package require tnc}]} { 26 | package require tnc 27 | } 28 | 29 | -------------------------------------------------------------------------------- /generic/aolstub.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * aolstub.cpp -- 3 | * 4 | * Adds interface for loading the extension into the AOLserver. 5 | * 6 | * See the file "LICENSE" for information on usage and redistribution 7 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 8 | * 9 | * Rcsid: @(#)$Id$ 10 | * --------------------------------------------------------------------------- 11 | */ 12 | 13 | #if defined (NS_AOLSERVER) 14 | #include 15 | 16 | int Ns_ModuleVersion = 1; 17 | 18 | /* 19 | * Structure to pass to NsThread_Init. This holds the module 20 | * and virtual server name for proper interp initializations. 21 | * This is valid only for AOLservers 4.x or later. 22 | */ 23 | 24 | struct mydata { 25 | char *modname; 26 | char *server; 27 | }; 28 | 29 | /* 30 | *---------------------------------------------------------------------------- 31 | * 32 | * NsTdom_Init -- 33 | * 34 | * Loads the package in the Tcl interpreter. 35 | * 36 | * Results: 37 | * Standard Tcl result 38 | * 39 | * Side effects: 40 | * Package initialized. Tcl commands created. 41 | * 42 | *---------------------------------------------------------------------------- 43 | */ 44 | 45 | static int 46 | NsTdom_Init (Tcl_Interp *interp, void *cd) 47 | { 48 | struct mydata *md = (struct mydata*)cd; 49 | int ret = Tdom_Init(interp); 50 | 51 | if (ret != TCL_OK) { 52 | Ns_Log(Warning, "can't load module %s: %s", md->modname, 53 | Tcl_GetStringResult(interp)); 54 | } 55 | Tcl_SetAssocData(interp, "tdom:nsd", NULL, (ClientData)md); 56 | 57 | return TCL_OK; 58 | } 59 | 60 | /* 61 | *---------------------------------------------------------------------------- 62 | * 63 | * Ns_ModuleInit -- 64 | * 65 | * Called by the AOLserver when loading shared object file. 66 | * 67 | * Results: 68 | * Standard AOLserver result 69 | * 70 | * Side effects: 71 | * Many. Depends on the package. 72 | * 73 | *---------------------------------------------------------------------------- 74 | */ 75 | 76 | int 77 | Ns_ModuleInit(char *srv, char *mod) 78 | { 79 | struct mydata *md = NULL; 80 | 81 | md = (struct mydata*)ns_malloc(sizeof(struct mydata)); 82 | md->modname = strcpy(ns_malloc(strlen(mod)+1), mod); 83 | md->server = strcpy(ns_malloc(strlen(srv)+1), srv); 84 | 85 | return (Ns_TclInitInterps(srv, NsTdom_Init, (void*)md) == TCL_OK) 86 | ? NS_OK : NS_ERROR; 87 | } 88 | 89 | #endif /* NS_AOLSERVER */ 90 | 91 | /* EOF $RCSfile$ */ 92 | 93 | /* Emacs Setup Variables */ 94 | /* Local Variables: */ 95 | /* mode: C */ 96 | /* indent-tabs-mode: nil */ 97 | /* c-basic-offset: 4 */ 98 | /* End: */ 99 | -------------------------------------------------------------------------------- /generic/domalloc.h: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------- 2 | | Copyright (C) 1999-2000 Jochen C. Loewer (loewerj@hotmail.com) 3 | +---------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | A special memory allocator, which uses pre-allocated / bit masked 9 | | based administration of memory block with fixed sizes, like 10 | | DOM nodes. This will hopefully save some memory. 11 | | 12 | | 13 | | The contents of this file are subject to the Mozilla Public License 14 | | Version 1.1 (the "License"); you may not use this file except in 15 | | compliance with the License. You may obtain a copy of the License at 16 | | http://www.mozilla.org/MPL/ 17 | | 18 | | Software distributed under the License is distributed on an "AS IS" 19 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 20 | | License for the specific language governing rights and limitations 21 | | under the License. 22 | | 23 | | The Original Code is tDOM. 24 | | 25 | | The Initial Developer of the Original Code is Jochen Loewer 26 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 27 | | Jochen Loewer. All Rights Reserved. 28 | | 29 | | Contributor(s): 30 | | 31 | | 32 | | written by Jochen Loewer 33 | | October, 2000 34 | | 35 | \--------------------------------------------------------------------------*/ 36 | 37 | void domAllocInit(); 38 | void * domAlloc(int size); 39 | void domFree(void *mem); 40 | 41 | -------------------------------------------------------------------------------- /generic/domhtml.h: -------------------------------------------------------------------------------- 1 | 2 | domDocument * HTML_SimpleParseDocument ( char *html, int ignoreWhiteSpaces, 3 | int *pos, char **errStr ); 4 | -------------------------------------------------------------------------------- /generic/domlock.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (C) 1999 Jochen C. Loewer (loewerj@hotmail.com) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | The contents of this file are subject to the Mozilla Public License 8 | | Version 1.1 (the "License"); you may not use this file except in 9 | | compliance with the License. You may obtain a copy of the License at 10 | | http://www.mozilla.org/MPL/ 11 | | 12 | | Software distributed under the License is distributed on an "AS IS" 13 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 14 | | License for the specific language governing rights and limitations 15 | | under the License. 16 | | 17 | | The Original Code is tDOM. 18 | | 19 | | The Initial Developer of the Original Code is Jochen Loewer 20 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 21 | | Jochen Loewer. All Rights Reserved. 22 | | 23 | | This implements many-readers/single-writer locking of DOM documents. 24 | | 25 | | Contributor(s): 26 | | May02 Zoran Vasiljevic Added this file. 27 | | 28 | \---------------------------------------------------------------------------*/ 29 | 30 | #ifdef TCL_THREADS 31 | 32 | #include 33 | 34 | 35 | /*---------------------------------------------------------------------------- 36 | | Global list of document lock structures. These should be finalized 37 | | only on application exit. 38 | | 39 | \---------------------------------------------------------------------------*/ 40 | static Tcl_Mutex lockMutex = 0; 41 | static domlock *domLocks = NULL; 42 | 43 | 44 | /*---------------------------------------------------------------------------- 45 | | Lock the document according to passed flag 46 | | 47 | \---------------------------------------------------------------------------*/ 48 | void 49 | domLocksLock(domlock *dl, int how) 50 | { 51 | 52 | Tcl_MutexLock(&dl->mutex); 53 | 54 | switch (how) { 55 | case LOCK_READ: 56 | while (dl->lrcnt < 0 || dl->numwr > 0) { 57 | dl->numrd++; 58 | Tcl_ConditionWait(&dl->rcond, &dl->mutex, NULL); 59 | dl->numrd--; 60 | } 61 | dl->lrcnt++; 62 | break; 63 | 64 | case LOCK_WRITE: 65 | while (dl->lrcnt != 0) { 66 | dl->numwr++; 67 | Tcl_ConditionWait(&dl->wcond, &dl->mutex, NULL); 68 | dl->numwr--; 69 | } 70 | dl->lrcnt = -1; /* This designates the sole writer */ 71 | break; 72 | } 73 | 74 | Tcl_MutexUnlock(&dl->mutex); 75 | } 76 | 77 | 78 | /*---------------------------------------------------------------------------- 79 | | Unlock the previously locked document. 80 | | 81 | \---------------------------------------------------------------------------*/ 82 | void 83 | domLocksUnlock(domlock *dl) 84 | { 85 | Tcl_MutexLock(&dl->mutex); 86 | 87 | if (--dl->lrcnt < 0) { 88 | dl->lrcnt = 0; 89 | } 90 | if (dl->numwr) { 91 | Tcl_ConditionNotify(&dl->wcond); 92 | } else if (dl->numrd) { 93 | Tcl_ConditionNotify(&dl->rcond); 94 | } 95 | 96 | Tcl_MutexUnlock (&dl->mutex); 97 | } 98 | 99 | 100 | /*---------------------------------------------------------------------------- 101 | | Associate a lock with the document.. 102 | | 103 | \---------------------------------------------------------------------------*/ 104 | void 105 | domLocksAttach(domDocument *doc) 106 | { 107 | domlock *dl; 108 | 109 | Tcl_MutexLock(&lockMutex); 110 | 111 | dl = domLocks; 112 | if (dl == NULL) { 113 | dl = (domlock*)MALLOC(sizeof(domlock)); 114 | memset(dl, 0, sizeof(domlock)); 115 | } else { 116 | domLocks = dl->next; 117 | } 118 | 119 | dl->doc = doc; 120 | doc->lock = dl; 121 | 122 | Tcl_MutexUnlock(&lockMutex); 123 | } 124 | 125 | 126 | /*---------------------------------------------------------------------------- 127 | | Divorce DOM document from its lock. The lock structure is not 128 | | disposed and may be used for locking other documents. 129 | | 130 | \---------------------------------------------------------------------------*/ 131 | void 132 | domLocksDetach(domDocument *doc) 133 | { 134 | domlock *dl = doc->lock; 135 | 136 | Tcl_MutexLock(&lockMutex); 137 | 138 | if (dl->doc != doc) { 139 | domPanic("document lock mismatch"); 140 | } 141 | 142 | dl->next = domLocks; 143 | domLocks = dl; 144 | 145 | dl->doc = NULL; 146 | doc->lock = NULL; 147 | 148 | Tcl_MutexUnlock(&lockMutex); 149 | } 150 | 151 | 152 | /*---------------------------------------------------------------------------- 153 | | Reclaim storage used for lock structures. This should be done only 154 | | on application exit. 155 | | 156 | \---------------------------------------------------------------------------*/ 157 | void 158 | domLocksFinalize(ClientData dummy) 159 | { 160 | domlock *tmp, *dl; 161 | 162 | Tcl_MutexLock(&lockMutex); 163 | 164 | dl = domLocks; 165 | 166 | while (dl != NULL) { 167 | Tcl_MutexFinalize(&dl->mutex); 168 | Tcl_ConditionFinalize(&dl->rcond); 169 | Tcl_ConditionFinalize(&dl->wcond); 170 | tmp = dl; 171 | dl = dl->next; 172 | FREE((char*)tmp); 173 | } 174 | domLocks = NULL; 175 | 176 | Tcl_MutexUnlock(&lockMutex); 177 | } 178 | 179 | #endif /* TCL_THREADS */ 180 | -------------------------------------------------------------------------------- /generic/domxslt.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (c) 2000 Jochen Loewer (loewerj@hotmail.com) 3 | |----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | A (partial) XSLT implementation for tDOM, according to the W3C 9 | | recommendation (16 Nov 1999, 10 | | http://www.w3.org/TR/1999/REC-xslt-19991116). 11 | | 12 | | 13 | | The contents of this file are subject to the Mozilla Public License 14 | | Version 1.1 (the "License"); you may not use this file except in 15 | | compliance with the License. You may obtain a copy of the License at 16 | | http://www.mozilla.org/MPL/ 17 | | 18 | | Software distributed under the License is distributed on an "AS IS" 19 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 20 | | License for the specific language governing rights and limitations 21 | | under the License. 22 | | 23 | | The Original Code is tDOM. 24 | | 25 | | The Initial Developer of the Original Code is Jochen Loewer 26 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 27 | | Jochen Loewer. All Rights Reserved. 28 | | 29 | | Contributor(s): 30 | | 31 | | 32 | | $Log$ 33 | | Revision 1.6 2004/08/14 14:42:27 rolf 34 | | Use 'Id' cvs keyword (instead of 'Header') in the file heads. 35 | | 36 | | Revision 1.5 2003/01/11 00:19:02 rolf 37 | | Added conversion of XSLT stylesheet DOM trees to 'cached' xslt cmds 38 | | (new domDoc method toXSLTcmd). Works for non threaded tcl; needs 39 | | additional work for multi-threaded tcl and documentation. 40 | | 41 | | Revision 1.4 2002/12/27 23:40:10 rolf 42 | | The xslt method now understands also the options 43 | | -ignoreUndeclaredParameters and -xsltmessagecmd. 44 | | 45 | | Revision 1.3 2002/06/02 06:36:24 zoran 46 | | Added thread safety with capability of sharing DOM trees between 47 | | threads and ability to read/write-lock DOM documents 48 | | 49 | | Revision 1.2 2002/04/08 02:11:12 rolf 50 | | Added -parameters option to domNode xslt method, to enable setting of 51 | | top level parameters from tcl level. 52 | | 53 | | Revision 1.1.1.1 2002/02/22 01:05:35 rolf 54 | | tDOM0.7test with Jochens first set of patches 55 | | 56 | | Revision 1.1 2002/02/04 08:08:19 jolo 57 | | Initial revision 58 | | 59 | | 60 | | 61 | | written by Jochen Loewer 62 | | June, 2000 63 | | 64 | \---------------------------------------------------------------------------*/ 65 | 66 | #ifndef __DOMXSLT_H__ 67 | #define __DOMXSLT_H__ 68 | 69 | #include 70 | #include 71 | 72 | 73 | typedef void (*xsltMsgCB) (void *clientData, char *str, 74 | int length, int terminate); 75 | 76 | /*---------------------------------------------------------------------------- 77 | | Prototypes 78 | | 79 | \---------------------------------------------------------------------------*/ 80 | int xsltProcess (domDocument * xsltDoc, 81 | domNode * xmlNode, 82 | void * xsltCmdData, 83 | char ** parameters, 84 | int ignoreUndeclaredParameters, 85 | xpathFuncCallback funcCB, 86 | void * xpathFuncClientData, 87 | xsltMsgCB xsltMsgCB, 88 | void * xsltMsgClientData, 89 | char ** errMsg, 90 | domDocument ** resultDoc 91 | ); 92 | 93 | void * xsltCompileStylesheet ( 94 | domDocument * xsltDoc, 95 | xpathFuncCallback funcCB, 96 | void * xpathFuncClientData, 97 | int guardXSLTTree, 98 | char ** errMsg 99 | ); 100 | 101 | void xsltFreeStateWrapper (void *clientData); 102 | 103 | void sortByDocOrder (xpathResultSet *rs); 104 | 105 | #endif 106 | 107 | -------------------------------------------------------------------------------- /generic/expat_config.h: -------------------------------------------------------------------------------- 1 | /* an empty/fake config.h for expat */ 2 | 3 | -------------------------------------------------------------------------------- /generic/nodecmd.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (C) 1999 Jochen C. Loewer (loewerj@hotmail.com) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | 7 | | The contents of this file are subject to the Mozilla Public License 8 | | Version 1.1 (the "License"); you may not use this file except in 9 | | compliance with the License. You may obtain a copy of the License at 10 | | http://www.mozilla.org/MPL/ 11 | | 12 | | Software distributed under the License is distributed on an "AS IS" 13 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 14 | | License for the specific language governing rights and limitations 15 | | under the License. 16 | | 17 | | The Original Code is tDOM. 18 | | 19 | | The Initial Developer of the Original Code is Jochen Loewer 20 | | 21 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 22 | | Jochen Loewer. All Rights Reserved. 23 | | 24 | | Portions created by Zoran Vasiljevic are Copyright (C) 2000-2002 25 | | Zoran Vasiljevic. All Rights Reserved. 26 | | 27 | | Portions created by Rolf Ade are Copyright (C) 1999-2002 28 | | Rolf Ade. All Rights Reserved. 29 | | 30 | | Written by Zoran Vasiljevic 31 | | July 12, 2000 32 | | 33 | \---------------------------------------------------------------------------*/ 34 | 35 | int nodecmd_createNodeCmd (Tcl_Interp * interp, 36 | int objc, 37 | Tcl_Obj *CONST objv[], 38 | int checkName, 39 | int checkCharData); 40 | 41 | int nodecmd_appendFromScript (Tcl_Interp *interp, 42 | domNode *node, 43 | Tcl_Obj *cmdObj); 44 | 45 | int nodecmd_insertBeforeFromScript (Tcl_Interp *interp, 46 | domNode *node, 47 | Tcl_Obj *cmdObj, 48 | domNode *refChild); 49 | 50 | /* EOF $RCSfile $ */ 51 | 52 | /* Emacs Setup Variables */ 53 | /* Local Variables: */ 54 | /* mode: C */ 55 | /* indent-tabs-mode: nil */ 56 | /* c-basic-offset: 4 */ 57 | /* End: */ 58 | 59 | -------------------------------------------------------------------------------- /generic/tcldom.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | A DOM implementation for Tcl using James Clark's expat XML parser 9 | | 10 | | 11 | | The contents of this file are subject to the Mozilla Public License 12 | | Version 1.1 (the "License"); you may not use this file except in 13 | | compliance with the License. You may obtain a copy of the License at 14 | | http://www.mozilla.org/MPL/ 15 | | 16 | | Software distributed under the License is distributed on an "AS IS" 17 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 18 | | License for the specific language governing rights and limitations 19 | | under the License. 20 | | 21 | | The Original Code is tDOM. 22 | | 23 | | The Initial Developer of the Original Code is Jochen Loewer 24 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 25 | | Jochen Loewer. All Rights Reserved. 26 | | 27 | | Contributor(s): 28 | | 29 | | 30 | | written by Jochen Loewer 31 | | April, 1999 32 | | 33 | \---------------------------------------------------------------------------*/ 34 | 35 | 36 | #ifndef __TCLDOM_H_INCLUDE__ 37 | #define __TCLDOM_H_INCLUDE__ 38 | 39 | #include 40 | 41 | 42 | /* The following procs are defined in tcldom.c - since they are used 43 | * in nodecmd.c these need a prototype somewhere. The prototypes can 44 | * live here for now. */ 45 | int tcldom_textCheck(Tcl_Interp *interp, char *text, char *errText); 46 | int tcldom_commentCheck(Tcl_Interp *interp, char *text); 47 | int tcldom_CDATACheck(Tcl_Interp *interp, char *text); 48 | int tcldom_PIValueCheck(Tcl_Interp *interp, char *text); 49 | int tcldom_PINameCheck(Tcl_Interp *interp, char *name); 50 | int tcldom_nameCheck(Tcl_Interp *interp, char *name, char *nameType, 51 | int isFQName); 52 | void tcldom_createNodeObj(Tcl_Interp * interp, domNode *node, 53 | char *objCmdName); 54 | 55 | 56 | void tcldom_initialize(void); 57 | 58 | Tcl_ObjCmdProc tcldom_DomObjCmd; 59 | Tcl_ObjCmdProc tcldom_DocObjCmd; 60 | Tcl_ObjCmdProc tcldom_NodeObjCmd; 61 | Tcl_ObjCmdProc TclExpatObjCmd; 62 | Tcl_ObjCmdProc tcldom_unknownCmd; 63 | Tcl_ObjCmdProc TclTdomObjCmd; 64 | 65 | #if defined(_MSC_VER) || defined(__MINGW32__) 66 | # undef TCL_STORAGE_CLASS 67 | # define TCL_STORAGE_CLASS DLLEXPORT 68 | #endif 69 | 70 | #define STR_TDOM_VERSION(v) (VERSION) 71 | 72 | EXTERN int Tdom_Init _ANSI_ARGS_((Tcl_Interp *interp)); 73 | EXTERN int Tdom_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); 74 | 75 | #endif 76 | 77 | 78 | -------------------------------------------------------------------------------- /generic/tdom.decls: -------------------------------------------------------------------------------- 1 | # tdom.decls -- 2 | # 3 | # This file contains the declarations for all supported public 4 | # functions that are exported by the tDOM library via the stubs table. 5 | # 6 | # Copyright (c) 2002 Rolf Ade. 7 | 8 | library tdom 9 | interface tdom 10 | #hooks {} 11 | 12 | declare 0 generic { 13 | int TclExpatObjCmd (ClientData dummy, Tcl_Interp *interp, 14 | int objc, Tcl_Obj *CONST objv[]) 15 | } 16 | declare 1 generic { 17 | int CheckExpatParserObj (Tcl_Interp *interp, Tcl_Obj *CONST nameObj) 18 | } 19 | declare 2 generic { 20 | int CHandlerSetInstall (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 21 | CHandlerSet *handlerSet) 22 | } 23 | declare 3 generic { 24 | int CHandlerSetRemove (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 25 | char *handlerSetName) 26 | } 27 | declare 4 generic { 28 | CHandlerSet * CHandlerSetCreate (char *name) 29 | } 30 | declare 5 generic { 31 | CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 32 | char *handlerSetName) 33 | } 34 | declare 6 generic { 35 | void * CHandlerSetGetUserData (Tcl_Interp *interp, 36 | Tcl_Obj *CONST expatObj, 37 | char *handlerSetName) 38 | } 39 | declare 7 generic { 40 | TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp, 41 | Tcl_Obj *CONST expatObj) 42 | } 43 | declare 8 generic { 44 | XML_Size XML_GetCurrentLineNumber(XML_Parser parser) 45 | } 46 | declare 9 generic { 47 | XML_Size XML_GetCurrentColumnNumber(XML_Parser parser) 48 | } 49 | declare 10 generic { 50 | XML_Index XML_GetCurrentByteIndex(XML_Parser parser) 51 | } 52 | declare 11 generic { 53 | int XML_GetCurrentByteCount(XML_Parser parser) 54 | } 55 | declare 12 generic { 56 | enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *base) 57 | } 58 | declare 13 generic { 59 | const XML_Char * XML_GetBase(XML_Parser parser) 60 | } 61 | declare 14 generic { 62 | int XML_GetSpecifiedAttributeCount(XML_Parser parser) 63 | } 64 | declare 15 generic { 65 | int XML_GetIdAttributeIndex(XML_Parser parser) 66 | } 67 | declare 16 generic { 68 | domNode * tcldom_getNodeFromName(Tcl_Interp *interp, char *nodeName, 69 | char **errMsg) 70 | } 71 | declare 17 generic { 72 | domDocument * tcldom_getDocumentFromName (Tcl_Interp *interp, 73 | char *docName, char **errMsg) 74 | } 75 | 76 | -------------------------------------------------------------------------------- /generic/tdomStubInit.c: -------------------------------------------------------------------------------- 1 | 2 | /* This is generated by the getStubs.tcl tool (see the tcl distribution) 3 | out of the tdom.decls file */ 4 | 5 | #ifdef USE_TCL_STUBS 6 | 7 | #include 8 | #include 9 | 10 | /* !BEGIN!: Do not edit below this line. */ 11 | 12 | TdomStubs tdomStubs = { 13 | TCL_STUB_MAGIC, 14 | NULL, 15 | TclExpatObjCmd, /* 0 */ 16 | CheckExpatParserObj, /* 1 */ 17 | CHandlerSetInstall, /* 2 */ 18 | CHandlerSetRemove, /* 3 */ 19 | CHandlerSetCreate, /* 4 */ 20 | CHandlerSetGet, /* 5 */ 21 | CHandlerSetGetUserData, /* 6 */ 22 | GetExpatInfo, /* 7 */ 23 | XML_GetCurrentLineNumber, /* 8 */ 24 | XML_GetCurrentColumnNumber, /* 9 */ 25 | XML_GetCurrentByteIndex, /* 10 */ 26 | XML_GetCurrentByteCount, /* 11 */ 27 | XML_SetBase, /* 12 */ 28 | XML_GetBase, /* 13 */ 29 | XML_GetSpecifiedAttributeCount, /* 14 */ 30 | XML_GetIdAttributeIndex, /* 15 */ 31 | tcldom_getNodeFromName, /* 16 */ 32 | tcldom_getDocumentFromName, /* 17 */ 33 | }; 34 | 35 | /* !END!: Do not edit above this line. */ 36 | 37 | #endif /* USE_TCL_STUBS */ 38 | 39 | -------------------------------------------------------------------------------- /generic/tdomStubLib.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (c) 2007 Rolf Ade (rolf@pointsman.de) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | Implements entry point, which has to be called by C coded extensions 8 | | to tDOM. Following http://wiki.tcl.tk/3358. 9 | | 10 | | The contents of this file are subject to the Mozilla Public License 11 | | Version 1.1 (the "License"); you may not use this file except in 12 | | compliance with the License. You may obtain a copy of the License at 13 | | http://www.mozilla.org/MPL/ 14 | | 15 | | Software distributed under the License is distributed on an "AS IS" 16 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 17 | | License for the specific language governing rights and limitations 18 | | under the License. 19 | | 20 | | The Original Code is tDOM. 21 | | 22 | | The Initial Developer of the Original Code is Jochen Loewer 23 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 24 | | Jochen Loewer. All Rights Reserved. 25 | | 26 | | Contributor(s): 27 | | 28 | | 29 | | written by Rolf Ade 30 | | August, 2007 31 | | 32 | \---------------------------------------------------------------------------*/ 33 | 34 | #ifndef USE_TCL_STUBS 35 | # define USE_TCL_STUBS 36 | #endif 37 | #undef USE_TCL_STUB_PROCS 38 | 39 | #include 40 | 41 | /* 42 | * Ensure that Tdom_InitStubs is built as an exported symbol. The other stub 43 | * functions should be built as non-exported symbols. 44 | */ 45 | 46 | #undef TCL_STORAGE_CLASS 47 | #define TCL_STORAGE_CLASS DLLEXPORT 48 | 49 | TdomStubs *tdomStubsPtr; 50 | 51 | /*---------------------------------------------------------------------------- 52 | | Tdom_InitStubs 53 | | 54 | \---------------------------------------------------------------------------*/ 55 | 56 | CONST char * 57 | Tdom_InitStubs ( 58 | Tcl_Interp *interp, 59 | char *version, 60 | int exact 61 | ) 62 | { 63 | CONST char *actualVersion; 64 | ClientData clientData = NULL; 65 | 66 | #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 0) 67 | Tcl_SetResult(interp, "Too old Tcl version. Binary extensions " 68 | "to tDOM are not possible, with a that outdated " 69 | "Tcl version.", TCL_STATIC); 70 | return NULL; 71 | #else 72 | actualVersion = Tcl_PkgRequireEx(interp, "tdom", version, exact, 73 | (ClientData*) &clientData); 74 | tdomStubsPtr = (TdomStubs*)clientData; 75 | 76 | if (!actualVersion) { 77 | return NULL; 78 | } 79 | if (!tdomStubsPtr) { 80 | Tcl_SetResult(interp, "This implementation of Tdom does not " 81 | "support stubs", TCL_STATIC); 82 | return NULL; 83 | } 84 | 85 | return actualVersion; 86 | #endif 87 | } 88 | -------------------------------------------------------------------------------- /generic/tdominit.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | A DOM implementation for Tcl using James Clark's expat XML parser 9 | | 10 | | 11 | | The contents of this file are subject to the Mozilla Public License 12 | | Version 1.1 (the "License"); you may not use this file except in 13 | | compliance with the License. You may obtain a copy of the License at 14 | | http://www.mozilla.org/MPL/ 15 | | 16 | | Software distributed under the License is distributed on an "AS IS" 17 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 18 | | License for the specific language governing rights and limitations 19 | | under the License. 20 | | 21 | | The Original Code is tDOM. 22 | | 23 | | The Initial Developer of the Original Code is Jochen Loewer 24 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 25 | | Jochen Loewer. All Rights Reserved. 26 | | 27 | | Contributor(s): 28 | | 29 | | 30 | | written by Jochen Loewer 31 | | April, 1999 32 | | 33 | \---------------------------------------------------------------------------*/ 34 | 35 | 36 | 37 | /*---------------------------------------------------------------------------- 38 | | Includes 39 | | 40 | \---------------------------------------------------------------------------*/ 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | extern TdomStubs tdomStubs; 47 | 48 | /* 49 | *---------------------------------------------------------------------------- 50 | * 51 | * Tdom_Init -- 52 | * 53 | * Initialization routine for loadable module 54 | * 55 | * Results: 56 | * None. 57 | * 58 | * Side effects: 59 | * Defines "expat"/"dom" commands in the interpreter. 60 | * 61 | *---------------------------------------------------------------------------- 62 | */ 63 | 64 | int 65 | Tdom_Init (interp) 66 | Tcl_Interp *interp; /* Interpreter to initialize. */ 67 | { 68 | int nrOfBytes; 69 | Tcl_UniChar uniChar; 70 | 71 | #ifdef USE_TCL_STUBS 72 | Tcl_InitStubs(interp, "8", 0); 73 | #endif 74 | 75 | 76 | nrOfBytes = Tcl_UtfToUniChar ("\xF4\xA2\xA2\xA2", &uniChar); 77 | #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 6) 78 | # if TCL_UTF_MAX > 4 79 | if (nrOfBytes != 4) { 80 | # else 81 | if (nrOfBytes > 1) { 82 | # endif 83 | #else 84 | # if TCL_UTF_MAX > 3 85 | if (nrOfBytes != 4) { 86 | # else 87 | if (nrOfBytes > 1) { 88 | # endif 89 | #endif 90 | Tcl_SetResult (interp, "This interpreter and tDOM are build with" 91 | " different Tcl_UniChar types and therefore not" 92 | " binary compatible.", NULL); 93 | return TCL_ERROR; 94 | } 95 | 96 | domModuleInitialize(); 97 | 98 | #ifdef TCL_THREADS 99 | tcldom_initialize(); 100 | #endif /* TCL_THREADS */ 101 | 102 | #ifndef TDOM_NO_UNKNOWN_CMD 103 | Tcl_Eval(interp, "rename unknown unknown_tdom"); 104 | Tcl_CreateObjCommand(interp, "unknown", tcldom_unknownCmd, NULL, NULL ); 105 | #endif 106 | 107 | Tcl_CreateObjCommand(interp, "dom", tcldom_DomObjCmd, NULL, NULL ); 108 | Tcl_CreateObjCommand(interp, "domDoc", tcldom_DocObjCmd, NULL, NULL ); 109 | Tcl_CreateObjCommand(interp, "domNode", tcldom_NodeObjCmd, NULL, NULL ); 110 | Tcl_CreateObjCommand(interp, "tdom", TclTdomObjCmd, NULL, NULL ); 111 | 112 | #ifndef TDOM_NO_EXPAT 113 | Tcl_CreateObjCommand(interp, "expat", TclExpatObjCmd, NULL, NULL ); 114 | Tcl_CreateObjCommand(interp, "xml::parser", TclExpatObjCmd, NULL, NULL ); 115 | #endif 116 | 117 | #ifdef USE_TCL_STUBS 118 | Tcl_PkgProvideEx(interp, PACKAGE_NAME, PACKAGE_VERSION, 119 | (ClientData) &tdomStubs); 120 | #else 121 | Tcl_PkgProvide(interp, PACKAGE_NAME, PACKAGE_VERSION); 122 | #endif 123 | 124 | return TCL_OK; 125 | } 126 | 127 | int 128 | Tdom_SafeInit (interp) 129 | Tcl_Interp *interp; 130 | { 131 | return Tdom_Init (interp); 132 | } 133 | 134 | /* 135 | * Load the AOLserver stub. This allows the library 136 | * to be loaded as AOLserver module. 137 | */ 138 | 139 | #if defined (NS_AOLSERVER) 140 | # include "aolstub.cpp" 141 | #endif 142 | 143 | -------------------------------------------------------------------------------- /generic/utf8conv.h: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------- 2 | | Copyright (C) 1999 Jochen C. Loewer (loewerj@hotmail.com) 3 | +---------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | Functions, which (try) to convert UTF-8 encoded Unicode strings back 9 | | to some 8bit encodings like ISO-8859-*, ... 10 | | 11 | | 12 | | The contents of this file are subject to the Mozilla Public License 13 | | Version 1.1 (the "License"); you may not use this file except in 14 | | compliance with the License. You may obtain a copy of the License at 15 | | http://www.mozilla.org/MPL/ 16 | | 17 | | Software distributed under the License is distributed on an "AS IS" 18 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 19 | | License for the specific language governing rights and limitations 20 | | under the License. 21 | | 22 | | The Original Code is tDOM. 23 | | 24 | | The Initial Developer of the Original Code is Jochen Loewer 25 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 26 | | Jochen Loewer. All Rights Reserved. 27 | | 28 | | Contributor(s): 29 | | 30 | | 31 | | $Log$ 32 | | Revision 1.3 2004/08/14 14:42:27 rolf 33 | | Use 'Id' cvs keyword (instead of 'Header') in the file heads. 34 | | 35 | | Revision 1.2 2002/07/04 15:06:49 zoran 36 | | fixed reference to unsigned* to char since Sun compiler barfs at it. 37 | | 38 | | Revision 1.1.1.1 2002/02/22 01:05:35 rolf 39 | | tDOM0.7test with Jochens first set of patches 40 | | 41 | | 42 | | 43 | | written by Jochen Loewer 44 | | November, 1999 45 | | 46 | \--------------------------------------------------------------------------*/ 47 | 48 | #ifndef __UTF8CONV_H__ 49 | #define __UTF8CONV_H__ 50 | 51 | 52 | /*--------------------------------------------------------------------------- 53 | | Includes 54 | | 55 | \--------------------------------------------------------------------------*/ 56 | #include 57 | #include 58 | #include 59 | 60 | 61 | /*--------------------------------------------------------------------------- 62 | | Typedefs 63 | | 64 | \--------------------------------------------------------------------------*/ 65 | typedef struct { 66 | int type; 67 | int start_code; 68 | int len; 69 | char * map; 70 | } TEncodingRule; 71 | 72 | typedef struct { 73 | const char * name; 74 | int fallback_char; 75 | TEncodingRule * rules; 76 | } TEncoding; 77 | 78 | 79 | 80 | /*-------------------------------------------------------------------------- 81 | | Function prototypes 82 | | 83 | \-------------------------------------------------------------------------*/ 84 | TEncoding * tdom_GetEncoding (char *name); 85 | char * tdom_GetEncodingName (TEncoding *encoding); 86 | void tdom_Utf8to8Bit (TEncoding *encoding, 87 | const char *utf8_string, int *len); 88 | 89 | #endif 90 | 91 | 92 | -------------------------------------------------------------------------------- /generic/win32.h: -------------------------------------------------------------------------------- 1 | 2 | /* This is stuff to make the code compile with VC++ 6.0 3 | I know nearly nothing about other versions. */ 4 | 5 | #include 6 | #define isnan _isnan 7 | #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 : ((_fpclass(d) == _FPCLASS_NINF) ? -1 :0)) 8 | 9 | 10 | /* #ifndef isnan */ 11 | /* int isnan(double number) { return (!(number == number)); } */ 12 | /* #endif */ 13 | 14 | 15 | -------------------------------------------------------------------------------- /generic/xmlsimple.h: -------------------------------------------------------------------------------- 1 | 2 | domDocument * XML_SimpleParseDocument ( char *xml, int ignoreWhiteSpaces, 3 | char *baseURI, Tcl_Obj *extResolver, 4 | int *pos, char **errStr ); 5 | -------------------------------------------------------------------------------- /mac/PrecompHeaders/CoreHeadersMach-O.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/mac/PrecompHeaders/CoreHeadersMach-O.c -------------------------------------------------------------------------------- /mac/PrecompHeaders/CoreHeadersMach-O.h: -------------------------------------------------------------------------------- 1 | // CoreHeadersMach-O.h #if __mwlinker__ #include #else #include #endif -------------------------------------------------------------------------------- /mac/PrecompHeaders/CoreHeadersMach-O.pch: -------------------------------------------------------------------------------- 1 | // CoreHeadersMach-O.pch #pragma c99 on #define _MSL_USING_MW_C_HEADERS 1 #if __mwlinker__ #pragma precompile_target "CoreHeadersMacOSX" #else #pragma precompile_target "CoreHeadersMach-O" #endif /* Now just include the "CoreHeadersMach-O.c" source file ... */ #pragma once on #include "CoreHeadersMach-O.c" -------------------------------------------------------------------------------- /mac/Prefix/expatPrefix.h: -------------------------------------------------------------------------------- 1 | #define MACOS_CLASSIC -------------------------------------------------------------------------------- /mac/Prefix/expatPrefix_OSX.h: -------------------------------------------------------------------------------- 1 | #define MACOS_CLASSIC #include "MSL MacHeadersMach-O.h" -------------------------------------------------------------------------------- /mac/Prefix/tDOMPrefix.h: -------------------------------------------------------------------------------- 1 | #pragma once on #include "tclMacCommonPch.h" #define USE_TCL_STUBS 1 #define TDOM_NO_UNKNOWN_CMD #define VERSION "0.8.3" 2 | -------------------------------------------------------------------------------- /mac/Prefix/tDOMPrefix_OSX.h: -------------------------------------------------------------------------------- 1 | #pragma once on #include "CoreHeadersMach-O.h" // These symbols are defined from MSL MacHeadersMach-O.h // (errno.h and stat.h are in the Kernel.framework) // and are redefined later in TclErrno.h : undef them // to avoid error message #undef EOVERFLOW #undef EOPNOTSUPP // This avoids the loading of stat.h from tclMacPort.h #define _MSL_STAT_H // --------------------------------------------------------------- // Replace #include "tclMacCommonPch.h" by its partial contents. #if !__option(enumsalwaysint) #error Tcl requires the Metrowerks setting "Enums always ints". #endif // Tell Tcl (or any Tcl extensions) that we are compiling for the Macintosh platform. #define MAC_TCL // --------------------------------------------------------------- #define USE_TCL_STUBS 1 // See dom.h for this one: #define USE_NORMAL_ALLOCATOR #define TCL_MEM_DEBUG #define MAC_OSX_TCL #define TDOM_NO_UNKNOWN_CMD #define VERSION "0.8.3" #include 2 | -------------------------------------------------------------------------------- /mac/Prefix/tncPrefix.h: -------------------------------------------------------------------------------- 1 | #pragma once on #include "tclMacCommonPch.h" #define USE_TCL_STUBS 1 #define USE_TDOM_STUBS 1 #undef VERSION #define VERSION "0.3" -------------------------------------------------------------------------------- /mac/Prefix/tncPrefix_OSX.h: -------------------------------------------------------------------------------- 1 | #pragma once on #define USE_TDOM_STUBS 1 #include "tDOMPrefix_OSX.h" #undef VERSION #define VERSION "0.3" -------------------------------------------------------------------------------- /mac/Readme_Mac_Compiling: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/mac/Readme_Mac_Compiling -------------------------------------------------------------------------------- /mac/macconfig.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2000, Clark Cooper 2 | All rights reserved. 3 | 4 | This is free software. You are permitted to copy, distribute, or modify 5 | it under the terms of the MIT/X license (contained in the COPYING file 6 | with this distribution.) 7 | */ 8 | 9 | /* Define to empty if the keyword does not work. */ 10 | #undef const 11 | 12 | /* Define if you have a working `mmap' system call. */ 13 | #undef HAVE_MMAP 14 | 15 | /* Define to `long' if doesn't define. */ 16 | #undef off_t 17 | 18 | /* Define to `unsigned' if doesn't define. */ 19 | #undef size_t 20 | 21 | /* Define if you have the ANSI C header files. */ 22 | #define STDC_HEADERS 1 23 | 24 | /* Define if your processor stores words with the most significant 25 | byte first (like Motorola and SPARC, unlike Intel and VAX). */ 26 | //#undef WORDS_BIGENDIAN 27 | #define WORDS_BIGENDIAN 28 | 29 | /* Define if you have the bcopy function. */ 30 | #undef HAVE_BCOPY 31 | 32 | /* Define if you have the getpagesize function. */ 33 | #undef HAVE_GETPAGESIZE 34 | 35 | /* Define if you have the memmove function. */ 36 | #define HAVE_MEMMOVE 1 37 | 38 | /* Define if you have the header file. */ 39 | // #undef HAVE_FCNTL_H 40 | #define HAVE_FCNTL_H 41 | 42 | /* Define if you have the header file. */ 43 | #define HAVE_UNISTD_H 1 44 | 45 | #define XML_NS 46 | #define XML_DTD 47 | 48 | #ifdef WORDS_BIGENDIAN 49 | #define XML_BYTE_ORDER 21 50 | #else 51 | #define XML_BYTE_ORDER 12 52 | #endif 53 | 54 | #define XML_CONTEXT_BYTES 1024 55 | 56 | #ifndef HAVE_MEMMOVE 57 | #ifdef HAVE_BCOPY 58 | #define memmove(d,s,l) bcopy((s),(d),(l)) 59 | #else 60 | #define memmove(d,s,l) ;punting on memmove; 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /mac/tDOM.exp: -------------------------------------------------------------------------------- 1 | Tdom_Init 2 | Tdom_SafeInit 3 | CHandlerSetCreate 4 | CHandlerSetGet 5 | CHandlerSetGetUserData 6 | CHandlerSetInstall 7 | CHandlerSetRemove 8 | CheckExpatParserObj 9 | GetExpatInfo 10 | TclExpatObjCmd 11 | XML_GetBase 12 | XML_GetCurrentByteCount 13 | XML_GetCurrentByteIndex 14 | XML_GetCurrentColumnNumber 15 | XML_GetCurrentLineNumber 16 | XML_GetIdAttributeIndex 17 | XML_GetSpecifiedAttributeCount 18 | XML_SetBase 19 | -------------------------------------------------------------------------------- /mac/tDOM.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/mac/tDOM.r -------------------------------------------------------------------------------- /mac/tDOM/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | if {[catch {package require Tcl 8.2}]} return 2 | 3 | package ifneeded tdom 0.7.8 [list load [file join $dir tDOM.0.7.8.dylib] Tdom] 4 | 5 | 6 | package ifneeded tnc 0.3.0 "package require tdom; 7 | load [list [file join $dir tnc.0.3.0.dylib]] tnc" 8 | -------------------------------------------------------------------------------- /mac/tnc.exp: -------------------------------------------------------------------------------- 1 | Tnc_Init 2 | -------------------------------------------------------------------------------- /mac/tnc.r: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/mac/tnc.r -------------------------------------------------------------------------------- /macosx/README: -------------------------------------------------------------------------------- 1 | 2 | Please go to ../unix directory and inspect the CONFIG file. 3 | There you will find example on how to configure and make 4 | the library on Mac OSX using GNU configure/make tools. 5 | 6 | -EOF 7 | -------------------------------------------------------------------------------- /tclconfig/README.txt: -------------------------------------------------------------------------------- 1 | These files comprise the basic building blocks for a Tcl Extension 2 | Architecture (TEA) extension. For more information on TEA see: 3 | 4 | http://www.tcl.tk/doc/tea/ 5 | 6 | This package is part of the Tcl project at SourceForge, and latest 7 | sources should be available there: 8 | 9 | http://tcl.sourceforge.net/ 10 | 11 | This package is a freely available open source package. You can do 12 | virtually anything you like with it, such as modifying it, redistributing 13 | it, and selling it either in whole or in part. 14 | 15 | CONTENTS 16 | ======== 17 | The following is a short description of the files you will find in 18 | the sample extension. 19 | 20 | README.txt This file 21 | 22 | install-sh Program used for copying binaries and script files 23 | to their install locations. 24 | 25 | tcl.m4 Collection of Tcl autoconf macros. Included by a package's 26 | aclocal.m4 to define TEA_* macros. 27 | -------------------------------------------------------------------------------- /tdomConfig.sh.in: -------------------------------------------------------------------------------- 1 | # 2 | # tdomConfig.sh -- 3 | # 4 | # This shell script (for Bourne sh and alike) is generated 5 | # automatically by tDOM configure script. It will create 6 | # shell variables for some of the configuration options 7 | # discovered by the configure. This script is intended to be 8 | # sourced by the configure scripts for tDOM extensions so 9 | # that they don't have to figure this all out for themselves. 10 | # This file does not duplicate information already provided 11 | # by tclConfig.sh, so you may need to use that file in addition 12 | # to this one. To be able to locate this file easily, extensions 13 | # might want to include the tdom.m4 file in their configure 14 | # scripts and use the TDOM_PATH_CONFIG and TDOM_LOAD_CONFIG. 15 | # 16 | # The information in this file is specific to a single platform. 17 | # 18 | 19 | # 20 | # tDOM version number 21 | # 22 | TDOM_VERSION='@PACKAGE_VERSION@' 23 | 24 | # The name of the TDOM library (may be either a .a file or a shared library): 25 | TDOM_LIB_FILE=@PKG_LIB_FILE@ 26 | 27 | # 28 | # The name of the tDOM stub library file 29 | # 30 | TDOM_STUB_LIB_FILE=@PKG_STUB_LIB_FILE@ 31 | 32 | # 33 | # String to pass to linker to pick up the tDOM library from 34 | # its build directory. 35 | # 36 | TDOM_BUILD_STUB_LIB_SPEC='@PKG_BUILD_STUB_LIB_SPEC@' 37 | 38 | # 39 | # String to pass to linker to pick up the tDOM library from 40 | # its installed directory. 41 | # 42 | TDOM_STUB_LIB_SPEC='@PKG_STUB_LIB_SPEC@' 43 | 44 | # String to pass to linker to pick up the TDOM stub library from its 45 | # build directory. 46 | # 47 | TDOM_BUILD_STUB_LIB_PATH='@PKG_BUILD_STUB_LIB_PATH@' 48 | 49 | # String to pass to linker to pick up the TDOM stub library from its 50 | # installed directory. 51 | # 52 | TDOM_STUB_LIB_PATH='@PKG_STUB_LIB_PATH@' 53 | 54 | # 55 | # Location of the top-level source directories from which tDOM 56 | # was built. This is the directory that contains generic, unix, 57 | # win etc. If tDOM was compiled in a different place than the 58 | # directory containing the source files, this points to the 59 | # location of the sources, not the location where tDOM was compiled. 60 | # 61 | TDOM_SRC_DIR='@srcdir@' 62 | 63 | # EOF 64 | -------------------------------------------------------------------------------- /tests/all-bench.tcl: -------------------------------------------------------------------------------- 1 | # all-bench.tcl -- 2 | # 3 | # This file contains the top-level script to run the tDOM bench mark 4 | # suite. 5 | # 6 | # Copyright (c) 2007 by Rolf Ade (rolf@pointsman.de). 7 | # 8 | # $Id$ 9 | # 10 | # The script knows the options: 11 | # 12 | # -interppath 13 | # Adds a path to the list of pathes, which are searched for tclshs 14 | # with the pattern given by the -pattern option. Every time, this 15 | # option is given, the option value is added to the search list. If 16 | # not given, it is set to directory the tclsh, running the script, 17 | # lives in. 18 | # 19 | # -norm 20 | # See man bench, ::bench::norm 21 | # 22 | # -pattern 23 | # Specifies the search pattern for tclshs in the search 24 | # directories. Defaults to tclsh* 25 | # 26 | # -file 27 | # Specifies the search pattern for bench files in the same directory 28 | # as the all-bench.tcl. The default is *.bench. 29 | # 30 | # Every known option to ::bench::run (as of 0.3.1) are passed throu to 31 | # that command. See man bench for the details. 32 | # 33 | # Example: 34 | # tclsh all-bench.tcl \ 35 | # -interppath /usr/local/lib \ 36 | # -pkgdir ~/tdom/tdom-0.8.2 \ 37 | # -pkgdir ~/tdom/tdom-0.8.2-mod 38 | # 39 | # You can measure the same tDOM version against various tclshs, or 40 | # different tDOM versions with the same tclsh, or different tDOM 41 | # versions with differenct tclshs, all side by side. 42 | # 43 | # Don't run this script with a tcldomsh, until you know, what you're 44 | # doing. 45 | 46 | # bench 0.3.1 added the -pkgdir flag; we need at least that version, 47 | # if we want to compare more than one tDOM versions side by side. 48 | package require bench 0.3.1 49 | package require bench::out::text 50 | 51 | 52 | # Defaults / Initialization 53 | set interpPattern tclsh* 54 | set benchFilePattern *.bench 55 | set interpPaths [list] 56 | set benchFlags [list] 57 | # Empty string means: no normalization 58 | set norm "" 59 | 60 | foreach {arg argValue} $argv { 61 | switch -- $arg { 62 | "-interppath" { 63 | lappend interpPaths $argValue 64 | } 65 | "-norm" { 66 | if {![string is integer -strict $argValue] || $argValue < 1} { 67 | puts stderr "The option -norm expects a postiv integer as\ 68 | value." 69 | exit 1 70 | } 71 | set norm $argValue 72 | } 73 | "-pattern" { 74 | set interpPattern $argValue 75 | } 76 | "-file" { 77 | set benchFilePattern $argValue 78 | } 79 | default { 80 | switch -- $arg { 81 | "-errors" - 82 | "-threads" - 83 | "-match" - 84 | "-rmatch" - 85 | "-iters" - 86 | "-pkgdir" { 87 | lappend benchFlags $arg $argValue 88 | } 89 | default { 90 | puts stderr "Unknown option '$arg'" 91 | exit 1 92 | } 93 | } 94 | } 95 | } 96 | } 97 | 98 | 99 | if {[llength $interpPaths] == 0} { 100 | lappend interpPaths [file dirname [info nameofexecutable]] 101 | puts $interpPaths 102 | } 103 | 104 | puts [bench::locate $interpPattern $interpPaths] 105 | 106 | set interps [bench::versions [bench::locate $interpPattern $interpPaths]] 107 | 108 | if {![llength $interps]} { 109 | puts stderr "No interpreters found" 110 | exit 1 111 | } 112 | 113 | if {[llength $benchFlags]} { 114 | set cmd [linsert $benchFlags 0 bench::run] 115 | } else { 116 | set cmd [list bench::run] 117 | } 118 | 119 | set benchfiles [glob -nocomplain [file join [file dir [info script]] \ 120 | $benchFilePattern]] 121 | if {![llength $benchfiles]} { 122 | puts stderr "No benchmark files found." 123 | exit 1 124 | } 125 | 126 | set run $cmd 127 | lappend run $interps $benchfiles 128 | set results [eval $run] 129 | if {$norm ne ""} { 130 | set results [::bench::norm $results $norm] 131 | } 132 | puts [::bench::out::text $results] 133 | -------------------------------------------------------------------------------- /tests/all.tcl: -------------------------------------------------------------------------------- 1 | # all.tcl -- 2 | # 3 | # This file contains a top-level script to run all of the Tcl 4 | # tests. Execute it by invoking "tclsh all.test". 5 | # 6 | # Copyright (c) 1998-1999 by Scriptics Corporation. 7 | # All rights reserved. 8 | # 9 | # RCS: @(#) $Id$ 10 | # 11 | 12 | source [file join [file dir [info script]] loadtdom.tcl] 13 | 14 | if {$tcl_version >= 8.1} { 15 | if {[lsearch [info proc ::tcltest::testConstraint] \ 16 | ::tcltest::testConstraint] == -1} { 17 | set ::tcltest::testConfig(need_i18n) 1 18 | set ::tcltest::testConstraints(need_i18n) 1 19 | if {[info procs ::tDOM::extRefHandler] != ""} { 20 | set ::tcltest::testConfig(need_uri) 1 21 | set ::tcltest::testConstraints(need_uri) 1 22 | } 23 | } else { 24 | ::tcltest::testConstraint need_i18n 1 25 | if {[info procs ::tDOM::extRefHandler] != ""} { 26 | ::tcltest::testConstraint need_uri 1 27 | } 28 | } 29 | } 30 | 31 | set timeCmd {clock format [clock seconds]} 32 | 33 | set ::tcltest::testSingleFile false 34 | 35 | puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" 36 | 37 | if {$tcl_version < 8.2} { 38 | set TESTS_DIR [file join [pwd] [file dirname [info script]]] 39 | set currentDir [pwd] 40 | 41 | set globPattern [file join $TESTS_DIR *.test] 42 | foreach file [lsort [glob $globPattern]] { 43 | set tail [file tail $file] 44 | if {[string match l.*.test $tail]} { 45 | # This is an SCCS lockfile; ignore it 46 | continue 47 | } 48 | puts stdout $tail 49 | if {[catch {source $file} msg]} { 50 | puts stdout $msg 51 | } 52 | } 53 | } else { 54 | set ::tcltest::testsDirectory [file dir [info script]] 55 | 56 | puts stdout "Tests running in working dir: $::tcltest::testsDirectory" 57 | if {[llength $::tcltest::skip] > 0} { 58 | puts stdout "Skipping tests that match: $::tcltest::skip" 59 | } 60 | if {[llength $::tcltest::match] > 0} { 61 | puts stdout "Only running tests that match: $::tcltest::match" 62 | } 63 | 64 | if {[llength $::tcltest::skipFiles] > 0} { 65 | puts stdout "Skipping test files that match: $::tcltest::skipFiles" 66 | } 67 | if {[llength $::tcltest::matchFiles] > 0} { 68 | puts stdout "Only sourcing test files that match: $::tcltest::matchFiles" 69 | } 70 | 71 | puts stdout "Tests began at [eval $timeCmd]" 72 | 73 | # source each of the specified tests 74 | foreach file [lsort [::tcltest::getMatchingFiles]] { 75 | set tail [file tail $file] 76 | puts stdout $tail 77 | if {[catch {source $file} msg]} { 78 | puts stdout $msg 79 | } 80 | } 81 | } 82 | 83 | # cleanup 84 | puts stdout "\nTests ended at [eval $timeCmd]" 85 | ::tcltest::cleanupTests 1 86 | 87 | # See http://mini.net/tcl/3248 for an explanation. 88 | proc exit args {} 89 | 90 | -------------------------------------------------------------------------------- /tests/comment.test: -------------------------------------------------------------------------------- 1 | # Features covered: comments 2 | # 3 | # This file tests the parser's performance on comments. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 1998-2000 Zveno Pty Ltd. 8 | # 9 | # $Id$ 10 | 11 | source [file join [file dir [info script]] loadtdom.tcl] 12 | 13 | catch {unset result} 14 | proc pcdata data { 15 | append ::result $data 16 | } 17 | proc comment data { 18 | append ::comment $data 19 | } 20 | proc Estart {tagName attrList} { 21 | switch -- $tagName { 22 | test - 23 | Test { 24 | } 25 | default { 26 | incr ::element 27 | } 28 | } 29 | } 30 | 31 | proc EStop tagname { 32 | } 33 | 34 | test comment-1.1 {Simple comment} { 35 | set ::result {} 36 | set ::comment {} 37 | set ::element 0 38 | 39 | catch {rename xml::comment-1.1 {}} 40 | set parser [xml::parser comment-1.1 \ 41 | -elementstartcommand Estart \ 42 | -elementendcommand EStop \ 43 | -characterdatacommand pcdata \ 44 | -commentcommand comment] 45 | $parser parse { 46 | 47 | 48 | } 49 | list $::comment $::result $::element 50 | } {{ This is a comment } {} 0} 51 | 52 | test comment-1.2 {Simple comment, no white space} { 53 | set ::result {} 54 | set ::comment {} 55 | set ::element 0 56 | 57 | catch {rename xml::comment-1.2 {}} 58 | set parser [xml::parser comment-1.2 \ 59 | -elementstartcommand Estart \ 60 | -elementendcommand EStop \ 61 | -characterdatacommand pcdata \ 62 | -commentcommand comment] 63 | $parser parse { 64 | 65 | 66 | } 67 | list $::comment $::result $::element 68 | } {{This is a comment} {} 0} 69 | 70 | test comment-1.3 {Simple comment, within PCDATA} { 71 | set ::result {} 72 | set ::comment {} 73 | set ::element 0 74 | 75 | catch {rename xml::comment-1.3 {}} 76 | set parser [xml::parser comment-1.3 \ 77 | -elementstartcommand Estart \ 78 | -elementendcommand EStop \ 79 | -characterdatacommand pcdata \ 80 | -commentcommand comment] 81 | $parser parse { 82 | 83 | surrounding PCDATA 84 | } 85 | list $::comment $::result $::element 86 | } {{This is a comment} {surrounding PCDATA} 0} 87 | 88 | test comment-1.3 {Simple comment, no white space} { 89 | set ::result {} 90 | set ::comment {} 91 | set ::element 0 92 | 93 | catch {rename xml::comment-1.3 {}} 94 | set parser [xml::parser comment-1.3 \ 95 | -elementstartcommand Estart \ 96 | -elementendcommand EStop \ 97 | -characterdatacommand pcdata \ 98 | -commentcommand comment] 99 | $parser parse { 100 | 101 | 102 | } 103 | list $::comment $::result $::element 104 | } {comment {} 0} 105 | 106 | test comment-1.4 {comment, with nested element} { 107 | set ::result {} 108 | set ::comment {} 109 | set ::element 0 110 | 111 | catch {rename xml::comment-1.4 {}} 112 | set parser [xml::parser comment-1.4 \ 113 | -elementstartcommand Estart \ 114 | -elementendcommand EStop \ 115 | -characterdatacommand pcdata \ 116 | -commentcommand comment] 117 | $parser parse { 118 | 119 | 120 | } 121 | list $::comment $::result $::element 122 | } {{ comment } {} 0} 123 | 124 | test comment-2.1 {comment with an angle bracket} { 125 | set ::result {} 126 | set ::comment {} 127 | set ::element 0 128 | 129 | catch {rename xml::comment-2.1 {}} 130 | set parser [xml::parser comment-2.1 \ 131 | -elementstartcommand Estart \ 132 | -elementendcommand EStop \ 133 | -characterdatacommand pcdata \ 134 | -commentcommand comment] 135 | $parser parse { 136 | 137 | 138 | } 139 | list $::comment $::result $::element 140 | } {{ This is a > greater than sign } {} 0} 141 | 142 | test comment-2.2 {comment with multiple angle brackets} { 143 | set ::result {} 144 | set ::comment {} 145 | set ::element 0 146 | 147 | catch {rename xml::comment-2.2 {}} 148 | set parser [xml::parser comment-2.2 \ 149 | -elementstartcommand Estart \ 150 | -elementendcommand EStop \ 151 | -characterdatacommand pcdata \ 152 | -commentcommand comment] 153 | $parser parse { 154 | 155 | 162 | } 163 | list $::comment $::result $::element 164 | } {{ 165 | 166 | 167 | 168 | 169 | 170 | } {} 0} 171 | 172 | set comment_2_3 [format { 173 | 174 | 175 |
176 | } \}] 177 | 178 | test comment-2.3 {comment with entities} { 179 | set ::result {} 180 | set ::comment {} 181 | set ::element 0 182 | 183 | catch {rename xml::comment-2.3 {}} 184 | set parser [xml::parser comment-2.3 \ 185 | -elementstartcommand Estart \ 186 | -elementendcommand EStop \ 187 | -characterdatacommand pcdata \ 188 | -commentcommand comment] 189 | $parser parse " 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | " 199 | 200 | list [string compare $::comment ${comment_2_3}] [string trim $::result] $::element 201 | } [list 0 {} 2] 202 | 203 | foreach parser [info commands comment-*] { 204 | $parser free 205 | } 206 | 207 | # cleanup 208 | ::tcltest::cleanupTests 209 | return 210 | -------------------------------------------------------------------------------- /tests/data/books.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Seven Years in Trenton 7 | 8 | Joe 9 | Bob 10 | Trenton Literary Review Honorable Mention 11 | 12 | 12 13 | 14 | 15 | History of Trenton 16 | 17 | Mary 18 | Bob 19 | 20 | Selected Short Stories of 21 | Mary Bob 22 | 23 | 24 | 55 25 | 26 | 27 | Tracking Trenton 28 | 2.50 29 | 30 | 31 | 32 | Trenton Today, Trenton Tomorrow 33 | 34 | Toni 35 | Bob 36 | B.A. 37 | Ph.D. 38 | Pulizer 39 | Still in Trenton 40 | Trenton Forever 41 | 42 | 6.50 43 | 44 |

It was a dark and stormy night.

45 |

But then all nights in Trenton seem dark and 46 | stormy to someone who has gone through what 47 | I have.

48 | 49 | Trenton 50 | misery 51 | 52 |
53 |
54 | 55 | Who's Who in Trenton 56 | Robert Bob 57 | 58 |
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /tests/data/domCmd1.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/data/domCmd2.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/data/dtd-5.1.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/data/dtd-5.2.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/data/dtd-6.1.dtd: -------------------------------------------------------------------------------- 1 | 3 | ]]> 4 | -------------------------------------------------------------------------------- /tests/data/dtd-6.2.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/data/dtd-6.3.dtd: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/data/dtd-6.4.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | ]]> 5 | ]]> 6 | -------------------------------------------------------------------------------- /tests/data/dtd-6.5.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | ]]> 6 | -------------------------------------------------------------------------------- /tests/data/dtd-6.6.dtd: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]]> 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/data/i18n_1.xml: -------------------------------------------------------------------------------- 1 | абвгдежзий 2 | -------------------------------------------------------------------------------- /tests/data/i18n_2.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/tests/data/i18n_2.xml -------------------------------------------------------------------------------- /tests/data/xslt_1.xsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tDOM/tdom/363cbda3ac91b8955edbfd2b64625c725385d5b4/tests/data/xslt_1.xsl -------------------------------------------------------------------------------- /tests/doctype.test: -------------------------------------------------------------------------------- 1 | # Features covered: Document Type Declaration 2 | # 3 | # This file tests the parser's performance on Document Type Declarations. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 1998-2000 Zveno Pty Ltd. 8 | # 9 | # $Id$ 10 | 11 | source [file join [file dir [info script]] loadtdom.tcl] 12 | 13 | catch {unset result} 14 | proc doctype {name pub system dtd} { 15 | lappend ::result $name $pub $system $dtd 16 | } 17 | 18 | test doctype-1.1 {Document Type Declaration: no internal DTD subset} { 19 | set ::result {} 20 | 21 | catch {rename xml::doctype-1.1 {}} 22 | set parser [xml::parser doctype-1.1 \ 23 | -startdoctypedeclcommand doctype] 24 | $parser parse { 25 | 26 | 27 | } 28 | set ::result 29 | } {Test NULL NULL 0} 30 | 31 | test doctype-2.1 {Document Type Declaration: internal DTD subset} { 32 | set ::result {} 33 | 34 | catch {rename xml::doctype-2.1 {}} 35 | set parser [xml::parser doctype-2.1 \ 36 | -startdoctypedeclcommand doctype] 37 | $parser parse { 38 | ]> 39 | 40 | } 41 | set ::result 42 | } {Test NULL NULL 1} 43 | 44 | foreach parser [info commands doctype-*] { 45 | $parser free 46 | } 47 | 48 | # cleanup 49 | ::tcltest::cleanupTests 50 | return 51 | -------------------------------------------------------------------------------- /tests/element.test: -------------------------------------------------------------------------------- 1 | # Features covered: Elements 2 | # 3 | # This file tests the parser's performance on elements. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 1999-2000 Zveno Pty Ltd. 8 | # Copyright (c) 2002-2005 Rolf Ade 9 | # 10 | # $Id$ 11 | 12 | source [file join [file dir [info script]] loadtdom.tcl] 13 | 14 | proc parray arrayName { 15 | upvar #0 $arrayName arr 16 | foreach key [lsort [array names $arrayName]] { 17 | lappend result $key $arr($key) 18 | } 19 | return $result 20 | } 21 | 22 | catch {unset started} 23 | proc Start {name atList args} { 24 | array set opts $args 25 | if {![info exists ::started($name)]} { 26 | set ::started($name) 1 27 | } else { 28 | incr ::started($name) 29 | } 30 | } 31 | catch {unset ended} 32 | proc End {name args} { 33 | array set opts $args 34 | if {![info exists ::ended($name)]} { 35 | set ::ended($name) 1 36 | } else { 37 | incr ::ended($name) 38 | } 39 | } 40 | 41 | catch {unset elList} 42 | proc ElStart {name atList args} { 43 | array set opts {-empty 0} 44 | array set opts $args 45 | lappend ::elList start $name $opts(-empty) 46 | } 47 | proc ElEnd {name args} { 48 | array set opts {-empty 0} 49 | array set opts $args 50 | lappend ::elList end $name $opts(-empty) 51 | } 52 | 53 | test element-1.1 {document element} { 54 | catch {unset ::started} 55 | catch {unset ::ended} 56 | 57 | catch {rename xml::element-1.1 {}} 58 | set parser [xml::parser element-1.1 \ 59 | -elementstartcommand Start \ 60 | -elementendcommand End] 61 | $parser parse {} 62 | list [array get ::started] [array get ::ended] 63 | } {{Test 1} {Test 1}} 64 | 65 | test element-1.2 {distinct elements} { 66 | catch {unset ::started} 67 | catch {unset ::ended} 68 | 69 | catch {rename xml::element-1.2 {}} 70 | set parser [xml::parser element-1.2 \ 71 | -elementstartcommand Start \ 72 | -elementendcommand End] 73 | $parser parse {} 74 | list [parray ::started] [parray ::ended] 75 | } {{Child1 1 Child2 1 Test 1} {Child1 1 Child2 1 Test 1}} 76 | 77 | proc esh-2.1 {parsername name attlist} { 78 | if {$parsername == "element-2.1"} { 79 | set ::result 1 80 | } else { 81 | set ::result 0 82 | } 83 | } 84 | 85 | test element-2.1 {handler script} { 86 | set ::result 0 87 | set p [expat element-2.1 -elementstartcommand [list esh-2.1 element-2.1]] 88 | $p parse 89 | $p free 90 | set ::result 91 | } {1} 92 | 93 | proc eeh-2.2 {parsername name} { 94 | if {$parsername == "element-2.2"} { 95 | set ::result 1 96 | } else { 97 | set ::result 0 98 | } 99 | } 100 | 101 | test element-2.2 {handler script} { 102 | set ::result 0 103 | set p [expat element-2.2] 104 | $p configure -elementendcommand [list eeh-2.2 element-2.2] 105 | $p parse 106 | $p free 107 | set ::result 108 | } {1} 109 | 110 | test element-2.3 {declare handler proc later} { 111 | set ::eshcounter 0 112 | set ::eehcounter 0 113 | catch {rename esh-2.3 {}} 114 | catch {rename eeh-2.3 {}} 115 | set p [expat -elementstartcommand esh-2.3 -elementendcommand eeh-2.3] 116 | proc esh-2.3 {args} { 117 | incr ::eshcounter 118 | } 119 | proc eeh-2.3 {args} { 120 | incr ::eehcounter 121 | } 122 | $p parse {} 123 | $p free 124 | list $::eshcounter $::eehcounter 125 | } {3 3} 126 | 127 | proc esh-3.1-1 {args} { 128 | $::p configure -elementstartcommand esh-3.1-2 129 | incr ::esh-3.1-1 130 | incr ::eshcounter 131 | } 132 | 133 | proc esh-3.1-2 {args} { 134 | $::p configure -elementstartcommand esh-3.1-1 135 | incr ::esh-3.1-2 136 | incr ::eshcounter 137 | } 138 | 139 | test element-3.1 {change handler from handler callback} { 140 | set ::esh-3.1-1 0 141 | set ::esh-3.1-2 0 142 | set ::eshcounter 0 143 | set p [expat -elementstartcommand esh-3.1-1] 144 | $p parse {foo bar} 145 | $p free 146 | list ${::esh-3.1-1} ${::esh-3.1-2} $::eshcounter 147 | } {3 3 6} 148 | 149 | proc esh-3.2-1 {p args} { 150 | $p configure -elementstartcommand [list esh-3.2-2 $p] 151 | incr ::esh-3.2-1 152 | incr ::eshcounter 153 | } 154 | 155 | proc esh-3.2-2 {p args} { 156 | $p configure -elementstartcommand [list esh-3.2-1 $p] 157 | incr ::esh-3.2-2 158 | incr ::eshcounter 159 | } 160 | 161 | test element-3.2 {change handler from handler callback} { 162 | set ::esh-3.2-1 0 163 | set ::esh-3.2-2 0 164 | set ::eshcounter 0 165 | set p [expat] 166 | $p configure -elementstartcommand [list esh-3.2-1 $p] 167 | $p parse {foo bar} 168 | $p free 169 | list ${::esh-3.2-1} ${::esh-3.2-2} $::eshcounter 170 | } {4 3 7} 171 | 172 | foreach parser [info commands element-*] { 173 | $parser free 174 | } 175 | 176 | # cleanup 177 | ::tcltest::cleanupTests 178 | return 179 | -------------------------------------------------------------------------------- /tests/entity.test: -------------------------------------------------------------------------------- 1 | # Features covered: Entities 2 | # 3 | # This file contains a collection of tests for the different kinds of 4 | # entities. 5 | # 6 | # entity-1.*: parameter entities, character entities 7 | # entity-2.*: predefined entities 8 | # entity-3.*: -useForeignDTD 9 | # entity-4.*: external parsed entites 10 | # 11 | # Copyright (c) 1999-2000 Zveno Pty Ltd. 12 | # Copyright (c) 2000-2004 Rolf Ade 13 | # 14 | # $Id$ 15 | 16 | source [file join [file dir [info script]] loadtdom.tcl] 17 | 18 | proc Start {name attrList args} { 19 | incr ::elements 20 | } 21 | 22 | proc pcdata text { 23 | append ::result $text 24 | } 25 | 26 | proc EntityRef name { 27 | lappend ::references $name 28 | append ::result ##entityreference## 29 | return {} 30 | } 31 | 32 | test entity-1.1 {parameter entity in document entity} { 33 | set ::result {} 34 | 35 | catch {rename xml::entity-1.1 {}} 36 | set parser [xml::parser entity-1.1 \ 37 | -characterdatacommand pcdata] 38 | $parser parse { 40 | ]> 41 | %wrong;} 42 | set ::result 43 | } {%wrong;} 44 | 45 | test entity-1.2 {character entities in hex} { 46 | set ::result {} 47 | 48 | catch {rename xml::entity-1.2 {}} 49 | set parser [xml::parser entity-1.2 \ 50 | -characterdatacommand pcdata] 51 | $parser parse {A<>$[]} 52 | set ::result 53 | } {A<>$[]} 54 | 55 | test entity-1.3 {character entities in decimal} { 56 | set ::result {} 57 | 58 | catch {rename xml::entity-1.3 {}} 59 | set parser [xml::parser entity-1.3 \ 60 | -characterdatacommand pcdata] 61 | $parser parse {A<>$[]} 62 | set ::result 63 | } {A<>$[]} 64 | 65 | test entity-1.4 {illegal character entity} { 66 | set ::result {} 67 | 68 | catch {rename xml::entity-1.4 {}} 69 | set parser [xml::parser entity-1.4 \ 70 | -characterdatacommand pcdata] 71 | set err [catch {$parser parse {&#blah;}}] 72 | list $err $::result 73 | } {1 {}} 74 | 75 | test entity-2.1 {predefined general entities} { 76 | set ::result {} 77 | 78 | catch {rename xml::entity-2.1 {}} 79 | set parser [xml::parser entity-2.1 \ 80 | -characterdatacommand pcdata] 81 | $parser parse {<>&"'} 82 | set ::result 83 | } {<>&"'} 84 | 85 | # emacs: " 86 | 87 | proc extrefhandler-3 {base args} { 88 | global extrefhandlerCalled 89 | 90 | set extrefhandlerCalled 1 91 | 92 | return [list string $base ""] 93 | } 94 | 95 | test entity-3.1 {-useForeignDTD} { 96 | 97 | set ::extrefhandlerCalled 0 98 | set parser [expat -useForeignDTD 0 \ 99 | -externalentitycommand extrefhandler-3 \ 100 | -paramentityparsing notstandalone] 101 | $parser parse 102 | $parser free 103 | set ::extrefhandlerCalled 104 | } {0} 105 | 106 | test entity-3.2 {-useForeignDTD} { 107 | 108 | set ::extrefhandlerCalled 0 109 | set parser [expat -useForeignDTD 1 \ 110 | -externalentitycommand extrefhandler-3 \ 111 | -paramentityparsing notstandalone] 112 | $parser parse 113 | $parser free 114 | set ::extrefhandlerCalled 115 | } {1} 116 | 117 | test entity-3.3 {-useForeignDTD} { 118 | 119 | set ::extrefhandlerCalled 0 120 | set parser [expat -useForeignDTD 1 \ 121 | -externalentitycommand extrefhandler-3 \ 122 | -paramentityparsing notstandalone] 123 | $parser parse { 124 | 126 | ]> 127 | } 128 | $parser free 129 | set ::extrefhandlerCalled 130 | } {1} 131 | 132 | proc extrefhandler-4 {args} { 133 | global notexistendpath 134 | # Search for a not existing file path 135 | set base /ae124 136 | set filename 0 137 | set path [file join $base $filename] 138 | while {[file exists $path]} { 139 | incr filename 140 | set path [file join $base $filename] 141 | } 142 | set notexistendpath $path 143 | return [list filename $path $path] 144 | } 145 | 146 | test entity-4.1 {external entity: returned filename dose not exist} -body { 147 | set parser [expat -useForeignDTD 1 \ 148 | -externalentitycommand extrefhandler-4 \ 149 | -paramentityparsing always] 150 | set result [catch {$parser parse } errMsg] 151 | append result " $errMsg" 152 | $parser free 153 | set result 154 | } -match glob -result {1 error opening file "/ae124/*"} 155 | 156 | foreach parser [info commands entity-*] { 157 | $parser free 158 | } 159 | 160 | # cleanup 161 | ::tcltest::cleanupTests 162 | return 163 | -------------------------------------------------------------------------------- /tests/i18n.test: -------------------------------------------------------------------------------- 1 | # Features covered: international issues 2 | # 3 | # Copyright (c) 2002 Rolf Ade. 4 | # 5 | # RCS: @(#) $Id$ 6 | 7 | source [file join [file dir [info script]] loadtdom.tcl] 8 | 9 | testConstraint beyondBMP [expr {[dom featureinfo TCL_UTF_MAX] > 3}] 10 | testConstraint 8.6 [package vsatisfies [package present Tcl] 8.6] 11 | 12 | test i18n-1.1 {parse utf-8 string} {need_i18n} { 13 | set russian "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439" 14 | set doc [dom parse "$russian"] 15 | set root [$doc documentElement] 16 | set text [$root text] 17 | $doc delete 18 | string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439" 19 | } {0} 20 | 21 | test i18n-1.2 {parse utf-8 channel} {need_i18n} { 22 | set fd [open [file join [pwd] [file dir [info script]] data/i18n_1.xml]] 23 | fconfigure $fd -encoding utf-8 24 | set doc [dom parse -channel $fd] 25 | close $fd 26 | set root [$doc documentElement] 27 | set text [$root text] 28 | $doc delete 29 | string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439" 30 | } {0} 31 | 32 | test i18n-1.3 {parse utf-8 readFile} {need_i18n} { 33 | set doc [dom parse [::tDOM::xmlReadFile [file join [pwd] [file dir [info script]] data/i18n_1.xml]]] 34 | set root [$doc documentElement] 35 | set text [$root text] 36 | $doc delete 37 | string compare $text "\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439" 38 | } {0} 39 | 40 | test i18n-1.4 {pcdata outside BMP} -body { 41 | set doc [dom parse "👮👾💔"] 42 | set result [$doc asXML -indent none -escapeNonASCII] 43 | $doc delete 44 | set result 45 | } -result "👮👾💔" 46 | 47 | test i18n-1.5 {pcdata outside BMP} -body { 48 | set doc [dom parse "👮👾💔"] 49 | set result [$doc selectNodes string-length(/doc)] 50 | $doc delete 51 | set result 52 | } -result 3 53 | 54 | test i18n-1.6 {pcdata outside BMP} -constraints { 55 | 8.6 56 | beyondBMP 57 | } -body { 58 | set doc [dom parse "\U1F46E\U1F47E\U1F494"] 59 | set result [$doc asXML -indent none -escapeNonASCII] 60 | $doc delete 61 | set result 62 | } -result "👮👾💔" 63 | 64 | test i18n-1.7 {pcdata outside BMP} -body { 65 | set doc [dom parse "👮👾💔"] 66 | set result [dom isBMPCharData [$doc selectNodes string(/doc)]] 67 | $doc delete 68 | set result 69 | } -result 0 70 | 71 | test i18n-1.8 {pcdata outside BMP} -constraints { 72 | beyondBMP 73 | 8.6 74 | } -body { 75 | set doc [dom parse "\U1F46E\U1F47E\U1F494"] 76 | set result [$doc asXML -indent none] 77 | $doc delete 78 | set result 79 | } -result "\U1F46E\U1F47E\U1F494" 80 | 81 | test i18n-1.9 {pcdata outside BMP} -constraints { 82 | beyondBMP 83 | } -body { 84 | set doc [dom parse "👮👾💔"] 85 | set result [$doc asXML -indent none] 86 | $doc delete 87 | set result 88 | } -result "\U1F46E\U1F47E\U1F494" 89 | 90 | test i18n-1.10 {pcdata outside unicode} -body { 91 | set doc [dom parse "􏿿"] 92 | set result [$doc asXML -indent none -escapeNonASCII] 93 | $doc delete 94 | set result 95 | } -result "􏿿" 96 | 97 | test i18n-1.11 {pcdata outside unicode} -body { 98 | set result [catch {dom parse ""} msg] 99 | set msg 100 | } -match glob -result "*reference to invalid character number*" 101 | 102 | # cleanup 103 | ::tcltest::cleanupTests 104 | return 105 | 106 | -------------------------------------------------------------------------------- /tests/loadtdom.tcl: -------------------------------------------------------------------------------- 1 | # loadtdom.tcl -- 2 | # 3 | # This file is [source]d by all.tcl and all test files, to ensure, that 4 | # the tcltest package and the lastest tdom build is present. 5 | # 6 | # RCS: @(#) $Id$ 7 | # 8 | 9 | package require tcltest 10 | namespace import ::tcltest::* 11 | package require -exact tdom 0.8.3 12 | if {[lsearch [namespace children] ::tDOM] == -1} { 13 | # tcldomsh without the script library. Source the lib. 14 | source [file join [file dir [info script]] ../lib tdom.tcl] 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/namespace.test: -------------------------------------------------------------------------------- 1 | # Features covered: XML Namespaces 2 | # 3 | # This file tests the parser's performance on XML namespaces. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 2000 Zveno Pty Ltd. 8 | # 9 | # $Id$ 10 | 11 | source [file join [file dir [info script]] loadtdom.tcl] 12 | 13 | proc keysort args { 14 | array set keyvalue $args 15 | set result {} 16 | foreach key [lsort [array names keyvalue]] { 17 | lappend result $key $keyvalue($key) 18 | } 19 | return $result 20 | } 21 | 22 | catch {unset result} 23 | catch {unset nsdecls} 24 | proc EStart {tag attlist args} { 25 | global result nsdecls 26 | 27 | array set extra $args 28 | 29 | catch {eval lappend nsdecls $extra(-namespacedecls)} 30 | 31 | if {[info exists extra(-namespace)]} { 32 | lappend result $extra(-namespace)^$tag 33 | } else { 34 | lappend result $tag 35 | } 36 | } 37 | 38 | proc NSDeclStart {prefix uri} { 39 | global result 40 | 41 | lappend result $prefix 42 | lappend result $uri 43 | } 44 | 45 | test ns-1.1 {Namespace declaration} { 46 | set ::result {} 47 | set ::nsdecls {} 48 | 49 | catch {rename xml::ns-1.1 {}} 50 | set parser [xml::parser ns-1.1 \ 51 | -namespace \ 52 | -startnamespacedeclcommand NSDeclStart \ 53 | -elementstartcommand EStart] 54 | $parser parse { 55 | 56 | } 57 | list $::result $::nsdecls 58 | } {{test http://www.zveno.com/Schemas Test} {}} 59 | 60 | test ns-1.2 {Multiple namespace declarations} { 61 | set ::result {} 62 | set ::nsdecls {} 63 | 64 | catch {rename xml::ns-1.2 {}} 65 | set parser [xml::parser ns-1.2 \ 66 | -namespace \ 67 | -startnamespacedeclcommand NSDeclStart \ 68 | -elementstartcommand EStart] 69 | $parser parse { 70 | 72 | } 73 | list $::result [eval keysort $::nsdecls] 74 | } {{test http://www.zveno.com/Schemas x urn:schema Test} {}} 75 | 76 | test ns-1.3 {Default namespace declaration} { 77 | set ::result {} 78 | set ::nsdecls {} 79 | 80 | catch {rename xml::ns-1.3 {}} 81 | set parser [xml::parser ns-1.3 \ 82 | -namespace \ 83 | -startnamespacedeclcommand NSDeclStart \ 84 | -elementstartcommand EStart] 85 | $parser parse { 86 | 88 | } 89 | list $::result [eval keysort $::nsdecls] 90 | } {{{} http://www.zveno.com/Schemas x urn:schema http://www.zveno.com/Schemas:Test} {}} 91 | 92 | test ns-1.4 {Default namespace declaration w/- separate usage} { 93 | set ::result {} 94 | set ::nsdecls {} 95 | 96 | catch {rename xml::ns-1.4 {}} 97 | set parser [xml::parser ns-1.4 \ 98 | -namespace \ 99 | -startnamespacedeclcommand NSDeclStart \ 100 | -elementstartcommand EStart] 101 | $parser parse { 102 | 104 | } 105 | list $::result [eval keysort $::nsdecls] 106 | } {{{} http://www.zveno.com/Schemas x urn:schema urn:schema:Test http://www.zveno.com/Schemas:Test} {}} 107 | 108 | test ns-2.0 {Multiple namespace declarations, same prefix} { 109 | set ::result {} 110 | set ::nsdecls {} 111 | 112 | catch {rename xml::ns-2.0 {}} 113 | set parser [xml::parser ns-2.0 \ 114 | -namespace \ 115 | -startnamespacedeclcommand NSDeclStart \ 116 | -elementstartcommand EStart] 117 | $parser parse { 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | } 127 | list $::result [eval keysort $::nsdecls] 128 | } {{Test x http://www.zveno.com/Schemas http://www.zveno.com/Schemas:Test http://www.zveno.com/Schemas:y x urn:schema urn:schema:Test urn:schema:z} {}} 129 | 130 | foreach parser [info commands ns-*] { 131 | $parser free 132 | } 133 | 134 | # cleanup 135 | ::tcltest::cleanupTests 136 | return 137 | -------------------------------------------------------------------------------- /tests/pcdata.test: -------------------------------------------------------------------------------- 1 | # Features covered: PCDATA 2 | # 3 | # This file tests the parser's performance on PCDATA. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 1998-2000 Zveno Pty Ltd. 8 | # 9 | # $Id$ 10 | 11 | source [file join [file dir [info script]] loadtdom.tcl] 12 | 13 | catch {unset result} 14 | proc pcdata data { 15 | append ::result $data 16 | incr ::pcdataCounter 17 | } 18 | proc Estart {tagName attrList} { 19 | switch -- $tagName { 20 | Test { 21 | } 22 | default { 23 | incr ::element 24 | } 25 | } 26 | } 27 | 28 | proc EStop tagname { 29 | } 30 | 31 | test pcdata-1.1 {Simple PCDATA} { 32 | set ::result {} 33 | set ::element 0 34 | set ::pcdataCounter 0 35 | 36 | catch {rename xml::pcdata-1.1 {}} 37 | set parser [xml::parser xml::pcdata-1.1 \ 38 | -elementstartcommand Estart \ 39 | -elementendcommand EStop \ 40 | -characterdatacommand pcdata] 41 | $parser parse { 42 | 43 | This is PCDATA 44 | } 45 | list $::result $::element 46 | } {{This is PCDATA} 0} 47 | 48 | test pcdata-1.2 {PCDATA section with Tcl specials} { 49 | set ::result {} 50 | set ::element 0 51 | set ::pcdataCounter 0 52 | 53 | catch {rename xml::pcdata-1.2 {}} 54 | set parser [xml::parser xml::pcdata-1.2 \ 55 | -elementstartcommand Estart \ 56 | -elementendcommand EStop \ 57 | -characterdatacommand pcdata] 58 | $parser parse { 59 | 60 | Dollar $ backslash \ square brackets [ ] braces { } 61 | } 62 | list $::result $::element 63 | } {{Dollar $ backslash \ square brackets [ ] braces { }} 0} 64 | 65 | # Requested by Marshall Rose, 20/3/1999 66 | test pcdata-1.3 {PCDATA with no entity expansion} { 67 | set ::result {} 68 | set ::element 0 69 | set ::pcdataCounter 0 70 | 71 | catch {rename xml::pcdata-1.3 {}} 72 | set parser [xml::parser xml::pcdata-1.3 \ 73 | -elementstartcommand Estart \ 74 | -elementendcommand EStop \ 75 | -characterdatacommand pcdata] 76 | $parser parse { 77 | 78 | This is <PCDATA> 79 | } 80 | list $::result $::pcdataCounter 81 | } {{This is } 1} 82 | 83 | test pcdata-1.3 {keep all PCDATA for not white space only PCDATA content} { 84 | set ::result {} 85 | 86 | catch {rename xml::pcdata-1.4 {}} 87 | set parser [xml::parser xml::pcdata-1.4 \ 88 | -characterdatacommand pcdata \ 89 | -ignorewhitecdata 1] 90 | $parser parse { 91 | some content 92 | } 93 | set ::result 94 | } { 95 | some content 96 | } 97 | 98 | foreach parser [info commands pcdata-*] { 99 | $parser free 100 | } 101 | 102 | # cleanup 103 | ::tcltest::cleanupTests 104 | return 105 | -------------------------------------------------------------------------------- /tests/pi.test: -------------------------------------------------------------------------------- 1 | # Features covered: Processing Instructions 2 | # 3 | # This file tests the parser's performance on Processing Instructions. 4 | # Sourcing this file into Tcl runs the tests and generates output 5 | # for errors. No output means no errors were found. 6 | # 7 | # Copyright (c) 1998-2000 Zveno Pty Ltd. 8 | # 9 | # $Id$ 10 | 11 | source [file join [file dir [info script]] loadtdom.tcl] 12 | 13 | catch {unset result} 14 | proc PI {target data args} { 15 | lappend ::result $target $data 16 | } 17 | 18 | test pi-1.1 {PI} { 19 | set ::result {} 20 | 21 | catch {rename xml::pi-1.1 {}} 22 | set parser [xml::parser pi-1.1 \ 23 | -processinginstructioncommand PI] 24 | $parser parse { 25 | 26 | 27 | } 28 | set ::result 29 | } {Test {This is a processing instruction}} 30 | 31 | test pi-1.2 {PI: missing trailing ?} { 32 | set ::result {} 33 | 34 | catch {rename xml::pi-1.2 {}} 35 | set parser [xml::parser pi-1.2 \ 36 | -processinginstructioncommand PI] 37 | set returncode [catch {$parser parse { 38 | 39 | 40 | }} msg] 41 | 42 | list $returncode [regexp {error "unclosed token" at.+} $msg] 43 | } {1 1} 44 | 45 | test pi-2.1 {PI with special characters} { 46 | set ::result {} 47 | 48 | catch {rename xml::pi-2.1 {}} 49 | set parser [xml::parser pi-2.1 \ 50 | -processinginstructioncommand PI] 51 | $parser parse { 52 | 53 | 54 | } 55 | set ::result 56 | } {Test {[if !VMLRender]}} 57 | 58 | foreach parser [info commands pi-*] { 59 | $parser free 60 | } 61 | 62 | # cleanup 63 | ::tcltest::cleanupTests 64 | return 65 | -------------------------------------------------------------------------------- /tests/tdomcmd.test: -------------------------------------------------------------------------------- 1 | # Features covered: tdom cmd 2 | # 3 | # This file contains a collection of tests for the tdom cmd. 4 | # 5 | # Copyright (c) 2003 Rolf Ade. 6 | # 7 | # RCS: @(#) $Id$ 8 | 9 | source [file join [file dir [info script]] loadtdom.tcl] 10 | 11 | # To test, that DOM trees generated with a tdom enabled parser behaves 12 | # the same way, as the one generated with the [dom parse] cmd, we 13 | # rename the dom cmd and use instead a dom proc, which partly rebuilds 14 | # the [dom parse] interface with a tdom enabled parser. Then we just 15 | # [source] some of the test files, which heavily use [dom parse]. 16 | 17 | 18 | rename dom _dom 19 | 20 | set _main_parser [expat] 21 | tdom $_main_parser enable 22 | 23 | set parse_in_chunks 0 24 | proc dom {args} { 25 | 26 | switch [lindex $args 0] { 27 | "parse" { 28 | set parseMethod "parse" 29 | set haveData 0 30 | set uplevelVar "" 31 | tdom $::_main_parser keepEmpties 0 32 | for {set x 1} {$x < [llength $args]} {incr x} { 33 | switch -- [lindex $args $x] { 34 | "-channel" { 35 | set parseMethod "parsechannel" 36 | incr x 37 | set data [lindex $args $x] 38 | set haveData 1 39 | } 40 | "-keepEmpties" { 41 | tdom $::_main_parser keepEmpties 1 42 | } 43 | "-baseurl" { 44 | incr x 45 | $::_main_parser configure -baseurl [lindex $args $x] 46 | } 47 | "-externalentitycommand" { 48 | incr x 49 | $::_main_parser configure -externalentitycommand \ 50 | [lindex $args $x] 51 | tdom $::_main_parser setExternalEntityResolver \ 52 | [lindex $args $x] 53 | } 54 | default { 55 | if {$haveData} { 56 | set uplevelVar [lindex $args $x] 57 | } else { 58 | set data [lindex $args $x] 59 | set haveData 1 60 | } 61 | } 62 | } 63 | } 64 | if {$::parse_in_chunks && ($parseMethod == "parse")} { 65 | $::_main_parser configure -final 0 66 | for {set x 0} {$x < [string length $data]} {incr x} { 67 | $::_main_parser parse [string index $data $x] 68 | } 69 | $::_main_parser configure -final 1 70 | $::_main_parser parse "" 71 | } else { 72 | $::_main_parser $parseMethod $data 73 | } 74 | if {$uplevelVar != ""} { 75 | uplevel 1 set $uplevelVar [tdom $::_main_parser getdoc] 76 | } else { 77 | return [tdom $::_main_parser getdoc] 78 | } 79 | } 80 | "setStoreLineColumn" { 81 | tdom $::_main_parser setStoreLineColumn [lindex $args 1] 82 | } 83 | default { 84 | # Because the original command may be executed within a 85 | # namespace eval, we do an uplevel, to get the same context 86 | return [uplevel 1 [linsert $args 0 _dom]] 87 | } 88 | } 89 | } 90 | 91 | source [file join [file dir [info script]] i18n.test] 92 | source [file join [file dir [info script]] domNode.test] 93 | source [file join [file dir [info script]] xslt.test] 94 | 95 | # Un-comment this, to test tdom cmd together with expat parsing in chunks 96 | # set parse_in_chunks 1 97 | # source [file join [file dir [info script]] i18n.test] 98 | # source [file join [file dir [info script]] domNode.test] 99 | # source [file join [file dir [info script]] xslt.test] 100 | 101 | rename dom {} 102 | rename _dom dom 103 | 104 | $_main_parser free 105 | 106 | test tdomcmd-1.1 {no doc avaliable} { 107 | set parser [expat] 108 | tdom $parser enable 109 | set result [catch {tdom $parser getdoc} errMsg] 110 | $parser free 111 | lappend result $errMsg 112 | } {1 {No DOM tree avaliable.}} 113 | 114 | test tdomcmd-1.2 {request dom tree in the middle of parsing} { 115 | set parser [expat -final 0] 116 | tdom $parser enable 117 | $parser parse {} 118 | set result [catch {tdom $parser getdoc} errMsg] 119 | lappend result $errMsg 120 | $parser parse {foo} 121 | lappend result [catch {tdom $parser getdoc} errMsg] 122 | lappend result $errMsg 123 | $parser configure -final 1 124 | $parser parse {} 125 | lappend result [catch {set doc [tdom $parser getdoc]} errMsg] 126 | $doc delete 127 | $parser free 128 | set result 129 | } {1 {No DOM tree avaliable.} 1 {No DOM tree avaliable.} 0} 130 | 131 | proc es-tdomcmd-1.3 {parser name attlist} { 132 | tdom $parser enable 133 | } 134 | 135 | test tdomcmd-1.3 {Try to tdom enable a parser from its parsing callback} { 136 | set p [expat] 137 | $p configure -elementstartcommand [list es-tdomcmd-1.3 $p] 138 | set result [catch {$p parse {}}] 139 | $p free 140 | set result 141 | } {1} 142 | 143 | 144 | # cleanup 145 | ::tcltest::cleanupTests 146 | return 147 | -------------------------------------------------------------------------------- /tests/xmlsimple.test: -------------------------------------------------------------------------------- 1 | # Features covered: simple parser 2 | # 3 | # This file contains a collection of tests for the simple parser. 4 | # Tested functionalities: 5 | # simple-1.*: Basic function, parsing 6 | # simple-2.*: Character encoding 7 | # 8 | # Copyright (c) 2002 Rolf Ade. 9 | # 10 | # RCS: @(#) $Id$ 11 | 12 | source [file join [file dir [info script]] loadtdom.tcl] 13 | 14 | test simple-1.1 {document as only root node} { 15 | set doc [dom parse -simple {}] 16 | set root [$doc documentElement] 17 | set result [$root asXML -indent none] 18 | $doc delete 19 | set result 20 | } {} 21 | 22 | test simple-1.2 {parsing} { 23 | set doc [dom parse -simple {}] 24 | set root [$doc documentElement] 25 | set result [llength [$root childNodes]] 26 | $doc delete 27 | set result 28 | } {3} 29 | 30 | test simple-1.3 {simple parser - parsing} {knownBug} { 31 | set doc [dom parse -simple { }] 32 | set root [$doc documentElement] 33 | set result [$root asXML -indent none] 34 | $doc delete 35 | set result 36 | } {} 37 | 38 | test simple-1.4 {simple parser - parsing} { 39 | set doc [dom parse -simple { }] 40 | set root [$doc documentElement] 41 | set result [$root asXML -indent none] 42 | $doc delete 43 | set result 44 | } {} 45 | 46 | test simple-1.5 {simple parser - -keepEmpties} { 47 | set doc [dom parse -simple -keepEmpties {}] 48 | set root [$doc documentElement] 49 | set result [$root hasChildNodes] 50 | $doc delete 51 | set result 52 | } {0} 53 | 54 | test simple-1.6 {simple parser - empty CDATA section} { 55 | set doc [dom parse -simple -keepEmpties {}] 56 | set root [$doc documentElement] 57 | set result [$root hasChildNodes] 58 | $doc delete 59 | set result 60 | } {0} 61 | 62 | test simple-1.7 {simple parser - -keepEmpties} { 63 | set doc [dom parse -simple -keepEmpties { }] 64 | set result [$doc asXML -indent none] 65 | $doc delete 66 | set result 67 | } { } 68 | 69 | test simple-1.8 {simple parser - empty comment} { 70 | set doc [dom parse -simple {}] 71 | set root [$doc documentElement] 72 | set result [$root hasChildNodes] 73 | lappend result [[$root firstChild] nodeValue] 74 | $doc delete 75 | set result 76 | } {1 {}} 77 | 78 | test simple-1.9 {simple parser - not wellformed input} { 79 | catch {[dom parse -simple {}]} 80 | } 1 81 | 82 | test simple-1.10 {simple parser - not wellformed input} { 83 | catch {[dom parse -simple {}} 90 | } 0 91 | 92 | test simple-2.1 {XML build in entities} { 93 | set doc [dom parse -simple {<>&'"}] 94 | set root [$doc documentElement] 95 | set result [$root text] 96 | $doc delete 97 | set result 98 | } {<>&'"} 99 | 100 | # emacs: " 101 | 102 | test simple-2.2 {character entities} { 103 | set doc [dom parse -simple {AB}] 104 | set root [$doc documentElement] 105 | set result [$root text] 106 | $doc delete 107 | set result 108 | } {AB} 109 | 110 | test simple-2.3 {character entities} {need_i18n} { 111 | set doc [dom parse -simple {ÖÄÄ}] 112 | set root [$doc documentElement] 113 | set result [$root text] 114 | $doc delete 115 | set result 116 | } "\u00d6\u00c4\u00c4" 117 | 118 | 119 | # cleanup 120 | ::tcltest::cleanupTests 121 | return 122 | -------------------------------------------------------------------------------- /tests/xmltest.test: -------------------------------------------------------------------------------- 1 | # Features covered: Conformance 2 | # 3 | # This file tests the parser's performance on conformance to the 4 | # XML specification. As such it is crude and does not test callback 5 | # features. 6 | # 7 | # Sourcing this file into Tcl runs the tests and generates output 8 | # for errors. No output means no errors were found. 9 | # 10 | # Copyright (c) 1999-2000 Zveno Pty Ltd. 11 | # 12 | # $Id$ 13 | 14 | source [file join [file dir [info script]] loadtdom.tcl] 15 | 16 | proc xmltest {expect dir subdir f} { 17 | 18 | set ch [open $f] 19 | set data [read $ch] 20 | close $ch 21 | 22 | test xmltest-$dir-$subdir-[file rootname [file tail $f]] "Document $dir $subdir [file tail $f]" { 23 | set parser [xml::parser xmltest] 24 | set code [catch {$parser parse $data}] 25 | rename $parser {} 26 | set code 27 | } $expect 28 | } 29 | 30 | # NB. Uses James Clark's test suite for WFF checking. 31 | # Need a framework to test against each file: it's too time- 32 | # consuming to setup a test proc for each one. 33 | 34 | set testDir [file join [pwd] xmltest] 35 | 36 | # These documents should fail 37 | foreach dir {not-wf} { 38 | foreach file [glob -nocomplain [file join $testDir $dir sa *.xml]] { 39 | xmltest 1 $dir sa $file 40 | } 41 | } 42 | 43 | # These documents should pass 44 | foreach dir {invalid valid} { 45 | foreach file [glob -nocomplain [file join $testDir $dir sa *.xml]] { 46 | xmltest 0 $dir sa $file 47 | } 48 | } 49 | 50 | # cleanup 51 | ::tcltest::cleanupTests 52 | return 53 | -------------------------------------------------------------------------------- /tests/xpath.bench: -------------------------------------------------------------------------------- 1 | # -*- tcl -*- 2 | # Tcl Benchmark File 3 | # 4 | # This file contains a number of benchmarks for XPath query speed. 5 | # This allow developers to monitor/gauge/track package performance. 6 | # 7 | # (c) 2006 Rolf Ade 8 | # 9 | # $Id$ 10 | 11 | 12 | # ### ### ### ######### ######### ######### ########################### 13 | ## Setting up the environment ... 14 | 15 | package require tdom 16 | 17 | # ### ### ### ######### ######### ######### ########################### 18 | ## Benchmarks. 19 | 20 | bench -desc "not() function - not cached" -pre { 21 | set doc [dom parse ] 22 | } -body { 23 | $doc selectNodes not(foo) 24 | } 25 | 26 | bench -desc "not() function - cached" -pre { 27 | set doc [dom parse ] 28 | } -body { 29 | $doc selectNodes -cache 1 not(foo) 30 | } 31 | 32 | bench -desc "path /foo/bar/baz - not cached" -pre { 33 | set doc [dom parse ] 34 | } -body { 35 | $doc selectNodes /foo/bar/baz 36 | } 37 | 38 | bench -desc "path /foo/bar/baz - cached" -pre { 39 | set doc [dom parse ] 40 | } -body { 41 | $doc selectNodes -cache 1 /foo/bar/baz 42 | } 43 | 44 | bench -desc "path with predicate - not cached" -pre { 45 | set doc [dom parse ] 46 | } -body { 47 | $doc selectNodes {/foo/bar/baz[not(grill) and @some='foo']} 48 | } 49 | 50 | bench -desc "path with predicate - cached" -pre { 51 | set doc [dom parse ] 52 | } -body { 53 | $doc selectNodes -cache 1 {/foo/bar/baz[not(grill) and @some='foo']} 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /unix/CONFIG: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is a small collection of example settings you can use to 4 | # compile tdom on different platforms. Just uncomment the line(s) 5 | # you need and run this script with "sh CONFIG". 6 | # 7 | # With the exception of the --enable-tdomalloc option it's best, to 8 | # leave the tDOM specfic configuration options alone (that is: use the 9 | # defaults, do nothing). 10 | # 11 | # --enable-tdomalloc 12 | # Default: off 13 | # With this option on, a special memory allocator is used, which is 14 | # optimized for low memory allocation overhead. This allocator works 15 | # only on 32-bit plattforms. If you build for a 64-bit OS, you _must_ 16 | # disable this (and it's disabled by default). 17 | # 18 | # --enable-dtd 19 | # Default: on 20 | # With this option on, the underlying XML parser expat will be build 21 | # with parsing support of XML DTDs. Leave this option at default. If 22 | # you disable this option, then all the SAX handlers related to DTD 23 | # events won't work any more. It also affects the DOM interface: 24 | # without DTD support, the fetching of external entities with the 25 | # -externalentitycommand won't work. With this option off, the test 26 | # suite will report a lot of failure because of missing features. 27 | # 28 | # --enable-ns 29 | # Default: on 30 | # With this option on, the underlying XML parser expat will be build 31 | # with parsing support of XML namespaces. This affects only the SAX 32 | # interface; the DOM interface always uses a non XML namespace expat 33 | # parser behind the scene and does the XML namespace handling by 34 | # its own. 35 | # 36 | # --enable-unknown 37 | # Default: off 38 | # With this option on, tDOM replaces the standard unknown command with 39 | # its own version. This allows a special shortcut syntax together with 40 | # the deprecated XPointer methods. It's there for backward 41 | # compatibility reasons. It is known, that it cause trouble together 42 | # with itcl. 43 | # 44 | # --with-aolserver 45 | # If building tDOM as module for AOLserver, this points to the 46 | # directory with the AOLserver source distribution. See below 47 | # for examples. 48 | # 49 | # --with-tdom 50 | # Useful (and avaliable) only for building extensions to tDOM (as 51 | # tnc). Use it to point to the tdomConfig.sh file. 52 | # 53 | # 54 | # 55 | # Comment-out next line if building with GCC compiler. 56 | # CC=gcc; export CC 57 | # 58 | # 59 | # Tcl 8.0.5 on Unix. Uses public Tcl library 60 | # ------------------------------------------- 61 | # ../configure-tcl8.0.5 62 | # 63 | # 64 | # Tcl 8.1+ on Unix. Uses public Tcl library 65 | # ------------------------------------------- 66 | # ../configure 67 | # 68 | # 69 | # For 64-bit Unix you've to use --disable-tdomalloc 70 | # ------------------------------------------------- 71 | # ../configure --disable-tdomalloc 72 | # 73 | # 74 | # AOLserver 3.X. It delivers its own patched Tcl lib. 75 | # Also, this one builds tdom as AOLserver module. 76 | # Please do not use "make install" after doing "make". 77 | # You have to manually adjust AOLserver config file 78 | # to load tdom module. See README.AOL for more info. 79 | # Also, you need to modify the "aolsrc" to point to 80 | # the directory with AOLserver source distribution. 81 | # ---------------------------------------------------- 82 | # aolsrc="/usr/src/aolserver-3.4" 83 | # ../configure --enable-threads --disable-tdomalloc \ 84 | # --with-aolserver=$aolsrc \ 85 | # --with-tcl=$aolsrc/tcl8.3.4/unix 86 | # 87 | # 88 | # AOLserver 4.X. It uses public Tcl library. 89 | # Builds the package as a regular Tcl module 90 | # but installs it in the AOLserver tree. 91 | # Just do "make" and "make install". You might 92 | # want to change the default AOLserver install 93 | # directory (/usr/local/aolserver). 94 | # ---------------------------------------------------- 95 | # ../configure --enable-threads --disable-tdomalloc \ 96 | # --prefix=/usr/local/aolserver 97 | # 98 | # AOLserver 4.X. It uses public Tcl library. 99 | # Builds the package as a AOLserver module. 100 | # You will have to manually trim your AOLserver 101 | # startup script to load it. 102 | # Just do "make" and "make install". You might 103 | # want to change the default AOLserver install 104 | # directory (/usr/local/aolserver). 105 | # ---------------------------------------------------- 106 | # ../configure --enable-threads --disable-tdomalloc \ 107 | # --with-aolserver=/usr/local/aolserver \ 108 | # --prefix=/usr/local/aolserver 109 | # 110 | # 111 | # Mac OS X. Uses public Tcl library. 112 | # -------------------------------------------- 113 | # ../configure \ 114 | # --mandir=/usr/local/share/man \ 115 | # --libdir=/Library/Tcl \ 116 | # --with-tcl=/Library/Frameworks/Tcl.framework \ 117 | # --with-tclinclude=/Library/Frameworks/Tcl.framework/Headers 118 | # 119 | # EOF 120 | -------------------------------------------------------------------------------- /unix/tclAppInit.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | | Copyright (c) 2007 Rolf Ade (rolf@pointsman.de) 3 | +----------------------------------------------------------------------------- 4 | | 5 | | $Id$ 6 | | 7 | | 8 | | Main file for a standalone tclsh with tDOM build in ('big tclsh'). 9 | | 10 | | The contents of this file are subject to the Mozilla Public License 11 | | Version 1.1 (the "License"); you may not use this file except in 12 | | compliance with the License. You may obtain a copy of the License at 13 | | http://www.mozilla.org/MPL/ 14 | | 15 | | Software distributed under the License is distributed on an "AS IS" 16 | | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 17 | | License for the specific language governing rights and limitations 18 | | under the License. 19 | | 20 | | The Original Code is tDOM. 21 | | 22 | | The Initial Developer of the Original Code is Jochen Loewer 23 | | Portions created by Jochen Loewer are Copyright (C) 1998, 1999 24 | | Jochen Loewer. All Rights Reserved. 25 | | 26 | | Contributor(s): 27 | | 28 | | 29 | | written by Rolf Ade 30 | | August, 2007 31 | | 32 | \---------------------------------------------------------------------------*/ 33 | 34 | #include "tcl.h" 35 | 36 | #ifndef MODULE_SCOPE 37 | # define MODULE_SCOPE extern 38 | #endif 39 | MODULE_SCOPE int Tcl_AppInit(Tcl_Interp *); 40 | MODULE_SCOPE int main(int, char **); 41 | 42 | extern int Tdom_Init _ANSI_ARGS_((Tcl_Interp *interp)); 43 | extern int Tdom_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); 44 | 45 | /*---------------------------------------------------------------------------- 46 | | main 47 | | 48 | \---------------------------------------------------------------------------*/ 49 | int 50 | main( 51 | int argc, 52 | char **argv 53 | ) 54 | { 55 | Tcl_Main (argc, argv, Tcl_AppInit); 56 | return 0; 57 | } 58 | 59 | /*---------------------------------------------------------------------------- 60 | | Tcl_AppInit 61 | | 62 | \---------------------------------------------------------------------------*/ 63 | int 64 | Tcl_AppInit(interp) 65 | Tcl_Interp *interp; 66 | { 67 | if ((Tcl_Init)(interp) == TCL_ERROR) { 68 | return TCL_ERROR; 69 | } 70 | if (Tdom_Init(interp) == TCL_ERROR) { 71 | return TCL_ERROR; 72 | } 73 | Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit); 74 | Tcl_SetVar(interp, "tcl_rcFileName", "~/.tcldomshrc", TCL_GLOBAL_ONLY); 75 | return TCL_OK; 76 | } 77 | -------------------------------------------------------------------------------- /win/config.h: -------------------------------------------------------------------------------- 1 | /* an empty/fake config.h for expat */ 2 | 3 | -------------------------------------------------------------------------------- /win/mkd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem RCS: @(#) $Id$ 3 | 4 | if exist %1\nul goto end 5 | 6 | md %1 7 | if errorlevel 1 goto end 8 | 9 | echo Created directory %1 10 | 11 | :end 12 | 13 | 14 | -------------------------------------------------------------------------------- /win/pkgIndex.tcl: -------------------------------------------------------------------------------- 1 | # tDOM Tcl package index file 2 | 3 | package ifneeded tdom 0.8.3 \ 4 | "[list load [file join $dir tdom083[info sharedlibextension] ] tdom];\ 5 | [list source [file join $dir tdom.tcl]]" 6 | -------------------------------------------------------------------------------- /win/tdom.rc: -------------------------------------------------------------------------------- 1 | // tdom.rc - Copyright (C) 2005 Pat Thoyts 2 | // 3 | // $Id$ 4 | 5 | #include 6 | 7 | VS_VERSION_INFO VERSIONINFO 8 | FILEVERSION COMMAVERSION 9 | PRODUCTVERSION COMMAVERSION 10 | FILEFLAGSMASK 0x3fL 11 | #ifdef DEBUG 12 | FILEFLAGS VS_FF_DEBUG 13 | #else 14 | FILEFLAGS 0x0L 15 | #endif 16 | FILEOS VOS__WINDOWS32 17 | FILETYPE VFT_DLL 18 | FILESUBTYPE 0x0L 19 | BEGIN 20 | BLOCK "StringFileInfo" 21 | BEGIN 22 | BLOCK "040904b0" 23 | BEGIN 24 | VALUE "FileDescription", "tdom " DOTVERSION " for Windows\0" 25 | VALUE "OriginalFilename", "tdom" VERSION ".dll\0" 26 | VALUE "FileVersion", DOTVERSION "\0" 27 | VALUE "LegalCopyright", "Copyright \251 1998-2007 Jochen Loewer, Rolf Ade, et al.\0" 28 | VALUE "ProductName", "tdom " DOTVERSION " for Windows\0" 29 | VALUE "ProductVersion", DOTVERSION "\0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x409, 1200 35 | END 36 | END 37 | -------------------------------------------------------------------------------- /xe/README: -------------------------------------------------------------------------------- 1 | 2 | XE needs saves the upper input window in the file ~/.xe-input, if 3 | it is called without arguments. Otherwise the first argument 4 | gives the file name for the saved input windos. 5 | 6 | To start playing with XE copy you could do either: 7 | 8 | 1) cp xe-input ~/.xe-input 9 | xe 10 | 11 | 2) xe xe-input 12 | 13 | 14 | Latter should be more appropiate for Wn32 users. 15 | 16 | -------------------------------------------------------------------------------- /xe/xe-input: -------------------------------------------------------------------------------- 1 | 2 | xml(file:../tests/data/mondial-europe.xml)/country[name='Germany'] 3 | xml(file:../tests/data/mondial-europe.xml) contains(//country[name='Germany']/name,"any") 4 | 5 | xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']/province[population>5000000]/name 6 | 7 | xml(file:../tests/data/mondial-europe.xml)count(//country[name='Germany']/province) 8 | 9 | xml(file:../tests/data/mondial-europe.xml) 10 | //mountain[in_country[@ref = string(//country[name='Germany']/@id)]] 11 | 12 | xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/name 13 | xml(file:../tests/data/mondial-europe.xml)//country[name='Germany']//city[population>1000000] 14 | xml(file:../tests/data/mondial-europe.xml)//country[name='France']/province/city[population<100000] 15 | 16 | xml(file:../tests/data/mondial-europe.xml)//river[length>4000] 17 | xml(file:../tests/data/mondial-europe.xml)//river/name 18 | 19 | xml(file:../tests/data/mondial-europe.xml) //country/car_code/text() 20 | 21 | 22 | xml(file:../tests/data/books.xml) //book[@style="novel"] 23 | 24 | xml(file:../doc/domNode.xml) //method/text() 25 | 26 | xml(http://www.fernweh.com/wap/info.wml) 27 | xml(http://www.fernweh.com/wap/categories.wml) 28 | 29 | xml(http://wap.is.danet.de/lh/flugplan/index.wml) 30 | xml(http://wap.t-d1-wap.de/t-online/) 31 | xml(http://www.vbxml.com/downloads/files/dropdown_xsl.txt) 32 | -------------------------------------------------------------------------------- /xe/xe.bat: -------------------------------------------------------------------------------- 1 | d:\opt\tcl8.2.3\bin\wish82 xe xe-input --------------------------------------------------------------------------------