File: readme

package info (click to toggle)
xotcl 1.6.8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,468 kB
  • sloc: ansic: 22,485; tcl: 2,531; sh: 791; makefile: 141
file content (174 lines) | stat: -rw-r--r-- 5,070 bytes parent folder | download | duplicates (12)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
		A Tcl interface to expat.

		Steve Ball, Zveno Pty Ltd.

This package provides a Tcl interface to James Clark's expat library.
It creates a Tcl package, called "expat", which defines a single
new Tcl command "expat".

See <URL:http://www.zveno.com/zm.cgi/in-tclxml/> for more information
on XML support for Tcl.

INSTALLATION
============

Unix/Linux
----------

You must have Tcl/Tk version 8.0p2 or 8.1a2 installed on your system.
TclExpat has been setup to use Tcl's configuration to make compilation
easy.  Simply point TclExpat's Makefile at the Tcl configuration file:

	/bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e'

where "/usr/local/tcl" is the installation path for Tcl.

To install the package in the first available directory in the Tcl package
path use the command below.  You may need to be root to do this.

	/bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e install'

Macintosh
---------

The source must be compiled against the Tcl/Tk version 8.0p2 release.
A pre-compiled shareware distribution is available from Zveno, see below.

Windows
-------

The source must be compiled against the Tcl/Tk version 8.0p2 release.
A pre-compiled shareware distribution is available from Zveno, see below.

SHAREWARE
=========

Binary distributions for the Macintosh and Windows platforms are available
from Zveno.  See <URL:http://www.zveno.com/zm.cgi/in-tclxml/in-shareware.tml>

USAGE
=====

The package is loaded using:

	package require expat 1.0

This package defines the "expat" command which is used to create a 
parser.  It accepts the following arguments:

	expat parserName ?option value...?

If no "parserName" argument is given then a unique name is chosen.
The name of the newly created parser is returned and a new Tcl command
of the same name is created to manipulate the parser.

The parser command accepts the following methods:

	$parser cget -option
		Returns the current value of an option.

	$parser configure -option value ?-option value...?
		Sets configuration options.

	$parser parse xml
		Parses the XML data given by "xml".  This will
		cause Tcl callback scripts to be invoked, if they
		have been configured.

		If the document is not well-formed then the command 
		returns an error.

	$parser reset
		Resets the parser.  Call this method before parsing
		a new document.

The following options are accepted:

	-elementstartcommand command
		Defines a callback script which is invoked
		when the start of an element is found in the 
		document.  The following arguments are appended 
		to the string before it is evaluated:

			command name attributelist

		"name" is the name of the element.
		"attributelist" is the attribute list for the element.

	-elementendcommand command
		Defines a callback script which is invoked
		whenever an element is closed in the document.  
		The following arguments are appended to the string 
		before it is evaluated:

			command name

		"name" is the name of the element.

	-characterdatacommand command
		Defines a callback script which is invoked whenever
		character data is encountered in the document.
		The following arguments are appended to the string
		before it is evaluated:

			command data

		"data" is the character data found in the document.

	-processinginstructioncommand command
		Defines a callback script which is invoked whenever
		a processing instruction is encountered in the document.
		The following arguments are appended to the string
		before it is evaluated:

			command target data

		"target" is the target of the PI.
		"data" is additional data found in the PI.

	-externalentitycommand command
		Defines a callback script which is invoked whenever
		an externally parsed general entity is encountered 
		in the document.  The following arguments are appended 
		to the string before it is evaluated:

			command names base systemid publicid

		"names" is a list of the open entity names.
		"base" is a URL to be used for resolving relative URLs.
		"systemid" is the system identifier specified in the entity declaration
		"publicid" is the public identifier specified in the entity declaration

	-defaultcommand command
		Invoked when no other callback has been defined for a
		document feature which has been encountered.

	-unparsedentitydeclcommand command
		Invoked when an unparsed entity declaration is encountered.

	-notationdeclcommand command
		Invoked when a notation declaration is encountered.

	-unknownencodingcommand command
		Invoked when a character is encountered which has an
		unknown encoding.

	-baseurl URL
		Specifies a base URL to use for resolving relative URLs.

	-final boolean
		Specifies whether more data is to be parsed.

Callback scripts

Tcl callback scripts may use the "break", "continue" and "error" commands
to alter the flow of control.

	break
		Suppresses invocation of further callback scripts.
	continue
		Suppresses invocation of further callback scripts
		until the current element has finished.
	error
		Suppresses invocation of further callback scripts.
		The parser also returns an error condition.