• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..01-Mar-201311

aclocal.m4H A D26-Sep-2002147

ChangeLogH A D05-Mar-200317.8 KiB

configureH A D11-Dec-2012316.5 KiB

configure.inH A D11-Dec-20128.7 KiB

doc/H01-Mar-201310

examples/H01-Mar-20136

expat/H01-Mar-201314

install.dataH A D24-Feb-20032.9 KiB

install.tclH A D05-Mar-200360 KiB

library/H01-Mar-201313

LICENSEH A D20-May-20021.1 KiB

macosx/H08-Mar-20033

Makefile.inH A D11-Dec-201218.2 KiB

READMEH A D24-Feb-20037.8 KiB

README.htmlH A D08-Mar-200312.9 KiB

RELNOTESH A D24-Feb-20033.2 KiB

tcl.m4H A D03-Apr-2012126.8 KiB

tclconfig/H01-Mar-20136

tclexpat.cH A D11-Dec-201222.9 KiB

tclxml-2.6.tar.gzH A D08-Mar-200320

tclxml.cH A D24-Feb-200389.1 KiB

tclxml.declsH A D12-Sep-20025.8 KiB

tclxml.hH A D24-Feb-200311.3 KiB

TclxmlConfig.sh.inH A D30-Sep-20022.1 KiB

tclxmlDecls.hH A D12-Sep-200214.6 KiB

tclxmlStubInit.cH A D12-Sep-20021.9 KiB

tclxmlStubLib.cH A D25-Oct-20021.7 KiB

tests/H01-Mar-201333

tools/H01-Mar-20133

win/H01-Mar-201311

README

1
2	XML Support For Tcl
3
4	TclXML Version 2.6
5
6Steve Ball, Zveno Pty Ltd
7
8This package provides XML parsers for Tcl scripts.  There is a generic
9front-end interface with plugin parser implementations.  A number of parser
10implementations or wrappers are provided:
11
12    *     James Clark's expat library
13
14    *     A generic Tcl implementation, (if you can't be bothered compiling an
15    extension)
16
17
18The packages define commands in the ::xml Tcl namespace:
19
20xml::parserclass info names
21
22
23xml::parser
24
25
26Other packages are also provided to provide support for related standards.  In
27particular, work has commenced on the 'xpath' package for parsing XPath
28location paths.
29
30See the website [http://tclxml.sourceforge.net/] for more information on XML
31support for Tcl.
32
33Contact Steve Ball [mailto:Steve.Ball@zveno.com] for information about this
34release.
35
36
37
38Installation
39============
40
41TclXML v2.6 features a pure-Tcl installer.
42
43Future work on the installer will include an 'uninstall' capability, as well as
44the capability to build the binary libraries in the package from the source.
45
46
47
48Dependencies
49------------
50
51Tcllib
52    http://dev.scriptics.com/software/tcllib/
53    [http://dev.scriptics.com/software/tcllib/]
54
55    In order for the Tcl-only parser to resolve external entities, the tcllib
56    package must be installed.
57
58    Be sure to get a version which includes the uri package.  Version 1.2 or better
59    is recommended.
60
61        *         GZip'd tarball [ftp://prdownloads.sf.net/tcllib/tcllib-1.3.tar.gz]
62
63        *         ZIP file [ftp://prdownloads.sf.net/tcllib/tcllib-1.3.zip]
64
65
66    The latest CVS snapshot may be found at the SourceForge project page
67    [http://sourceforge.net/projects/tcllib].
68
69
70
71Expat
72    Expat is only required for the compiled version of the package.
73
74    TclXML/expat requires expat v0.2, with modifications by Ajuba Solutions.  This
75    is now supplied in the expat subdirectory of this distribution and will
76    maintained until Tclxml has been resynchronised with the Expat SourceForge
77    project (volunteer needed!).
78
79
80
81
82
83Pure-Tcl Installation (no compilation required)
84-----------------------------------------------
85
86The install.tcl script will install the pure-Tcl parser.  Run it using wish, eg.
87
88    wish install.tcl
89
90If the pure-Tcl parser is good enough for you, then read no further.
91
92
93
94Compiled Installation
95---------------------
96
97
98
99Unix/Linux
100----------
101
102You must have Tcl/Tk version 8.2 or better installed on your system.  Tcl/Tk
1038.3 or better is recommended.
104
105Make sure you have Tcllib 1.2 (or better) installed.  Tcllib is still required,
106even for the compiled parser.
107
108Run the configure script, with the --prefix, --exec_prefix and --enable-threads
109switches (the latter only if Tcl has been built with threads enabled).  For
110example, on my system I have Tcl 8.4 installed in /usr/local/tcl8.4 so I would
111use the command:
112
113    ./configure --prefix=/usr/local/tcl8.4 --exec_prefix=/usr/local/tcl8.4 --enable-threads
114
115    make
116
117    make install
118
119You may need to do this as root.  This installs the pure-Tcl parser class, as
120well as support files required for the next step.
121
122    cd expat
123
124Now TclXML/expat is about to be built.
125
126Use exactly the same configure command from step (2) above.
127
128    make
129
130    make install
131
132You may need to do this as root.  This installs the expat parser class.
133
134
135
136WINDOWS (MS VC++)
137-----------------
138
139    [Warning: these instructions may not be up-to-date.]
140
141    [Advice:  ActiveTcl includes binaries for TclXML.]
142
143You must have Tcl/Tk version 8.2 or better installed on your system.  Tcl/Tk
1448.3 or better is recommended.
145
146Run MS Visual C++ and load the tclxml workspace in the win subdirectory.
147  There are project files for tclxml, tclexpat & expat. The active project will
148be the Release version of tclexpat.
149
150To build tclxml without tclexpat, select the tclxml project and just build that.
151
152Installation
153
154Since you must have tcl/tk installed already (!) you might like to use the new
155installer that we have been working on.
156
157You can install one of multiple builds (Release/Debug etc) by invoking the
158install.tcl script  and specifying the directory path to the build, or by
159invoking the installer from the build directory directly:
160
161    
162    cd win
163    wish ../install.tcl -builddir Release
164
165
166or
167
168    
169    cd win/Release
170    wish ../../install.tcl
171
172
173Various screens will appear allowing you to select where the package is
174installed, what optional components can be installed and showing a log of the
175installation process.
176
177If that doesn't do the deed you need to do some hard yards:
178
179    *     Copy the DLL's in the target build subdirectory (win/Release or win/Debug)
180    to a directory which is in your execution PATH (the same directory as your
181    TCL/TK binaries is an obvious one).
182
183    *     Copy the top level library subdirectory and its contents into a directory
184    which will be part of the autoexec_path in any TCL/TK apps that will need
185    to load the tclxml modules (the lib subdirectory of your TCL/TK
186    installation is one) . Rename the directory to tclxml2.6
187
188    *     Rename the file pkgIndex.tcl.in in this directory to pkgIndex.tcl, and edit
189    the file, replacing any macros (strings with leading and trailing '@''s)
190    with approriate directory/lib/paths.
191
192        
193           @RELPATH@              = relative path between the library directory 
194                                    & the dll's directory
195           @TCLXML_LIB_FILE@      = tclxml.dll
196           @expat_TCL_LIB_FILE@   = tclexpat.dll
197
198
199
200
201
202Macintosh OS X
203--------------
204
205There are two ways to build TclXML under Mac OS X:
206
207The usual Unix way, see above.
208
209As a Framework using ProjectBuilder.
210
211The macosx directory contains the Project Builder files for building under OS
212X.  TclXML has been tested on OS X 10.2.3 (or is that X.2.3?).
213
214Start-up the project, select the 'expat' target and build.  This builds
215everything.  The result is a Mac OS X Framework.  Copy tclxml.framework and
216expat.framework to any of the usual places for frameworks
217(~/Library/Frameworks, /Library/Frameworks, etc).
218
219
220
221Macintosh OS 9 (or earlier)
222---------------------------
223
224The installer script doesn't work properly on Macintosh yet, and the binary
225parsers have not been ported yet (sorry).
226
227Since the distribution has an all-Tcl parser, you can get a working parser
228fairly easily.
229
230Copy the library folder to the Tcl library folder in the Extensions folder of
231the System folder.
232
233Rename the library folder to tclxml2.6.  This isn't strictly necessary, but it
234helps keep things organised.
235
236You're on your own as far as the demos, programs and documentation go.
237
238
239
240Usage
241=====
242
243See the website for links to tutorials and the reference manual.
244
245In the meantime, here's a quick tutorial:
246
247    
248    package require xml
249    
250    set parser [xml::parser]
251    $parser configure -elementstartcommand EStart \
252        -characterdatacommand PCData
253    
254    proc EStart {tag attlist args} {
255        array set attr $attlist
256        puts "Element \"$tag\" started with [array size attr] attributes"
257    }
258    
259    proc PCData text {
260        incr ::count [string length $text]
261    }
262    
263    set count 0
264    $parser parse [read stdin]
265    
266    puts "The document contained $count characters"
267    exit 0
268
269
270
271
272XPath
273=====
274
275In addition to XML parsing packages, TclXML also provides a package for parsing
276XPath location paths.  The XPath package only parsing the path's syntax, it
277does interpret the path.  See TclDOM
278[http://tclxml.sourceforge.net/tcldom.html] for a package that will interpret
279XPath location paths.
280
281NB.  This package is in its infancy, and does not support the full range of
282XPath features.  Only a very limited subset of location paths are supported, of
283the form "/simple/example[2]".  Paths within predicates will definitely fail.
284
285To use the XPath package:
286
287    
288    package require xpath
289
290
291To parse a location path:
292
293    
294    xpath::split {/simple/example}
295
296
297This returns a Tcl list, each element of which is a three element sublist:
298{axis node-test {?predicate ...?}}.
299
300

README.html

1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>XML Support For Tcl</title><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id222773"></a>XML Support For Tcl</h1></div><div><h3 class="subtitle"><i>TclXML</i></h3></div><div><div class="author"><h3 class="author"><span class="firstname">Steve</span> <span class="surname">Ball</span></h3><div class="affiliation"><span class="orgname">Zveno Pty Ltd<br></span><div class="address"><p><br>
2	��<span class="otheraddr"><br>
3	����<a href="http://www.zveno.com/" target="_top">www.zveno.com</a><br>
4	��</span><br>
5	</p></div></div></div></div><div><p class="releaseinfo">$Id: README.xml,v 1.1 2003/02/25 04:09:53 balls Exp $</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="2"><b>Revision History</b></th></tr><tr><td align="left">Revision 2.6</td><td align="left"></td></tr></table></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#installation">Installation</a></dt><dd><dl><dt><a href="#id268962">Dependencies</a></dt><dt><a href="#id269099">Pure-Tcl Installation</a></dt><dt><a href="#id269145">Compiled Installation</a></dt></dl></dd><dt><a href="#id269623">Usage</a></dt><dt><a href="#id269660">XPath</a></dt></dl></div><p>This package provides XML parsers for Tcl scripts.  There is a generic front-end interface with plugin parser implementations.  A number of parser implementations or wrappers are provided:</p><div class="itemizedlist"><ul type="disc"><li><p>James Clark's expat library</p></li><li><p>A generic Tcl implementation, (if you can't be bothered compiling an extension)</p></li></ul></div><p>The packages define commands in the <tt class="tclnamespace">::xml</tt> Tcl namespace:</p><div class="variablelist"><dl><dt><span class="term"><b class="command">xml::parserclass  [info]  [names]</b></span></dt><dd></dd><dt><span class="term"><b class="command">xml::parser</b></span></dt><dd></dd></dl></div><p>Other packages are also provided to provide support for related standards.  In particular, work has commenced on the 'xpath' package for parsing XPath location paths.</p><p>See <a href="http://tclxml.sourceforge.net/" target="_top">the website</a> for more information on XML support for Tcl.</p><p>Contact <a href="mailto:Steve.Ball@zveno.com" target="_top">Steve Ball</a> for information about this release.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="installation"></a>Installation</h2></div></div><div></div></div><p>TclXML v2.6 features a pure-Tcl installer.</p><p>Future work on the installer will include an 'uninstall' capability, as well as the capability to build the binary libraries in the package from the source.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id268962"></a>Dependencies</h3></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Tcllib</span></dt><dd><p><a href="http://dev.scriptics.com/software/tcllib/" target="_top">http://dev.scriptics.com/software/tcllib/</a></p><p>In order for the Tcl-only parser to resolve external entities, the tcllib package must be installed.</p><p>Be sure to get a version which includes the <tt class="tclpackage">uri</tt> package.  Version 1.2 or better is recommended.</p><div class="itemizedlist"><ul type="disc"><li><p><a href="ftp://prdownloads.sf.net/tcllib/tcllib-1.3.tar.gz" target="_top">GZip'd tarball</a></p></li><li><p><a href="ftp://prdownloads.sf.net/tcllib/tcllib-1.3.zip" target="_top">ZIP file</a></p></li></ul></div><p>The latest CVS snapshot may be found at <a href="http://sourceforge.net/projects/tcllib" target="_top">the SourceForge project page</a>.</p></dd><dt><span class="term">Expat</span></dt><dd><p>Expat is only required for the compiled version of the package.</p><p>TclXML/expat requires expat v0.2, with modifications by Ajuba Solutions.  This is now supplied in the <tt class="filename">expat</tt> subdirectory of this distribution and will maintained until Tclxml has been resynchronised with the Expat SourceForge project (volunteer needed!).</p></dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id269099"></a>Pure-Tcl Installation</h3></div><div><h4 class="title">no compilation required</h4></div></div><div></div></div><p>The <tt class="filename">install.tcl</tt> script will install the pure-Tcl parser.  Run it using <span class="application">wish</span>, eg.</p><pre class="programlisting">wish install.tcl</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>If Tcl/Tk has been configured correctly on your system, you should be able to simply double-click the script</div><p>If the pure-Tcl parser is good enough for you, then read no further.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id269145"></a>Compiled Installation</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id269154"></a>Unix/Linux</h4></div></div><div></div></div><p>You must have Tcl/Tk version 8.2 or better installed on your system.  Tcl/Tk 8.3 or better is recommended.</p><div class="orderedlist"><ol type="1"><li><p>Make sure you have Tcllib 1.2 (or better) installed.  Tcllib is still required, even for the compiled parser.</p></li><li><p>Unpack the TclXML distribution and <b class="command">cd</b> into the <tt class="filename">tclxml-2.6</tt> directory.</p></li><li><p>Run the <tt class="filename">configure</tt> script, with the  [--prefix],  [--exec_prefix] and  [--enable-threads] switches (the latter only if Tcl has been built with threads enabled).  For example, on my system I have Tcl 8.4 installed in <tt class="filename">/usr/local/tcl8.4</tt> so I would use the command:</p><pre class="programlisting">/configure --prefix=/usr/local/tcl8.4 --exec_prefix=/usr/local/tcl8.4 --enable-threads</pre></li><li><pre class="programlisting">make</pre></li><li><pre class="programlisting">make install</pre><p>You may need to do this as root.  This installs the pure-Tcl parser class, as well as support files required for the next step.</p></li><li><pre class="programlisting">cd expat</pre><p>Now TclXML/expat is about to be built.</p></li><li><p>Use exactly the same configure command from step (2) above.</p></li><li><pre class="programlisting">make</pre></li><li><pre class="programlisting">make install</pre><p>You may need to do this as root.  This installs the expat parser class.</p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id269323"></a>WINDOWS (MS VC++)</h4></div></div><div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>[Warning: these instructions may not be up-to-date.]</div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>[Advice:  ActiveTcl includes binaries for TclXML.]</div><p>You must have Tcl/Tk version 8.2 or better installed on your system.  Tcl/Tk 8.3 or better is recommended.</p><div class="orderedlist"><ol type="1"><li><p>Run MS Visual C++ and load the tclxml workspace in the win subdirectory.   There are project files for tclxml, tclexpat &amp; expat. The active project will be the Release version of tclexpat.</p></li><li><p>To build tclxml without tclexpat, select the tclxml project and just build that.</p></li><li><p>Installation</p><p>Since you must have tcl/tk installed already (!) you might like to use the new installer that we have been working on.</p><p>You can install one of multiple builds (Release/Debug etc) by invoking the install.tcl script  and specifying the directory path to the build, or by invoking the installer from the build directory directly:</p><pre class="programlisting">
6cd win
7wish /install.tcl -builddir Release
8</pre><p>or</p><pre class="programlisting">
9cd win/Release
10wish /install.tcl
11</pre><p>Various screens will appear allowing you to select where the package is installed, what optional components can be installed and showing a log of the installation process.</p><p>If that doesn't do the deed you need to do some hard yards:</p><div class="itemizedlist"><ul type="disc"><li><p>Copy the DLL's in the target build subdirectory (win/Release or win/Debug) to a directory which is in your execution PATH (the same directory as your TCL/TK binaries is an obvious one).</p></li><li><p>Copy the top level library subdirectory and its contents into a directory which will be part of the autoexec_path in any TCL/TK apps that will need to load the tclxml modules (the lib subdirectory of your TCL/TK installation is one) . Rename the directory to tclxml2.6</p></li><li><p>Rename the file pkgIndex.tcl.in in this directory to pkgIndex.tcl, and edit the file, replacing any macros (strings with leading and trailing '@''s) with approriate directory/lib/paths.</p><div class="literallayout"><p><br>
12���@RELPATH@��������������=�relative�path�between�the�library�directory�<br>
13����������������������������&amp;�the�dll's�directory<br>
14���@TCLXML_LIB_FILE@������=�tclxml.dll<br>
15���@expat_TCL_LIB_FILE@���=�tclexpat.dll<br>
16</p></div></li></ul></div></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id269488"></a>Macintosh OS X</h4></div></div><div></div></div><p>There are two ways to build TclXML under Mac OS X:</p><div class="orderedlist"><ol type="1"><li><p>The usual Unix way, see above.</p></li><li><p>As a Framework using ProjectBuilder.</p></li></ol></div><p>The <tt class="filename">macosx</tt> directory contains the Project Builder files for building under OS X.  TclXML has been tested on OS X 10.2.3 (or is that X.2.3?).</p><p>Start-up the project, select the 'expat' target and build.  This builds everything.  The result is a Mac OS X Framework.  Copy <tt class="filename">tclxml.framework</tt> and <tt class="filename">expat.framework</tt> to any of the usual places for frameworks (<tt class="filename">~/Library/Frameworks</tt>, <tt class="filename">/Library/Frameworks</tt>, etc).</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id269566"></a>Macintosh OS 9 (or earlier)</h4></div></div><div></div></div><p>The installer script doesn't work properly on Macintosh yet, and the binary parsers have not been ported yet (sorry).</p><p>Since the distribution has an all-Tcl parser, you can get a working parser fairly easily.</p><p>Copy the <tt class="filename">library</tt> folder to the Tcl library folder in the Extensions folder of the System folder.</p><p>Rename the <tt class="filename">library</tt> folder to <tt class="filename">tclxml2.6</tt>.  This isn't strictly necessary, but it helps keep things organised.</p><p>You're on your own as far as the demos, programs and documentation go.</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id269623"></a>Usage</h2></div></div><div></div></div><p>See the website for links to tutorials and the reference manual.</p><p>In the meantime, here's a quick tutorial:</p><pre class="programlisting">
17package require xml
18
19set parser [xml::parser]
20$parser configure -elementstartcommand EStart \
21    -characterdatacommand PCData
22
23proc EStart {tag attlist args} {
24    array set attr $attlist
25    puts &quot;Element \&quot;$tag\&quot; started with [array size attr] attributes&quot;
26}
27
28proc PCData text {
29    incr ::count [string length $text]
30}
31
32set count 0
33$parser parse [read stdin]
34
35puts &quot;The document contained $count characters&quot;
36exit 0
37</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id269660"></a>XPath</h2></div></div><div></div></div><p>In addition to XML parsing packages, TclXML also provides a package for parsing XPath location paths.  The XPath package only parsing the path's syntax, it does interpret the path.  See <a href="http://tclxml.sourceforge.net/tcldom.html" target="_top">TclDOM</a> for a package that will interpret XPath location paths.</p><p>NB.  This package is in its infancy, and does not support the full range of XPath features.  Only a very limited subset of location paths are supported, of the form &quot;/simple/example[2]&quot;.  Paths within predicates will definitely fail.</p><p>To use the XPath package:</p><pre class="programlisting">
38package require xpath
39</pre><p>To parse a location path:</p><pre class="programlisting">
40xpath::split {/simple/example}
41</pre><p>This returns a Tcl list, each element of which is a three element sublist: {axis node-test {?predicate ...?}}.</p></div></div></body></html>
42