root/livinglogic.python.xist/NEWS.xml @ 3148:1a71e17630c8

Revision 3148:1a71e17630c8, 80.4 KB (checked in by Walter Doerwald <walter@…>, 12 years ago)

Fix typos.

Line 
1<?xml version='1.0' encoding='utf-8'?>
2<section><h>Changes in 3.1 (released 01/18/2008)</h>
3<ul>
4<li>Fixed the problem that the source distibution didn't include header files.</li>
5<li>If an <class>URLAttr</class> attribute contains a processing instruction
6&xist; will no longer transform the &url; in any way.</li>
7<li>Fixed a parser bug, where attributes were dropped when the attribute
8value was empty.</li>
9<li>Putting a module into a <class>Pool</class> object now copies the
10<lit>xmlns</lit> attribute too. This makes it possible to use <class>Pool</class>
11objects as conversion targets.</li>
12</ul>
13</section>
14
15
16<section><h>Changes in 3.0 (released 01/07/2008)</h>
17<ul>
18<li>Namespaces have been greatly simplified. There are no namespace modules any
19longer. An element class can be assigned a namespace by setting the <lit>xmlns</lit>
20class attribute to the namespace name. Global attributes can be assigned a
21namespace by setting the <lit>xmlns</lit> attribute on the attribute class itself
22(<em>not</em> on the <class>Attrs</class> class). The classes <class>Prefixes</class>
23and <class>NSPool</class> are gone too. Instead a new class <class>Pool</class>
24is used to specify which classes should be used for parsing.
25</li>
26
27<li>Dependency on <a href="http://pyxml.sf.net/">PyXML</a> has finally
28been dropped. &xist; now uses its own &xml; parsing &api;. Two parsers
29are available: One based on <a href="http://expat.sourceforge.net/">expat</a>
30and one based on a custom version of
31<a href="http://effbot.org/zone/sgmlop-index.htm">sgmlop</a>.</li>
32
33<li>Tree traversal has been rewritten again. XFind expressions involving
34multiple uses of <lit>//</lit> now work correctly. The method <meth>walk</meth>
35now doesn't yield <class>Cursor</class> objects, but simple path lists
36(actually it's always the same list, if you want distinct lists use
37<meth>walkpath</meth>). Applying XFind expressions to nodes directly
38is no longer supported, you have to call <meth>walk</meth>,
39<meth>walknode</meth> or <meth>walkpath</meth> with the XFind
40expression instead. Many XFind operators have been renamed and/or reimplemented
41(see the documentation for the <mod>xfind</mod> module for more
42information).</li>
43
44<li><p>The methods <meth>__getitem__</meth>, <meth>__setitem__</meth>
45and <meth>__delitem__</meth> for <class>Frag</class> and <class>Element</class>
46now support the new walk filters, so you can do:</p>
47<ul>
48<li><lit>del node[html.p]</lit> to delete all <class>html.p</class> child elements
49of <lit>node</lit>;</li>
50<li><lit>del node[html.p[2]]</lit> to delete only the third
51<class>html.p</class>;</li>
52<li><lit>node[xfind.hasclass("note")] = html.p("There was a note here!")</lit> to
53replace several child nodes with a new one;</li>
54<li><lit>for c in node[xfind.empty]: print c.bytes()</lit> to print all
55empty (element) children of <lit>node</lit>;</li>
56<li><lit>del node[node[0]]</lit> to delete the first child node (which is
57silly, but illustrates that you can pass a node to get/replace/delete
58that node);</li>
59</ul>
60</li>
61
62<li><p>A new module <mod>ll.xist.css</mod> has been added which contains
63&css; related functionality: The generator function <func>iterrules</func>
64can be passed an &xist; tree and it will produce all &css; rules defined in any
65<class>html.link</class> or <class>html.style</class> elements or imported by them
66(via the &css; rule <lit>@import</lit>). This requires the
67<a href="http://cheeseshop.python.org/pypi/cssutils"><mod>cssutils</mod></a>
68package.</p>
69
70<p>The function <func>applystylesheets</func> modifies the &xist; tree passed in
71by removing all &css; (from <class>html.link</class> and <class>html.style</class>
72elements and their <lit>@import</lit>ed stylesheets) and putting the styles into
73<lit>style</lit> attributes of the affected elements instead.</p>
74
75<p>The function <func>selector</func> return a tree walk filter from a &css;
76selector passed as a string.</p>
77</li>
78
79<li>
80<p>Constructing trees can now be done with <lit>with</lit> blocks. Code looks
81like this:</p>
82<prog>
83with xsc.Frag() as node:
84    +xml.XML()
85    +html.DocTypeXHTML10transitional()
86    with html.html():
87        with html.head():
88            +meta.contenttype()
89            +html.title("Example page")
90        with html.body():
91            +html.h1("Welcome to the example page")
92            with html.p():
93                +xsc.Text("This example page has a link to the ")
94                +html.a("Python home page", href="http://www.python.org/")
95                +xsc.Text(".")
96
97print node.conv().bytes(encoding="us-ascii")
98</prog>
99<p>Also the function <func>xsc.append</func> has been renamed to
100<func>add</func> and supports <lit>with</lit> blocks now instead of
101<a href="http://codespeak.net/svn/user/hpk/talks/xpython-talk.txt">XPython</a>.</p>
102</li>
103
104<li>A subset of <a href="http://docutils.sourceforge.net/rst.html">ReST</a>
105is supported now for docstrings when using the <mod>ll.xist.ns.doc</mod>
106module. The module attribute <lit>__docformat__</lit> is now honored (Set it
107to <lit>"xist"</lit> to get &xist; docstrings).</li>
108
109<li>Many classes in the <mod>ll.xist.ns.doc</mod> have been renamed
110to more familiar names (from &html;, &xhtml; 2 or ReST).</li>
111
112<li>The <lit>media</lit> attribute of <class>html.link</class> and
113<class>html.style</class> now has a method <meth>hasmedia</meth>.</li>
114
115<li>The node method <meth>asBytes</meth> has been renamed to
116<meth>bytes</meth> and <meth>bytes</meth> has been renamed to
117<meth>iterbytes</meth>.</li>
118
119<li>The node method <meth>asString</meth> has been renamed to
120<meth>string</meth> and a new method <meth>iterstring</meth> has been
121added.</li>
122
123<li><class>ll.xist.ns.xml.XML10</class> is gone now. Use
124<class>ll.xist.ns.xml.XML</class> instead.</li>
125
126<li><func>xsc.tonode</func> now will raise an exception when it
127can't handle an argument instead of issuing a warning.</li>
128
129<li>A class attribute <lit>empty</lit> inside element classes will now no
130longer get converted into <lit>model</lit>.</li>
131
132<li><class>ll.xist.ns.doc.pyref</class> now copes better with decorated
133methods.</li>
134
135<li>The deprecated <class>Element</class> methods <meth>hasAttr</meth>,
136<meth>hasattr</meth>, <meth>isallowedattr</meth>, <meth>getAttr</meth>,
137<meth>getattr</meth>, <meth>setDefaultAttr</meth>,
138<meth>setdefaultattr</meth>, <meth>attrkeys</meth>,
139<meth>attrvalues</meth>, <meth>attritems</meth>,
140<meth>iterattrkeys</meth>, <meth>iterattrvalues</meth>,
141<meth>iterattritems</meth>, <meth>allowedattrkeys</meth>,
142<meth>allowedattrvalues</meth>, <meth>allowedattritems</meth>,
143<meth>iterallowedattrkeys</meth>, <meth>iterallowedattrvalues</meth>,
144<meth>iterallowedattritems</meth> and <meth>copyDefaultAttrs</meth>
145have been removed. The deprecated <class>Attrs</class> method
146<meth>copydefaults</meth> has been removed too.</li>
147
148<li>The namespace module <mod>ll.xist.ns.cond</mod> has been removed.</li>
149
150<li>When calling the function <func>ll.xist.parsers.parseURL</func>
151the arguments <arg>headers</arg> and <arg>data</arg> are now passed along
152to the parser's method only if they are specified. This makes it possible to
153pass ssh &url;s to <func>ll.xist.parsers.parseURL</func>.</li>
154
155<li>The methods <meth>withnames</meth> and <meth>withoutnames</meth> have
156been split into two that take Python names and two that take XML names.
157Multiple arguments are used now (instead of one argument that must be a sequence).
158Passing a namespace to remove all attributes from the namespace is no longer supported.</li>
159
160<li>The <class>Attrs</class> methods <meth>updatenew</meth> and
161<meth>updatexisting</meth> have been removed.</li>
162
163</ul>
164</section>
165
166
167<section><h>Changes in 2.15.5 (released 07/17/2007)</h>
168
169<ul>
170<li>The Python quotes example no longer contains the &xml; source
171or the generated &html;.</li>
172</ul>
173
174
175<section><h>Changes in 2.15.4 (released 07/16/2007)</h>
176<ul>
177<li>The Python quotes example now always parses the file from
178the original &url;.</li>
179<li>The Python quotes and the media example now print the result
180to <lit>stdout</lit>.</li>
181</ul>
182</section>
183
184
185<section><h>Changes in 2.15.3 (released 07/16/2007)</h>
186<ul>
187<li>Use a consistent license (MIT) everywhere. This should make
188&xist; Debian compatible.</li>
189<li>Change the Python quotes example, so that it works even if
190there's no <filename>python-quotes.xml</filename> in the current
191directory.</li>
192</ul>
193</section>
194
195
196<section><h>Changes in 2.15.2 (released 01/24/2007)</h>
197<ul>
198<li>Fixed a bug in <meth>presenters.CodePresenter.__str__</meth>.</li>
199<li>Fixed base URL handling for tidy parsing.</li>
200<li>Updated examples.</li>
201<li>Updated <func>xiter</func> and <func>xattrs</func>
202implementations for <class>Node</class> and <class>Namespace</class> to
203conform to the newest version of IPython.</li>
204</ul>
205</section>
206
207
208<section><h>Changes in 2.15.1 (released 09/25/2006)</h>
209<ul>
210<li>Fixed a few bugs in the <mod>sgmlop</mod> function declarations.</li>
211<li>Readded the spacer pixel.</li>
212</ul>
213</section>
214
215
216<section><h>Changes in 2.15 (released 09/24/2006)</h>
217<ul>
218<li>&xist; has been made compatible with Python 2.5: Code has been updated
219to use the proper C API for memory management and <a href="http://www.python.org/dev/peps/pep-0353/">PEP 353</a>
220support has been added. &xist; now includes its own fixed version of <mod>sgmlop</mod>.</li>
221<li>The <class>ll.xist.xsc.Attrs</class> methods <meth>with</meth> and
222<meth>without</meth> have been renamed to <meth>withnames</meth> and
223<meth>withoutnames</meth> for Python 2.5 compatibility.</li>
224<li><class>ll.xist.ns.htmlspecials.pixel</class> no longer handles colors
225via different GIFs. It uses the <lit>background-color</lit> in the <lit>style</lit>
226attribute instead. The same change has been implemented for
227<class>ll.xist.ns.htmlspecials.autopixel</class>. It's now possible to overwrite
228the default <lit>src</lit> attribute value of <lit>root:px/spc.gif</lit> either
229via the &xml; attribute or via the converter context.</li>
230<li>The node method <meth>asText</meth> has been made a function, moved
231into the <mod>html</mod> namespace and renamed to <func>astext</func>.
232Furthermore <app moreinfo="http://elinks.or.cz/">elinks</app> is used for plain text
233formatting now instead of <app moreinfo="http://w3m.sourceforge.net/">w3m</app>.</li>
234</ul>
235</section>
236
237
238<section><h>Changes in 2.14.2 (released 07/04/2006)</h>
239<ul>
240<li>Fixed a bug in the <meth>presentAttr</meth> method of
241<class>ll.xist.presenters.TreePresenter</class>.</li>
242</ul>
243</section>
244
245
246<section><h>Changes in 2.14.1 (released 06/29/2006)</h>
247<ul>
248<li>Fixed a bug in the <meth>presentEntity</meth> method of
249<class>ll.xist.presenters.CodePresenter</class>.</li>
250<li>Updated installation instructions.</li>
251</ul>
252</section>
253
254
255<section><h>Changes in 2.14 (released 06/28/2006)</h>
256<ul>
257<li>Namespaces for RSS 0.91, RSS 2.0 and Atom 1.0 have been added.</li>
258
259<li>A new namespace <mod>ll.xist.ns.detox</mod> has been added that
260is similar to <mod>ll.toxic</mod> but can be used to generate Python
261code instead of PL/SQL code. Using <mod>detox</mod> templates is about
26250 times faster than using &xist; trees directly and about 10 times faster than
263<a href="http://kid.lesscode.org/">Kid</a>.</li>
264
265<li>Presenters are now compatible to <a href="http://ipython.scipy.org/">IPython</a>'s
266ipipe module. This means that you can browse &xist; trees interactively
267if you have IPython installed. <class>NormalPresenter</class> and the
268<class>Node</class> methods <meth>repr</meth> and <meth>asrepr</meth>
269have been removed.</li>
270
271<li>A new processing instruction <class>ll.xist.ns.specials.url</class>
272has been added that does the same &url; transformation as
273<class>ll.xist.xsc.URLAttr</class> does.</li>
274
275<li>On publishing <class>ll.xist.ns.html.html</class> now only adds a
276<lit>lang</lit> and <lit>xml:lang</lit> attribute, if neither of them exists.</li>
277
278<li><mod>setuptools</mod> is now supported for installation.</li>
279</ul>
280</section>
281
282
283<section><h>Changes in 2.13 (released 10/31/2005)</h>
284<ul>
285<li><meth>ll.xist.xsc.Namespace.tokenize</meth> requires a
286<class>unicode</class> object as input now. This makes it possible
287to use encodings that are not ASCII compatible (such as UTF-16).
288The <arg>encoding</arg> argument is gone.</li>
289
290<li><meth>ll.xist.xsc.Node.asString</meth> uses the <arg>encoding</arg>
291argument to determine which characters have to be output as character references
292now. (You'll still get a unicode object as the result.)</li>
293
294<li>A new processing instruction class <class>ll.xist.ns.specials.literal</class>
295has been added, that will output its content literally when published. This
296can be used for embedding preformatted &xml; (e.g. from a database) into an
297XIST tree.</li>
298</ul>
299
300</section>
301
302
303<section><h>Changes in 2.12 (released 10/13/2005)</h>
304<ul>
305<li>Namespaces for <a href="http://www.relaxng.org/">Relax NG</a> and
306<a href="http://kid.lesscode.org/">Kid</a> have been added.</li>
307
308<li>&xist; requires version 1.0 of the core package now.</li>
309
310<li>The class name for the DocBook &dtd; class has been fixed.</li>
311
312</ul>
313
314</section>
315
316
317<section><h>Changes in 2.11 (released 07/29/2005)</h>
318<ul>
319<li>A script <filename>xml2xsc.py</filename> has been added, that
320can be used to parse an &xml; file and generate a rudimentary &xist; namespace
321from it.</li>
322
323<li>A <class>DocType</class> for XHTML 1.1 has been added
324(suggested by Elvelind Grandin).</li>
325
326<li>Line number information is now added when parsing &html;.</li>
327
328<li>The <meth>sorted</meth> method now supports the same arguments
329(<arg>cmp</arg>, <arg>key</arg> and <arg>reverse</arg>) as
330<meth>list.sort</meth> and <func>sorted</func> in Python 2.4.</li>
331
332<li>The <meth>walk</meth> doesn't yield the node directly, but yields
333a <class>Cursor</class> object now, with has several ways of referencing the node.</li>
334
335<li>New methods <meth>walknode</meth>, <meth>walkpath</meth> and
336<meth>walkindex</meth> have been added.</li>
337
338<li>Presenters use an iterator &api; instead of a stream &api; now. Dumping
339an &xml; tree presentation to the terminal can now start immediately instead
340of having to wait for the complete string to be formatted.</li>
341
342<li>Fixed a bug with element/attribute names that contained a <lit>.</lit>
343character. (This broke <mod>ll.xist.ns.fo</mod>.)</li>
344
345<li>Fixed a bug with <lit>xmlns</lit> attributes in nested elements.
346When an element ended the parser restored the wrong prefix mapping.</li>
347
348<li>The <dirname>python-quotes</dirname> demo has been updated to use the
349current version of AMK's &xml; file.</li>
350
351<li>Removed iterator stuff from <mod>ll.xist.xfind</mod>, as this
352is now part of the <mod>ll</mod> package/module.</li>
353
354<li>The function <func>ToNode</func> has been renamed to
355<func>tonode</func>.</li>
356
357<li><class>ll.xist.Context</class> no longer subclasses <class>list</class>.</li>
358
359<li><class>ll.xist.ns.doc.explain</class> will now try to output the objects
360in the order in which they appear in the Python source.</li>
361
362<li>The node methods <meth>find</meth> and <meth>findfirst</meth>
363have been removed.</li>
364
365<li><mod>ll.xist.ns.cond</mod> now uses a sandbox dictionary in a
366converter context for evaluating expression.</li>
367</ul>
368</section>
369
370
371<section><h>Changes in 2.10 (released 05/20/2005)</h>
372<ul>
373<li>The content of the processing instruction <class>ll.xist.ns.code.pyexec</class>
374will not be executed at construction time, but at conversion time. The code
375in <class>ll.xist.ns.code.pyexec</class> or <class>ll.xist.ns.code.pyeval</class>
376will no longer be executed in the <mod>ll.xist.sandbox</mod> module
377(which has been removed), but in a sandbox dictionary in the converter context
378of the <mod>ll.xist.ns.code</mod> namespace.</li>
379
380<li>The tests have been ported to <a href="http://codespeak.net/py/current/doc/test.html">py.test</a>.</li>
381
382<li>The method <meth>mapped</meth> is now callable without arguments.
383In this case a converter will be created on the fly. You can pass constructor
384arguments for this converter to <meth>mapped</meth> as keyword arguments.</li>
385
386<li>The publishing &api; has changed again: <meth>ll.xist.publishers.Publisher.publish</meth>
387no longer accepts an argument <arg>stream</arg> to which the byte strings are
388written, but it is a generator now. The publisher methods <meth>write</meth>
389and <meth>writetext</meth> have been renamed to <meth>encode</meth> and
390<meth>encodetext</meth> and return the encoded byte string, instead of
391writing it directly to the stream. There's a new generator method
392<meth>bytes</meth> for nodes now, which can be passed the same arguments
393as <meth>asBytes</meth>. These changes should help when using
394&xist; in &wsgi; applications.</li>
395
396<li>The iterator returned from <meth>Element.__getitem__</meth>,
397<meth>Frag.__getitem__</meth> and the <meth>walk</meth> method
398now supports <meth>__getitem__</meth> itself, so you can write
399<lit><rep>table</rep>[html.tr][0]</lit> to get the first row from a table or
400<lit><rep>page</rep>.walk(xsc.FindTypeAll(html.td))[-1]</lit> to get the last table cell
401from a complete &html; page.</li>
402
403<li>Several bugs in the namespaces <mod>ll.xist.ns.meta</mod>,
404<mod>ll.xist.ns.form</mod> and
405<mod>ll.xist.ns.specials</mod> have been fixed.</li>
406<li>The namespace modules <mod>ll.xist.ns.css</mod> and
407<mod>ll.xist.ns.cssspecials</mod> have been removed.</li>
408</ul>
409</section>
410
411
412<section><h>Changes in 2.9 (released 04/21/2005)</h>
413<ul>
414<li>&xist; trees can now be pickled. The only restriction is that global
415attributes must come from a namespace that has been turned into a module
416via <meth>makemod</meth>, so that this module can be imported on
417unpickling.</li>
418
419<li><p>Two arguments of the <meth>walk</meth> method have been renamed:
420<arg>filtermode</arg> has been renamed to <arg>inmode</arg> and <arg>walkmode</arg>
421has been renamed to <arg>outmode</arg>. For these modes two new values are
422supported:</p>
423<dl>
424<dt><lit>ll.xist.xsc.walkindex</lit></dt><dd>The value passed to the filter
425function or yielded from the iterator is a list containing child indizes and
426attribute names that specify the path to the node in question.</dd>
427<dt><lit>ll.xist.xsc.walkrootindex</lit></dt><dd>The filter function
428will be called with two arguments: The first is the root node of the tree (i.e.
429the node for which <meth>walk</meth> has been called), the second one is
430an index path (just like for <lit>ll.xist.xsc.walkindex</lit>). If used as
431an <arg>outmode</arg> a tuple with these two values will be yielded.</dd>
432</dl>
433</li>
434<li><p>Attribute mappings now support <meth>__getitem__</meth>,
435<meth>__setitem__</meth> and <meth>__delitem__</meth> with list
436arguments, i.e. you can do:</p>
437<prog>
438<prompt>&gt;&gt;&gt; </prompt><input>from ll.xist.ns import html</input>
439<prompt>&gt;&gt;&gt; </prompt><input>e = html.a("gurk", href=("hinz", "kunz"))</input>
440<prompt>&gt;&gt;&gt; </prompt><input>print e.attrs[["href", 0]]</input>
441hinz
442<prompt>&gt;&gt;&gt; </prompt><input>e.attrs[["href", 0]] = "hurz"</input>
443<prompt>&gt;&gt;&gt; </prompt><input>print e["href"]</input>
444hurzkunz
445<prompt>&gt;&gt;&gt; </prompt><input>del e.attrs[["href", 0]]</input>
446<prompt>&gt;&gt;&gt; </prompt><input>print e["href"]</input>
447kunz
448</prog>
449</li>
450<li><p>&xml; attributes can now be accessed as Python attributes, i.e.</p>
451<prog>
452<prompt>&gt;&gt;&gt; </prompt><input>from ll.xist.ns import html</input>
453<prompt>&gt;&gt;&gt; </prompt><input>e = html.a("spam", href="eggs")</input>
454<prompt>&gt;&gt;&gt; </prompt><input>print e.attrs.href</input>
455eggs
456</prog>
457<p>(Don't confuse this with <lit>e.Attrs.href</lit> which is the
458attribute class.)</p>
459</li>
460
461<li><class>Frag</class> and <class>Element</class> now support <class>Node</class>
462subclasses as arguments to their <meth>__getitem__</meth> method: An iterator
463for all children of the specified type will be returned.</li>
464
465<li>The encoding used for parsing now defaults to <lit>None</lit>. When
466reading from an &url; and no default encoding has been specified the one
467from the <lit>Content-Type</lit> header will be used. If this still doesn't
468result in a usable encoding, <lit>"utf-8"</lit> will be used when parsing &xml;
469and <lit>"iso-8859-1"</lit> will be used when parsing broken &html;.</li>
470
471<li>All error and warning classes from <mod>ll.xist.errors</mod>
472have been merged into <mod>ll.xist.xsc</mod>. This avoids import
473problems with circular imports.</li>
474
475<li>The attributes <lit>showLocation</lit> and <lit>showPath</lit>
476of <class>ll.xist.presenters.TreePresenter</class> have been lowercased and
477presenters are properly reset after they've done their job.</li>
478
479<li>The class attribute <lit>xmlname</lit> will no longer be turned into a list
480containing the Python and the &xml; name, but will be the &xml; name only. You
481can get the Python name from <lit><rep>foo</rep>.__class__.__name__</lit>.</li>
482
483<li><class>DeprecationWarning</class>s for <lit>name</lit> and
484<lit>attrHandlers</lit> have finally been removed.</li>
485
486<li>Instances of <class>ll.xist.xsc.Entity</class> subclasses can now be
487compared. <meth>__eq__</meth> simply checks if the objects are instances
488of the same class.</li>
489</ul>
490</section>
491
492
493<section><h>Changes in 2.8.1 (released 03/22/2005)</h>
494<ul>
495<li>Added a note about the package init file to the installation
496documentation.</li>
497</ul>
498</section>
499
500
501<section><h>Changes in 2.8 (released 01/03/2005)</h>
502<ul>
503<li>&xist; requires Python 2.4 now.</li>
504
505<li><class>ll.xist.ns.specials.x</class> has been renamed to
506<class>ll.xist.ns.specials.ignore</class>.</li>
507
508<li><class>ll.xist.utils.findAttr</class> has been renamed to
509<class>ll.xist.utils.findattr</class>.</li>
510
511<li><class>ll.xist.xfind.item</class> no longer handles slices.</li>
512
513<li>XFind has been enhanced to support item and slice operators, i.e.
514if <lit><rep>foo</rep></lit> is an XFind operator, <lit><rep>foo</rep>[0]</lit>
515is an operator that will produce the first node from <lit><rep>foo</rep></lit>
516(if there is one). Negative values and slices are supported too.</li>
517
518<li>Operators can be chained via division: <lit>html.a/html.b</lit> is an
519operator that can be passed around and applied to a node.</li>
520
521<li>&xist; requires the new core module and makes use of the new
522<z>cooperative displayhook</z> functionality defined there: If you install
523the displayhook you can tweak or replace <lit>ll.xist.presenters.hookpresenter</lit>
524to change the output.</li>
525</ul>
526</section>
527
528
529<section><h>Changes in 2.7 (released 11/24/2004)</h>
530<ul>
531<li>The transparent pixel used by <class>ll.xist.ns.htmlspecials.pixel</class>
532has been renamed to <filename>spc.gif</filename> to avoid problems with IE.</li>
533<li>Removed a debug print in <class>ll.xist.xfind.Finder.__getitem__</class>.</li>
534<li><mod>ll.xist.xfind</mod> now has a new function <func>item</func>,
535that can be used to get a certain item or slice from an iterator.
536<func>xfind.first</func> and <func>xfind.last</func> have been
537changed to use <func>xfind.item</func>, so you now have to pass a
538default value to get the old behaviour.</li>
539<li>Obsolete options in <mod>ll.xist.options</mod> have been removed
540(and <lit>reprEncoding</lit> has been renamed to <lit>reprencoding</lit>).</li>
541</ul>
542</section>
543
544
545<section><h>Changes in 2.6.2 (released 06/06/2005)</h>
546<ul>
547<li>Fixed a bug in <meth>ll.xist.parsers.Parser.parse</meth>.</li>
548</ul>
549</section>
550
551
552<section><h>Changes in 2.6.1 (released 11/02/2004)</h>
553<ul>
554<li>Fixed a bug in <meth>ll.xist.xfind.Finder.__floordiv__</meth>.</li>
555<li>Restricted characters as defined in
556<a href="http://www.w3.org/TR/2004/REC-xml11-20040204/#NT-RestrictedChar">&xml; 1.1</a>
557will now be published as character references.</li>
558</ul>
559</section>
560
561
562<section><h>Changes in 2.6 (released 10/26/2004)</h>
563<ul>
564<li><func>ToNode</func> now tries iterating through the
565value passed in, so it's now possible to pass iterators and generators
566(and generator expressions in Python 2.4) to <class>Frag</class>
567and <class>Element</class> constructors.</li>
568
569<li><p>A new &api; named XFind has been added for iterating through &xml;
570trees. XFind expressions look somewhat like XPath expressions but are pure
571Python expressions. For example finding all images inside links in an &html;
572page can be done like this:</p>
573<example><h>Finding linked images with XFind</h>
574<prog>
575from ll.xist import parsers, xfind
576from ll.xist.ns import html
577node = parsers.parseURL("http://www.python.org/", tidy=True)
578for img in node//html.a/html.img:
579    print img["src"]
580</prog>
581</example>
582
583<p>The module <mod>ll.xist.xfind</mod> contains several operators
584that can be used in XFind expressions.</p>
585</li>
586
587<li>Parsing broken &html; is now done with the &html; parser from
588<a href="http://www.xmlsoft.org/">libxml2</a>. The parsing functions
589no longer accept options for tidy, only the boolean value of the <arg>tidy</arg>
590argument is used.</li>
591
592<li>The publishing &api; has been simplified: Publication can now be done with
593a call to <meth>ll.xist.publishers.Publisher.publish</meth>, passing in a
594<class>ll.xist.xsc.Node</class>. Writing strings to the publisher output is
595now done with <meth>ll.xist.publishers.Publisher.write</meth>. The methods
596<meth>beginPublication</meth> and <meth>endPublication</meth> have been
597removed.</li>
598
599<li>The presentation &api; has been simplified in the same way: You'll get a
600presentation by calling: <lit>string = <rep>presenter</rep>.present(<rep>node</rep>)</lit>.
601The methods <meth>beginPresentation</meth> and <meth>endPresentation</meth>
602have been removed.</li>
603
604<li>The parser now has the option to ignore illegal elements, attributes,
605processing instructions and entities. The default behaviour is to raise an
606exception, but this can now be reconfigured via Python's warning framework.</li>
607
608<li>The classmethod <meth>tokenize</meth> from <mod>ll.toxic</mod>
609has been moved to <class>ll.xist.xsc.Namespace</class>, so it's now possible
610to tokenize an &xml; string for other processing instructions as well.</li>
611
612<li>A new class <class>ll.xist.xsc.NSPool</class> has been added.
613An <class>NSPool</class> contains a pool of namespaces from which the parser
614selects the appropriate namespace once an <lit>xmlns</lit> attribute is
615encountered.</li>
616
617<li>The script <filename>xscmake.py</filename> (which has been unmaintained
618for a while now) has been removed.</li>
619
620<li>Elements <class>hostname</class>, <class>tty</class>, <class>prompt</class>
621and <class>input</class> were add to <mod>ll.xist.ns.doc</mod>.</li>
622
623<li>The method <meth>ll.xist.xsc.Attrs.set</meth> now returns the
624new attribute object.</li>
625
626<li>The <meth>visit</meth> method has been removed.</li>
627
628<li><meth>ll.xist.xsc.FindOld</meth> has been removed.</li>
629
630<li><class>ll.xist.ns.xml.header</class> has been renamed to
631<class>ll.xist.ns.xml.declaration</class>.</li>
632
633</ul>
634
635</section>
636
637
638<section><h>Changes in 2.5 (released 06/30/2004)</h>
639<ul>
640
641<li>Specifying content models for elements has seen major enhancements. The
642boolean class attribute <lit>empty</lit> has been replaced by an object
643<lit>model</lit> whose <meth>checkvalid</meth> method will be called
644for validating the element content.</li>
645
646<li>A new module <mod>ll.xist.sims</mod> has been added that provides
647a simple schema validation. Schema violations will be reported via Pythons
648warning framework.</li>
649
650<li>All namespace modules have been updated to use <mod>sims</mod>
651information. The &svg; module has been updated to &svg; 1.1. The docbook
652module has been updated to DocBook 4.3.</li>
653
654<li>It's possible to switch off validation during parsing and publishing.</li>
655
656<li><p><class>ll.xist.xsc.Frag</class> and <class>ll.xist.xsc.Element</class>
657both have a <meth>__call__</meth> method with the same arguments as
658their constructors. Those methods will append content nodes (and set attributes
659for <class>ll.xist.xsc.Element</class>) and return <self/>, so they can be used
660when creating an object tree. This makes it possible to put the attributes close
661to the tag name, instead of putting them at the end after the content.</p>
662<p>Instead of:</p>
663<example>
664<prog>
665node = html.table(
666    html.tr(
667        html.td("foo"),
668        html.td("bar"),
669    ),
670    html.tr(
671        html.td("spam"),
672        html.td("eggs")
673    ),
674    class_="example"
675)
676</prog>
677</example>
678<p>you can now use the following:</p>
679<example>
680<prog>
681node = html.table(class_="example")(
682    html.tr(
683        html.td("foo"),
684        html.td("bar"),
685    ),
686    html.tr(
687        html.td("spam"),
688        html.td("eggs")
689    )
690)
691</prog>
692</example>
693
694</li>
695
696<li><p>Experimental support for Holger Krekel's
697<a href="http://codespeak.net/svn/user/hpk/talks/xpython-talk.txt">XPython</a>
698has been added. Code might look like this:</p>
699<example>
700<prog>
701from ll.xist import xsc, converters
702from ll.xist.ns import html, meta
703
704import random
705
706c = converters.Converter()
707&lt;c&gt;:
708    &lt;html.html()&gt;:
709        &lt;html.head()&gt;:
710            &lt;meta.contenttype()&gt;: pass
711            &lt;html.title()&gt;:
712                xsc.append("The title")
713        &lt;html.body(class_="foo")&gt;:
714            &lt;html.h1()&gt;:
715                flag = random.choice((0, 1))
716                if flag:
717                    xsc.append("The foo page", class_="foo")
718                else:
719                    xsc.append("The bar page", class_="bar")
720            &lt;html.p()&gt;:
721                if flag:
722                    xsc.append("The foo content")
723                else:
724                    xsc.append("The bar content")
725
726print c.lastnode.asBytes()
727</prog>
728</example>
729</li>
730
731<li>
732<p>Creating global attributes has been simplified. Passing an instance
733of <class>ll.xist.xsc.Namespace.Attrs</class> to an <class>Element</class>
734constructor now does the right thing:</p>
735<example>
736<prog>
737from ll.xist.ns import html, xml
738node = html.html(
739    html.head(),
740    xml.Attrs(lang="de"),
741    lang="en",
742)
743</prog>
744</example>
745</li>
746
747<li>Creating skeleton implementations of &xist; namespaces is no longer done
748via &xml; conversion (i.e. the namespace module <mod>ll.xist.ns.xndl</mod>),
749but through the new module <mod>ll.xist.xnd</mod>. The script
750<filename>dtdxsc.py</filename> will automatically generate <mod>sims</mod>
751information.</li>
752
753<li><class>ll.xist.xsc.CharRef</class> now inherits from
754<class>ll.xist.xsc.Text</class> too, so you don't have to special case
755<class>CharRef</class>s any more. When publishing, <class>CharRef</class>s
756will be handled like <class>Text</class> nodes.</li>
757
758<li><class>ll.xist.ns.meta.contenttype</class> now has an attribute
759<lit>mimetype</lit> (defaulting to <lit>"text/html"</lit>) for specifying
760the &mime; type.</li>
761
762<li><class>ll.xist.ns.htmlspecials.caps</class> has been removed.</li>
763
764<li>Registering elements in namespace classes has been rewritten to use
765a cache now.</li>
766
767<li>Pretty printing has been changed: Whitespace will only be added now if
768there are no text nodes in element content.</li>
769
770<li>Two mailing lists are now available: One for discussion about &xist;
771and one for &xist; announcements.</li>
772</ul>
773</section>
774
775
776<section><h>Changes in 2.4.1 (released 01/05/2004)</h>
777<ul>
778<li>Changed the xmlname of <class>ll.xist.ns.jsp.directive_page</class> back again
779(it's <lit>directive.page</lit> only for the &xml; form, which we don't use anyway.)</li>
780
781<li>Drop the default value for <class>ll.xist.ns.jsp.directive_page.Attrs.language</class>,
782as this attribute can only be used once.</li>
783
784<li>If an <class>ll.xist.xsc.Prefixes</class> object has a prefix mapping for
785a namespace it will return this prefix too, if asked for a prefix for a subclass
786of this namespace.</li>
787</ul>
788</section>
789
790
791<section><h>Changes in 2.4 (released 01/02/2004)</h>
792<ul>
793<li>The class <class>ll.xist.parsers.Handler</class> has been renamed to
794<class>Parser</class> and has been made reusable, i.e. it is possible to
795instantiate a parser once and use it multiple times for parsing. All the
796classes derived from <class>xml.sax.xmlreader.InputSource</class> have been
797dropped and the methods for parsing strings, &url;s and files have been
798implemented as methods of the parser. Most of the arguments that had to be passed
799to the various parsing functions are passed to the parser constructor now.
800The basic parsing functionality is implemented by parsing streams instead of
801<class>InputSource</class>s.</li>
802<li>Similar to the changes for parsing, publishers have been changed to be
803reusable and most arguments to the publishing functions are available as
804arguments to the publisher constructor.</li>
805<li>Now converter contexts are no longer bound to an element
806class, but to the context class defined by the element class, i.e.
807the attribute <lit>Context</lit> of the argument for <meth>Converter.__getitem__</meth>
808will be used as the dictionary key. This makes it possible to use a class
809and it subclasses interchangeably (as long as the base class defines
810its own <class>Context</class> class and the subclasses don't overwrite it).</li>
811<li>Added a find functor <class>FindTypeAllAttrs</class> that
812searches content and attributes.</li>
813<li>Fixed the &xml; name for <class>ll.xist.ns.jsp.directive_page</class>.</li>
814<li>All character references in <mod>ll.xist.ns.ihtml</mod>
815that exist in <mod>ll.xist.ns.chars</mod> too have been removed.</li>
816</ul>
817</section>
818
819
820<section><h>Changes in 2.3 (released 12/08/2003)</h>
821<ul>
822<li>It's now possible to parse &xml; without generating location
823information for each node, by passing <lit>loc=False</lit> to
824the constructor of the <class>Handler</class>.</li>
825<li>The <class>HTMLParser</class> no longer complains about
826global attributes or <lit>xmlns</lit>.</li>
827<li>&xist; now supports <app moreinfo="http://utidylib.sf.net/">&micro;Tidylib</app>
828in addition to <app>mxTidy</app>. If <app>&micro;Tidylib</app> is found
829it is preferred over <app>mxTidy</app>.</li>
830<li>It's possible now to pass arguments to tidy simple by
831passing an argument dictionary for the <arg>tidy</arg> argument
832in the parsing functions.</li>
833<li>The methods <meth>parsed</meth> and <meth>checkvalid</meth>
834have been separated.</li>
835<li><class>ll.xist.ns.htmlspecials.pixel</class> and
836<class>ll.xist.ns.htmlspecials.autopixel</class> now check whether their
837<lit>color</lit> attribute is ok.</li>
838<li>The base &url; is now set correctly when parsing from an &url;
839even if the original &url; does a redirect. (This requires <mod>ll.url</mod>
840version 0.11.3).</li>
841<li>Namespace handling has been rewritten again, to be more standards
842compliant: Now there is no prefixes for entities and processing instructions any longer.
843Prefix mappings can be created much simpler, and they no longer contain any
844namespace stack for parsing, as this is now done by the parser itself.
845<class>xsc.NamespaceAttrMixIn</class> is gone too.</li>
846<li>The processing instructions <class>exec_</class> and <class>eval_</class>
847from <mod>ll.xist.ns.code</mod> have been renamed to <class>pyexec</class>
848and <class>pyeval</class> and <class>import_</class> has been removed.</li>
849<li><class>CharRef</class>s from <mod>ll.xist.ns.html</mod> have been
850moved to a new module named <mod>ll.xist.ns.chars</mod>.</li>
851<li>The method names <meth>beginPublication</meth>, <meth>endPublication</meth>
852and <meth>doPublication</meth> have been lowercased.</li>
853</ul>
854</section>
855
856
857<section><h>Changes in 2.2 (released 07/31/2003)</h>
858<ul>
859<li><p>Namespace handling has been completely rewritten.
860Namespaces are now classes derived from <class>ll.xist.xsc.Namespace</class>.
861Defining element classes can be done inside or outside the namespace
862class. If the element classes are defined outside the namespace
863class, they can be moved inside the namespace with a simple
864attribute assignment:</p>
865<prog>
866class foo(xsc.Element):
867    empty = False
868
869class xmlns(xsc.Namespace):
870    xmlname = "foo"
871    xmlurl = "http://www.foo.com/ns/foo"
872
873xmlns.foo = foo
874</prog>
875<p>The methods <meth>elementkeys</meth>, <meth>iterelementkeys</meth>,
876<meth>elementvalues</meth>, <meth>iterelementvalues</meth>,
877<meth>elementitems</meth> and <meth>iterelementitems</meth>
878can be used for iterating through the element classes and their
879names. You can use the method <meth>element</meth>
880to get an element class with a certain name:</p>
881<prog>
882&gt;&gt;&gt; from ll.xist.ns import html
883&gt;&gt;&gt; html.element("div")
884&lt;element class ll.xist.ns.html/div at 0x824363c&gt;
885</prog>
886<p>For processing instructions, entities and character references
887similar methods are available.</p>
888<p>The method <meth>update</meth> can be used to add
889many element classes to a namespace at once, simply by passing
890a dictionary with those classes (use <lit>vars()</lit>
891to add everything that's defined inside your module). The method
892<meth>updatenew</meth> does the same, but copies only those
893attributes that don't exist in the namespace, <meth>updateexisting</meth>
894copies only those that do exist. You can turn a namespace
895into a module with <meth>makemod</meth>:</p>
896<prog>
897from ll.xist import xsc
898
899class foo(xsc.Element):
900    empty = False
901
902class xmlns(xsc.Namespace):
903    xmlname = "foo"
904    xmlurl = "http://www.foo.com/ns/foo"
905xmlns.makemod(vars())
906</prog>
907<p>Put the above code into <filename>foo.py</filename> and
908you can do the following:</p>
909<prog>
910>>> import foo
911>>> foo
912&lt;namespace foo/xmlns name=u'foo' url=u'http://www.foo.com/ns/foo' with 1 elements from 'foo.py' at 0x81bfc14&gt;
913</prog>
914</li>
915
916<li><func>getns</func> has been dropped, so you always
917have to pass in a <class>Namespace</class> class where a namespace
918is required.</li>
919
920<li>For the <class>ll.xist.ns.jsp.directive_page</class> element
921automatic generation of the correct <lit>charset</lit> option
922in the <lit>contentType</lit> attribute is only done when there
923is a <lit>contentType</lit> attribute, as <lit>contentType</lit>
924is optional.</li>
925
926<li>The converter has a new property <func>node</func>.
927<arg>node</arg> can't be passed to <meth>conv</meth> but
928will be set to <self/> by <meth>conv</meth> automatically.
929This makes it possible to access the <z>document root</z>
930during conversion.</li>
931
932<li><class>ll.xist.ns.htmlspecials.autoimg</class> no longer touches
933existing width and height attributes. This means that %-formatting
934of the existing attributes is no longer done.</li>
935
936<li>Added a new class <class>ll.xist.ns.htmlspecials.autopixel</class>
937that works like <class>ll.xist.ns.htmlspecials.pixel</class> but
938inherits the size for the image specified via the <lit>src</lit>
939attribute.</li>
940
941<li><class>Frag</class> and <class>Element</class> now support
942extended slices.</li>
943
944<li><class>Frag</class> and <class>Element</class> now support
945the methods <meth>extend</meth> and <meth>__iadd__</meth>.</li>
946
947<li>For walking the tree the method <meth>walk</meth> has been completely
948rewritten and a new method <meth>visit</meth> has been added. For
949more info see the docstrings.</li>
950
951<li><class>Node</class> now has two new methods <meth>copy</meth>
952and <meth>deepcopy</meth> and supports the <mod>copy</mod>
953module from the Python standard library.</li>
954
955<li>Calling <meth>mapped</meth> through <meth>conv</meth> has
956been removed. You again have to call <meth>mapped</meth> directly
957and pass a node and a converter.</li>
958
959<li>The &html; handling of the <class>HTMLParser</class> has been improved
960(it now uses code from <mod>xml.sax.drivers2.drv_sgmlop_html</mod> (which
961is part of <a href="http://pyxml.sf.net">PyXML</a>)).</li>
962
963<li>The core functionality found in the script <filename>dtd2xsc.py</filename>
964has been moved to a class method <meth>ll.xist.ns.xndl.fromdtd</meth> in the
965<mod>ll.xist.ns.xndl</mod> namespace.</li>
966
967<li><class>ll.xist.parsers.ExpatParser</class> is now a real subclass
968instead of an alias for <class>xml.sax.expatreader.ExpatParser</class>
969It reports unknown entity references to the application (if loading
970of external entities is switched off, which is done by
971<class>ll.xist.parsers.Handler</class> and only outside of attributes).</li>
972
973<li>Namespaces have been added for Zope's TAL and METAL specifications.</li>
974
975<li>A namespace has been added for <a href="http://www.w3.org/Style/XSL/">XSL-FO</a>.</li>
976</ul>
977</section>
978
979
980<section><h>Changes in 2.1.4 (released 06/13/2003)</h>
981<ul>
982<li>Remove the checks for attributes in attributes and
983moved the publication code for the full element into a separate
984method. This allows &jsp; tag library namespaces to simply
985overwrite <meth>publish</meth> to publish the element
986even inside attributes. (This is the same fix as in release 1.5.10)</li>
987</ul>
988</section>
989
990
991<section><h>Changes in 2.1.3 (released 05/07/2003)</h>
992<ul>
993<li>The methods <meth>sorted</meth>, <meth>reversed</meth>
994and <meth>shuffled</meth> have been rewritten so they no longer
995use <lit>sys.maxint</lit>. This change fixes those methods for
99664 bit platforms (reported by Giles Frances Hall)</li>
997</ul>
998</section>
999
1000
1001<section><h>Changes in 2.1.2 (released 02/27/2003)</h>
1002<ul>
1003<li><class>ll.xist.ns.struts_config11.plug_in</class> now
1004allows content (as the &dtd; states). (This is the same fix
1005as in release 1.5.8.)</li>
1006</ul>
1007</section>
1008
1009
1010<section><h>Changes in 2.1.1 (released 02/11/2003)</h>
1011<ul>
1012<li>Added a few elements and attributes to <mod>ll.xist.ns.doc</mod>:
1013<class>username</class>, which is used for the name of a user account,
1014<class>xref</class>, which is used for internal cross references and
1015the attribute <lit>id</lit> for <class>section</class>, which specifies
1016the target for an <class>xref</class>.</li>
1017</ul>
1018</section>
1019
1020
1021<section><h>Changes in 2.1 (released 12/09/2002)</h>
1022<ul>
1023<li>Added a new namespace module <mod>ll.xist.ns.xndl</mod>
1024that contains the <z>&xist; namespace definition language</z>, i.e.
1025elements that describe an &xist; namespace and can be used by
1026various scripts to generate skeleton namespace modules.
1027The first of these script is the &dtd; to namespace converter
1028<filename>dtd2xsc.py</filename>.</li>
1029<li>Added a new namespace module <mod>ll.xist.ns.tld</mod>
1030that contains the definition for Java Server Pages Tag Library
1031descriptors and a script <filename>tld2xsc.py</filename>
1032that uses this namespace to generate namespace modules from
1033<lit>tld</lit> files.</li>
1034<li><class>Attr</class> now supports the method
1035<meth>filtered</meth>. This is used by <meth>without</meth>
1036now. The arguments for <meth>without</meth> have changed,
1037because handling global attributes was too <z>magic</z>.
1038A new method <meth>with</meth> has been added, with does
1039the opposite of <meth>without</meth>, i.e. it removes all
1040attributes that are not specified as parameters.</li>
1041<li>The Python name of each <class>Node</class> subclass
1042is now available as the class attribute <lit>pyname</lit>.</li>
1043<li>To continue the great renaming <meth>withSep</meth>
1044has been renamed to <meth>withsep</meth>.</li>
1045<li>The namespace name for the <mod>ll.xist.ns.struts_html</mod>
1046module has been fixed.</li>
1047<li>The argument <arg>defaultEncoding</arg> for the various
1048parsing functions has been renamed to <arg>encoding</arg>.</li>
1049</ul>
1050</section>
1051
1052
1053<section><h>Changes in 2.0.8 (released 11/20/2002)</h>
1054<ul>
1055<li><func>ll.xist.ns.doc.getDoc</func> has been renamed
1056to <func>getdoc</func>.</li>
1057<li>The &css; parser was dropping the <lit>%</lit> from
1058percentage values. This has been fixed.</li>
1059</ul>
1060</section>
1061
1062
1063<section><h>Changes in 2.0.7 (released 11/12/2002)</h>
1064<ul>
1065<li><meth>xsc.Element.__nonzero__</meth> can no longer fall back
1066to <meth>xsc.Frag.__nonzero__</meth>.
1067(this is the same fix as in 1.5.7).</li>
1068</ul>
1069</section>
1070
1071
1072<section><h>Changes in 2.0.6 (released 11/11/2002)</h>
1073<ul>
1074<li>Performance optimizations.</li>
1075</ul>
1076</section>
1077
1078
1079<section><h>Changes in 2.0.5 (released 11/11/2002)</h>
1080<ul>
1081<li>Fixed a bug in <class>ll.xist.ns.specials.autoimg</class>:
1082Attributes were not converted before the size check was done
1083(this is the same fix as in 1.5.5).</li>
1084</ul>
1085</section>
1086
1087
1088<section><h>Changes in 2.0.4 (released 11/08/2002)</h>
1089<ul>
1090<li>Fixed a regression bug in <class>ll.xist.ns.jsp.directive</class>
1091and several documentation issues.</li>
1092</ul>
1093</section>
1094
1095
1096<section><h>Changes in 2.0.3 (released 10/30/2002)</h>
1097<ul>
1098<li>Fixed a few bugs in <class>HTMLParser</class>.</li>
1099<li>Added DocBook conversion for several elements
1100in <mod>ll.xist.ns.doc</mod>.</li>
1101<li>Now the <filename>__init__.py</filename> file for the
1102<mod>ll</mod> package is included.</li>
1103</ul>
1104</section>
1105
1106
1107<section><h>Changes in 2.0.2 (released 10/21/2002)</h>
1108<ul>
1109<li>Fixed a bug in <meth>Frag.__rmul__</meth> (by
1110reusing <meth>__mul__</meth>).</li>
1111<li>Fixed a bug with the backwards compatible prefix
1112mapping: Defining element classes in <lit>exec</lit> processing
1113instructions didn't work, because the prefixes object used for
1114parsing wouldn't be updated when the namespace object is
1115defined inside the processing instruction. Now using the default
1116for the <arg>prefixes</arg> argument in calls to the parsing
1117functions uses one global shared <class>Prefixes</class> instances
1118where all the namespaces that are newly defined will be registered too.</li>
1119</ul>
1120</section>
1121
1122
1123<section><h>Changes in 2.0.1 (released 10/17/2002)</h>
1124<ul>
1125<li>Fixed <filename>xscmake.py</filename> by removing the
1126prefix handling. <class>OldPrefixes</class> will always
1127be used for parsing now.</li>
1128</ul>
1129</section>
1130
1131
1132<section><h>Changes in 2.0 (released 10/16/2002)</h>
1133<ul>
1134<li>&xist; now requires at least Python 2.2.1.</li>
1135<li>Attribute handling has been largely rewritten. Instead of
1136a class attribute <lit>attrHandlers</lit>, the attributes
1137are now defined through a nested class named <class>Attrs</class>
1138inside the element. This class must be derived from <class>ll.xist.Element.Attrs</class>
1139(or one of its subclasses if you want to inherit attributes from
1140this class). Defining attributes is done through classes nested
1141inside this attributes class and derived from any of the known
1142attribute classes (like <class>TextAttr</class>, <class>URLAttr</class> etc.).
1143The class name will be the attribute name (and can be overwritten
1144with a class attribute <lit>xmlname</lit>. This makes it possible
1145to have docstrings for attributes. Furthermore it's possible
1146to define an attribute default value via the class attribute <lit>default</lit>,
1147allowed values for the attribute via <lit>values</lit>,
1148which is a list of allowed values, and whether the attribute is
1149required or not via <lit>required</lit>.</li>
1150<li>&xist; now has real namespace support. The new class
1151<class>ll.xist.xsc.Prefixes</class> can be used to define a
1152mapping between prefixes and namespace names. This can be
1153used for parsing and publishing. Namespace support is even
1154available for entities and processing instruction.</li>
1155<li>Global attributes are supported now. Namespace modules
1156for the <lit>xml</lit> and <lit>xlink</lit> namespaces
1157have been added (and <class>ll.xist.xsc.XML</class> was
1158moved to <mod>ll.xist.ns.xml</mod>).</li>
1159<li>A new namespace module for &svg; 1.0 has been added: <mod>ll.xist.ns.svg</mod>.</li>
1160<li>The &html; specific parts of <mod>ll.xist.ns.specials</mod>
1161have been split off into a separate module <mod>ll.xist.ns.htmlspecials</mod>.</li>
1162<li>Comparison of attributes with strings has been removed.
1163You have to use <meth>__unicode__</meth> or <meth>__str__</meth>
1164now before comparing.</li>
1165<li>The <class>HTMLParser</class> now removes unknown attributes
1166instead of complaining.</li>
1167<li>There is a new parser class <class>BadEntityParser</class>, which
1168is a &sax;2 parser that recognizes the character entities
1169defined in &html; and tries to pass on unknown or malformed
1170entities to the handler literally.</li>
1171<li>To give all nodes a chance to do something after they have been parsed
1172(e.g. to prepend the base &url; for <class>URLAttr</class> nodes), the parser
1173now calls the method <meth>parsed</meth> immediately after node creation.
1174This is used for the new class <class>StyleAttr</class>, which uses the
1175<class>CSSTokenizer</class>, to prepend the base &url; to all &url;s
1176found in a style attribute.</li>
1177<li>The pixel images have been moved to the directory <dirname>px</dirname>
1178to make image &url;s shorter.</li>
1179</ul>
1180</section>
1181
1182
1183<section><h>Changes in 1.6.1 (released 08/25/2003)</h>
1184<ul>
1185<li>Updated to work with newer versions of <mod>ll.ansistyle</mod>.</li>
1186<li>Updated the namespaces <mod>ll.xist.ns.struts_html</mod> and
1187<mod>ll.xist.ns.struts_config11</mod> to the state of Struts 1.1 final.</li>
1188</ul>
1189</section>
1190
1191
1192<section><h>Changes in 1.6 (released 07/02/2003)</h>
1193<ul>
1194<li>Removed the default value for the <lit>className</lit> attribute
1195in <class>ll.xist.ns.struts_config11.action</class>.</li>
1196<li>Added an attribute <lit>type</lit> to
1197<class>ll.xist.ns.struts_config11.action_mapping</class>.</li>
1198</ul>
1199</section>
1200
1201
1202<section><h>Changes in 1.5.13 (released 07/01/2003)</h>
1203<ul>
1204<li>Implemented <meth>ll.xist.xsc.Namespace.__eq__</meth>,
1205so that replacing a namespace in the registry really works.</li>
1206<li>Added an attribute <lit>target</lit> to <class>ll.xist.ns.html.area</class>.</li>
1207</ul>
1208</section>
1209
1210
1211<section><h>Changes in 1.5.12 (released 06/17/2003)</h>
1212<ul>
1213<li>Fixed a bug in the new <mod>ll.xist.ns.jsp</mod>.</li>
1214</ul>
1215</section>
1216
1217
1218<section><h>Changes in 1.5.11 (released 06/13/2003)</h>
1219<ul>
1220<li>Updated <mod>ll.xist.ns.jsp</mod> to &jsp; 1.2.</li>
1221</ul>
1222</section>
1223
1224
1225<section><h>Changes in 1.5.10 (released 06/13/2003)</h>
1226<ul>
1227<li>Remove the checks for attributes in attributes and
1228moved the publication code for the full element into a separate
1229method. This allows &jsp; tag library namespaces to simply
1230overwrite <meth>publish</meth> to publish the element
1231even inside attributes.</li>
1232</ul>
1233</section>
1234
1235
1236<section><h>Changes in 1.5.9 (released 04/30/2003)</h>
1237<ul>
1238<li>Reregistering a namespace now properly overwrites
1239the old version in <lit>xsc.namespaceRegistry</lit>.</li>
1240</ul>
1241</section>
1242
1243
1244<section><h>Changes in 1.5.8 (released 02/27/2003)</h>
1245<ul>
1246<li><class>ll.xist.ns.struts_config11.plug_in</class> now
1247allows content (as the &dtd; states).</li>
1248</ul>
1249</section>
1250
1251
1252<section><h>Changes in 1.5.7 (released 11/12/2002)</h>
1253<ul>
1254<li><meth>xsc.Element.__nonzero__</meth> can no longer fall back
1255to <meth>xsc.Frag.__nonzero__</meth>.</li>
1256</ul>
1257</section>
1258
1259
1260<section><h>Changes in 1.5.6 (released 11/11/2002)</h>
1261<ul>
1262<li>Performance optimizations.</li>
1263</ul>
1264</section>
1265
1266
1267<section><h>Changes in 1.5.5 (released 11/11/2002)</h>
1268<ul>
1269<li>Fixed a bug in <class>ll.xist.ns.specials.autoimg</class>:
1270Attributes were not converted before the size check was done.</li>
1271</ul>
1272</section>
1273
1274
1275<section><h>Changes in 1.5.4 (released 09/30/2002)</h>
1276<ul>
1277<li><filename>xscmake.py</filename> now tries to strip off
1278a trailing <lit>xsc</lit> from the filename before it falls back
1279to the extension <lit>html</lit> (The builtin extension mapping
1280is still tried first).</li>
1281</ul>
1282</section>
1283
1284
1285<section><h>Changes in 1.5.3 (released 09/25/2002)</h>
1286<ul>
1287<li>Added new processing instruction class <class>ll.xist.ns.php.expression</class>
1288that generates a &php; <lit>print</lit> statement from its content.</li>
1289</ul>
1290</section>
1291
1292
1293<section><h>Changes in 1.5.2 (released 09/19/2002)</h>
1294<ul>
1295<li>Removed the <lit>value</lit> magic from
1296<class>ll.xist.ns.form.checkbox</class> as this
1297conflicted with dynamic <lit>value</lit> values.</li>
1298</ul>
1299</section>
1300
1301
1302<section><h>Changes in 1.5.1 (released 09/17/2002)</h>
1303<ul>
1304<li>Comparison of attributes with strings has been removed.
1305You have to use <meth>__unicode__</meth> or <meth>__str__</meth>
1306instead.</li>
1307<li>The <class>HTMLParser</class> now removes unknown attributes
1308instead of complaining.</li>
1309<li>There is a new parser class <class>BadEntityParser</class>, which
1310is a &sax;2 parser that recognizes the character entities
1311defined in &html; and tries to pass on unknown or malformed
1312entities to the handler literally.</li>
1313<li>To give all nodes a chance to do something after they have been parsed
1314(e.g. to prepend the base URL for <class>URLAttr</class> nodes), the parser
1315now calls the method <meth>parsed()</meth> immediately after node creation.
1316This is used for the new class <class>StyleAttr</class>, which uses the
1317<class>CSSTokenizer</class>, to prepend the base url to all urls found in
1318a style attribute.</li>
1319<li>The <class>HTMLParser</class> now removes unknown attributes
1320instead of complaining.</li>
1321<li>There is a new parser class <class>BadEntityParser</class>, which
1322is a &sax;2 parser that recognizes the character entities
1323defined in &html; and tries to pass on unknown or malformed
1324entities to the handler literally.</li>
1325<li>To give all nodes a chance to do something after they have been parsed
1326(e.g. to prepend the base &url; for <class>URLAttr</class> nodes), the parser
1327now calls the method <meth>parsed</meth> immediately after node creation.
1328This is used for the new class <class>StyleAttr</class>, which uses the
1329<class>CSSTokenizer</class>, to prepend to base &url; to all &url;s
1330found in a style attribute.</li>
1331</ul>
1332</section>
1333
1334
1335<section><h>Changes in 1.4.3 (released 04/29/2002)</h>
1336<ul>
1337<li>New namespace module <mod>xist.ns.struts_config11</mod>
1338allows to parse and modify <a href="http://jakarta.apache.org/struts/">Struts</a>
1339configuration files conforming to the
1340<a href="http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">Struts 1.1 DTD</a>.
1341</li>
1342</ul>
1343</section>
1344
1345
1346<section><h>Changes in 1.4.2 (released 03/22/2002)</h>
1347<ul>
1348<li>Updated <filename>xscmake.py</filename> to be compatible with the new
1349<mod>url</mod> module.</li>
1350<li><class>xist.ns.jsp.directive_page</class> now automatically sets the
1351<lit>contentType</lit> on publishing.</li>
1352</ul>
1353</section>
1354
1355
1356<section><h>Changes in 1.4.1 (released 03/21/2002)</h>
1357<ul>
1358<li>Removed <class>TidyURLInputSource</class>. Now it's possible
1359to pass a <lit>tidy</lit> flag to the remaining functions <func>parseString</func>,
1360<func>parseFile</func> and <func>parseURL</func> to specify whether
1361the source should be tidied.</li>
1362<li>To prevent an element from being registered in a <class>Namespace</class>
1363the class attribute <lit>register</lit> can be used now. This makes
1364it possible to have a name for the element even when it's not registered.</li>
1365<li><mod>xist.ns.form</mod> elements now have all the attributes that the
1366corresponding elements from <mod>xist.ns.html</mod> have.</li>
1367<li>Removed the old <mod>xist.url</mod> from the Windows distribution.</li>
1368</ul>
1369</section>
1370
1371
1372<section><h>Changes in 1.4 (released 03/18/2002)</h>
1373<ul>
1374<li>Reimplemented &url; handling again. Now the new global
1375module <mod>url</mod> is used for that.</li>
1376</ul>
1377</section>
1378
1379
1380<section><h>Changes in 1.3.1 (released 03/14/2002)</h>
1381<ul>
1382<li>Added a method <meth>pretty</meth> to <class>Node</class>
1383for generating a pretty printable version of the node.</li>
1384<li><lit>xsc.Node.name</lit> no longer is a class method, but a
1385class attribute, that will be set at class instantiation time
1386by the meta class.</li>
1387</ul>
1388</section>
1389
1390
1391<section><h>Changes in 1.3 (released 02/12/2002)</h>
1392<ul>
1393<li>Ported to Python 2.2. <class>Node</class> is now derived from
1394<class>object</class>, <class>Frag</class> from <class>list</class> and
1395there's a new class <class>Attrs</class> which is derived from
1396<class>dict</class> for the attribute mappings. All presenters
1397have been adapted to work with <class>Attrs</class>.
1398In addition to the usual dictionary methods and operators <class>Attrs</class>
1399has a method <meth>without</meth> that returns a copy of the
1400<class>Attrs</class> instance with some specified attributes removed.</li>
1401<li>All the node classes now have a new method <meth>walk</meth> that generates
1402all nodes in the tree using the new generator feature of Python 2.2.</li>
1403<li>Also a new method <meth>walkPath</meth> has been added that works the
1404same as <meth>walk</meth> but yields the complete path to each node
1405as a list.</li>
1406<li>Added a class <class>block</class> to <mod>xist.ns.jsp</mod>.
1407The content of the <class>block</class> instance will simply be enclosed
1408in a <lit>{}</lit> block. <mod>xist.ns.php</mod> got such
1409a class too.</li>
1410<li>Added a new module <mod>xist.ns.ihtml</mod> for
1411i-mode &html;.</li>
1412<li>Added new modules <mod>xist.ns.css</mod> and
1413<mod>xist.ns.cssspecials</mod> for generating &css;.</li>
1414<li>Now the various attributes of the <class>Converter</class> object
1415are collected in a <class>ConverterState</class> object and it's possible
1416to push and pop those states, i.e. it's now easy to temporarily modify a
1417converter object during a <meth>convert</meth> call and revert back
1418to a previous state afterwards.</li>
1419<li><func>parseURL</func> and <func>parseTidyURL</func>
1420now have an additional parameter <lit>headers</lit> which is a list of
1421string pairs specifying additional headers to be passed in with the
1422request.</li>
1423<li><func>parseString</func> has an additional parameter
1424<lit>systemId</lit> which will be the system id of the
1425<class>InputSource</class>.</li>
1426<li>The distribution now includes the makefile and the &xml;
1427source files so now the distribution can rebuild ifself.</li>
1428<li>Various other small bugfixes and enhancements.</li>
1429</ul>
1430</section>
1431
1432
1433<section><h>Changes in 1.2.5 (released 12/03/2001)</h>
1434<ul>
1435<li>Added a new element <class>contentscripttype</class> to
1436<mod>xist.ns.meta</mod> that generates a
1437<lit>&lt;meta http-equiv="Content-Script-Type" ...&gt;</lit>
1438element.</li>
1439<li><func>xist.ns.doc.explain</func> now generates anchor elements
1440for the class, function and method description, so now the
1441links on the &xist; webpages work.</li>
1442<li>Docstrings and documentation has been reworked. Now
1443<class>xist.ns.doc.pyref</class> no longer implies a font change.
1444Use the classes <class>xist.ns.doc.module</class>, <class>xist.ns.doc.class</class>,
1445<class>xist.ns.doc.method</class>, <class>xist.ns.doc.function</class> and
1446<class>xist.ns.doc.arg</class> to mark up your Python identifiers.</li>
1447<li>Added the attributes <lit>type</lit> and <lit>key</lit>
1448to <class>xist.ns.struts_config.data_source</class>.</li>
1449</ul>
1450</section>
1451
1452
1453<section><h>Changes in 1.2.4 (released 11/23/2001)</h>
1454<ul>
1455<li>Added the deprecated attributes <lit>start</lit> to
1456<class>xist.ns.html.ol</class> and <lit>value</lit> to
1457<class>xist.ns.html.li</class>.</li>
1458</ul>
1459</section>
1460
1461
1462<section><h>Changes in 1.2.3 (released 11/22/2001)</h>
1463<ul>
1464<li>Added missing <meth>asPlainString</meth> methods to
1465<class>Comment</class> and <class>DocType</class>.</li>
1466</ul>
1467</section>
1468
1469
1470<section><h>Changes in 1.2.2 (released 11/16/2001)</h>
1471<ul>
1472<li><meth>xist.url.URL.fileSize</meth> and <meth>xist.url.URL.imageSize</meth>
1473now use the warning framework to report errors.</li>
1474<li>There is a new presenter named <class>CodePresenter</class> that dumps the
1475tree as Python source code.</li>
1476<li>The filenames of the pixel images used by <class>xist.ns.specials.pixel</class>
1477have changed. These images are now included.</li>
1478</ul>
1479</section>
1480
1481
1482<section><h>Changes in 1.2.1 (released 10/08/2001)</h>
1483<ul>
1484<li>URLs that are completely dynamic will now be left in peace when parsing
1485or publishing.</li>
1486</ul>
1487</section>
1488
1489
1490<section><h>Changes in 1.2 (released 10/03/2001)</h>
1491<ul>
1492<li><p><class>xist.ns.meta.keywords</class>
1493and <class>xist.ns.meta.description</class>
1494no longer call <meth>asPlainString</meth>
1495on their content. This makes it possible to e.g. generate the keywords via &jsp;:</p>
1496<example>
1497<prog>
1498&gt;&gt;&gt; from xist import parsers
1499&gt;&gt;&gt; from xist.ns import meta, jsp
1500&gt;&gt;&gt; s = '&lt;keywords&gt;' + \
1501...     '&lt;?jsp:expression "foo"?&gt;' + \
1502...     '&lt;/keywords&gt;'
1503&gt;&gt;&gt; e = parsers.parseString(s)
1504&gt;&gt;&gt; print e.conv().asBytes()
1505&lt;meta name="keywords" content="&lt;%= "foo" %&gt;" /&gt;
1506</prog>
1507</example>
1508</li>
1509<li>When an element occurs inside an attribute during publishing, there
1510won't be an exception raised any more. Instead the content of the element
1511will be published. This fixes problems with abbreviation entities inside
1512attributes.</li>
1513<li><class>xist.parsers.TidyURLInputSource</class> now uses the new
1514experimental eGenix mx Extension package, which includes a Python
1515port of <app>tidy</app>.</li>
1516<li><meth>__repr__</meth> now uses the new class <class>presenters.PlainPresenter</class>
1517which gives a little more info than the default <meth>__repr__</meth>.</li>
1518<li>URL handling has been changed again. Upto now, <class>URLAttr</class> had
1519an additional instance attribute <lit>base</lit>, which was the <z>base</z> file/URL
1520from which the attribute was parsed. Now the base URL will be directly incorporated
1521into the URL. You can pass the base URL to all the parsing functions. Similar to
1522that when publishing you can specify a base URL. All URLs in the tree will be
1523output relative to this base URL. Joining URLs is now done via <meth>__div__</meth>
1524and no longer via <meth>__add__</meth>. This makes it more consistent with
1525<mod>fileutils</mod>. The plan is to make URLs string like immutable objects
1526and to merge them with <class>fileutils.Filename</class>.</li>
1527<li><class>xist.ns.specials.php</class> has been moved to its own
1528module (<mod>xist.ns.php</mod>). This module provided additional
1529convenience processing instructions (just like <mod>xist.ns.jsp</mod>
1530does).</li>
1531</ul>
1532</section>
1533
1534
1535<section><h>Changes in 1.1.3 (released 09/17/2001)</h>
1536<ul>
1537<li>The global namespace registry now keeps a sequential list of all registered
1538namespaces, which will be used by the parser when searching for names. This
1539gives a predictable search order even without using <class>Namespaces</class>
1540and its <meth>pushNamespace</meth> method: modules imported last will be searched
1541first.</li>
1542<li>Processing instructions are now allowed inside attributes when
1543publishing.</li>
1544<li><mod>xist.ns.docbooklite</mod> has been renamed to <mod>xist.ns.doc</mod>.
1545It can now generate &html; and Docbook output and has improved a lot. The &xist; web pages
1546now use this for automatic documentation generation. The doc example has been removed.</li>
1547<li><class>xist.url.URL</class> now has a new method <meth>info</meth> that returns the headers
1548for the file/URL.</li>
1549<li><class>xist.url.URL</class> now has a methods <meth>fileSize</meth> and <meth>imageSize</meth>
1550too.</li>
1551<li><class>xist.ns.jsp.directive_page</class> now has new attribute <lit>session</lit>.</li>
1552</ul>
1553</section>
1554
1555
1556<section><h>Changes in 1.1.2 (released 08/21/2001)</h>
1557<ul>
1558<li><meth>__repr__</meth> now uses the new class <class>presenters.PlainPresenter</class>
1559which gives a little more info than the default <meth>__repr__</meth>.</li>
1560</ul>
1561</section>
1562
1563
1564<section><h>Changes in 1.1.1 (released 08/01/2001)</h>
1565<ul>
1566<li>Small bugfix in <func>presenters.strProcInst</func></li>
1567<li>fixed <class>xist.ns.struts_html.option</class> to allow content</li>
1568</ul>
1569</section>
1570
1571
1572<section><h>Changes in 1.1 (released 07/19/2001)</h>
1573<ul>
1574<li>Sequences in constructor arguments for <class>Frag</class> and
1575<class>Element</class> are again expanded and it's again possible
1576to pass dictionaries in an <class>Element</class> constructor to
1577specify attributes. As sequences are always unpacked, the method
1578<meth>extend</meth> is gone. This works for <meth>append</meth>
1579and <meth>insert</meth> too.</li>
1580
1581<li><p><class>Node</class> and <class>Frag</class> implement
1582<meth>__mul__</meth> and <meth>__rmul__</meth>, so you can do stuff like:</p>
1583<prog>
1584html.br()*5
1585</prog>
1586<p>This returns a <class>Frag</class> with five times to same node.</p></li>
1587
1588<li><p>Arguments for the converter constructor can be passed to
1589<meth>xist.xsc.Node.conv</meth> now, so it's possible to do stuff like this:</p>
1590<prog>
1591from xist.ns import code
1592print code.Eval("return converter.lang") \
1593    .conv(lang="en").asBytes()
1594</prog>
1595<p>which will print <lit>en</lit>.</p></li>
1596<li>The option <arg>XHTML</arg> for the publishers has been changed
1597to lowercase.</li>
1598<li><class>xist.ns.html.html</class> will automatically generate a
1599<lit>lang</lit> and <lit>xml:lang</lit> attribute when the
1600converter has a language set.</li>
1601</ul>
1602</section>
1603
1604
1605<section><h>Changes in 1.0 (released 06/18/2001)</h>
1606<ul>
1607<li>New module for &wml; 1.3.</li>
1608
1609<li>The publishing interface has changed internally
1610and publishing should be faster now.</li>
1611
1612<li>Publishers now support a new parameter:
1613<arg>usePrefix</arg>, which specifies if namespace prefixes
1614should be output for the element names.</li>
1615
1616<li>Part of the implementation of the publishing
1617stuff has been moved to C, so now you'll need
1618a C compiler to install &xist;.</li>
1619
1620<li>When publishing <lit>"</lit>, it will now only be replaced with
1621<lit>&amp;quot;</lit> inside attributes.</li>
1622
1623<li>All the <meth>asHTML</meth> methods now have an additional argument
1624<arg>converter</arg>. This makes it possible
1625to implement different processing modes or stages
1626for new elements. All currently implemented elements and
1627entities ignore this argument, but pass it on
1628in the call to their childrens' <meth>asHTML</meth> method.
1629As the name <meth>asHTML</meth> no longer makes sense, <meth>asHTML</meth>
1630has been renamed to <meth>convert</meth>.</li>
1631
1632<li>There is now a tool <filename>dtd2xsc.py</filename> in the
1633<filename>scripts</filename> directory that creates
1634a skeleton &xist; module from a &dtd; (this requires <app>xmlproc</app>
1635from the <app>PyXML</app> package).</li>
1636
1637<li>New preliminary module for DocBook 4.12.
1638(Incomplete: <meth>convert</meth> methods and Unicode character
1639entities are missing; any volunteers for implementing 375 classes?)</li>
1640
1641<li>New module <filename>ruby.py</filename> that implements the
1642<a href="http://www.w3.org/TR/ruby/xhtml11-ruby-1.mod">W3C Ruby draft</a>.
1643</li>
1644
1645<li><filename>sql.py</filename> has been removed from &xist;, but is available
1646as a <a href="root:sql/index.html">separate module</a>.</li>
1647
1648<li>The parsing interface has been changed. Parsing is now done
1649with the functions <func>parseFile</func>, <func>parseString</func>,
1650<func>parseURL</func> and <func>parseTidyURL</func> in the module
1651<mod>parsers</mod>. It's now possible to specify which parser should
1652be used for parsing by passing a SAX2 parser instance to any of
1653these functions. &xist; now includes a rudimentary SAX2 driver
1654for <class>sgmlop</class> and a rudimentary &html; parser that
1655emits SAX2 events.</li>
1656
1657<li>The python-quotes example has been updated to work with expat.</li>
1658
1659<li>Added a new example: media.</li>
1660
1661<li>All abbreviation entities have been moved to
1662a new module <filename>abbr.py</filename>.</li>
1663
1664<li>All the modules that provide new elements and entitites
1665have been moved to a subpackage <mod>ns</mod>.</li>
1666
1667<li><class>Frag</class> and <class>Element</class>
1668now have new methods <meth>sorted</meth>,
1669<meth>reversed</meth>, <meth>filtered</meth> and
1670<meth>shuffled</meth> that return sorted, reversed, filtered
1671and shuffled versions of the <class>Frag</class>/<class>Element</class>
1672object.</li>
1673
1674<li>New namespace modules <filename>ns/jsp.py</filename> and
1675<filename>ns/struts_html.py</filename> have been added that allow you to
1676use <a href="http://java.sun.com/products/jsp/">&jsp;</a> and
1677<a href="http://jakarta.apache.org/struts/">Struts</a> tags with &xist;.</li>
1678
1679<li>A new method <meth>asText</meth> was added, that returns
1680the node as a formatted plain &ascii; text (this requires that
1681<app moreinfo="http://w3m.sf.net/">w3m</app>
1682is installed.)</li>
1683
1684<li><filename>make.py</filename> has been renamed to
1685<filename>xscmake.py</filename> and moved to the
1686<dirname>scripts</dirname> directory,
1687it will be installed as a callable script with <lit>python setup.py install_scripts</lit>.</li>
1688
1689<li><filename>xscmake.py</filename> has a new option <option>--files</option>/<option>-f</option>.
1690The argument is a file containing a list of filenames (one
1691name per line) that should be converted.</li>
1692
1693<li><filename>xscmake.py</filename> has a new option <option>-r</option>/<option>--parser</option>
1694for specifying which parser to use. Allowed values are <lit>sgmlop</lit>
1695and <lit>expat</lit>.</li>
1696
1697<li><p><filename>xscmake.py</filename> has a new option <option>-n</option>/<option>--namespace</option>
1698that can be used for appending <class>Namespace</class>
1699objects to the <class>Namespaces</class> object used by <filename>xscmake.py</filename>.</p>
1700<example>
1701<h>Using the --namespace option</h>
1702<prog>
1703xscmake.py -n html -n spam eggs.xsc
1704</prog>
1705</example>
1706<p>With this call the parser will find element classes from the
1707module with the prefix name <lit>spam</lit> before those
1708from <lit>html</lit> and those before anything else.</p></li>
1709
1710<li><class>xist.url.URL</class> no longer has an attribute
1711<lit>ext</lit>. <lit>file</lit> and <lit>ext</lit> are
1712merged.</li>
1713
1714<li>The special treatment of sequences as constructor arguments
1715to <class>Frag</class> and <class>Element</class>
1716has been removed, so &xist; will no longer remove one level of
1717nesting. If you still want that, use a <lit>*</lit> argument.</li>
1718
1719<li><class>Frag</class> and <class>Element</class>
1720now have a new method <meth>mapped</meth>,
1721that recursively maps the nodes through a function. This is like
1722<meth>convert</meth> but via an external function.</li>
1723
1724<li><p>Attribute handling has been improved thanks to a suggestion
1725by Hartmut Goebel: <meth>Element.__getitem__</meth> now
1726always works as long as the attribute name is legal. If the attribute
1727is not set, an empty attribute will be returned. All empty attributes
1728will be considered as being not set and so <meth>hasAttr</meth>
1729returns <lit>0</lit> for them, and <meth>publish</meth> doesn't
1730publish them. This simplifies several very common cases:</p>
1731<ul>
1732<li>Copying an attribute from one element to another works regardless
1733of whether the attribute is set or not;</li>
1734<li>Testing for an attributes presence can now be done much
1735simpler: <lit>if element["attrname"]</lit> instead of
1736<lit>if element.hasAttr("attrname")</lit> (which still
1737works, and should be a little faster);</li>
1738<li><p>When you construct a &dom; tree and the presence or absence
1739of an attribute is tied to a condition, you can construct the attribute
1740in advance and use it afterwards in the tree construction:</p>
1741<prog>
1742if <rep>condition</rep>:
1743    align = "right"
1744else:
1745    align = None
1746node = html.div("spam", align=align)
1747</prog>
1748<p>So, when the <lit><rep>condition</rep></lit> is false,
1749the node will not have the attribute <lit>align</lit> set.</p></li>
1750</ul>
1751</li>
1752<li><p><class>xist.ns.cond.If</class> (and <class>xist.ns.cond.ElIf</class>)
1753can now be used to test for attributes of the converter. I.e. it's possible to
1754write the following &xml;:</p>
1755<prog>
1756&lt;if lang="en"&gt;Title
1757&lt;elif lang="de"&gt;Überschrift
1758&lt;/if&gt;
1759</prog>
1760</li>
1761<li>URL handling has be completely changed and is much, much simpler now.
1762There are no more path markers. To specify an URL that is relative to the
1763current directory use the scheme <lit>root</lit> (e.g. <lit>root:main.css</lit>).</li>
1764</ul>
1765</section>
1766
1767
1768<section><h>Changes in 0.4.7 (released 11/24/2000)</h>
1769<ul>
1770<li>Fixed a bug in the entity handling.</li>
1771
1772<li>Added a few deprecated elements and attributes to
1773the <mod>html</mod> module.</li>
1774
1775<li>Improved the publishing of attributes. Now all attribute
1776values will be published. For boolean attributes no value
1777will be published for <lit>XHTML==0</lit> and the attribute
1778name will be used for <lit>XHTML==1</lit> or <lit>XHTML==2</lit>.</li>
1779
1780<li><meth>Element.compact</meth> now works (better) ;).</li>
1781
1782<li>Incorparated many bug fixes from Hartmut Goebel.</li>
1783
1784<li>Implemented <meth>xsc.Element.copyDefaultAttrs</meth>, which copies
1785unset attributes over from a dictionary (simplifies
1786implementing <class>specials.plaintable</class> and <class>specials.plainbody</class>)</li>
1787
1788<li><meth>providers.Provider.pushNamespace</meth> now handles multiple
1789arguments which may be <class>Namespace</class> objects or modules
1790(in which case, <lit><rep>module</rep>.namespace</lit> will be pushed)</li>
1791
1792<li><meth>providers.Providers.popNamespace</meth> can now pop multiple
1793namespaces at once.</li>
1794
1795<li><class>providers.TidyURIProvider</class> now uses <func>os.popen3</func> for
1796piping the file through tidy, so now there will be
1797no more temporary files. The call to tidy now includes
1798options that hopefully make the output more suited to
1799&xist;.</li>
1800
1801<li>Incorparated a new <filename>url.py</filename> by Hartmut Goebel, that fixes
1802many problem (e.g. optimizing <lit>http://server/foo/bar/../../baz.gif</lit>
1803now works.)</li>
1804
1805<li><filename>make.py</filename> includes a new option <option>--path</option> for
1806adding directories to <lit>sys.path</lit>.</li>
1807</ul>
1808</section>
1809
1810
1811<section><h>Changes in 0.4.6 (released 11/03/2000)</h>
1812<ul>
1813<li>Now uses <class>sgmlop.XMLParser</class> instead of
1814<class>sgmlop.SGMLParser</class>, so case is preserved.</li>
1815
1816<li>Fixed another regression from the URL to string conversion
1817change.</li>
1818</ul>
1819</section>
1820
1821
1822<section><h>Changes in 0.4.5 (released 11/01/2000)</h>
1823<ul>
1824<li>Converting URLs to nodes is now done in <func>ToNode</func>,
1825so <class>URL</class> objects can be used everywhere.</li>
1826
1827<li>Fixed a few bugs in <meth>Text._strtext</meth> and
1828<meth>URLAttr._str</meth>.</li>
1829</ul>
1830</section>
1831
1832
1833<section><h>Changes in 0.4.4 (releases 10/27/2000)</h>
1834<ul>
1835<li>Now testing if characters can be encoded with the
1836specified encoding is done directy. This means, that
1837escaping unencodable characters now works even with
1838exotic encodings (tested with
1839<a href="http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/"><filename>JapaneseCodecs-1.0.1.tar.gz</filename></a>).</li>
1840
1841<li>The <class>URLAttr</class> constructor now can handle a single parameter
1842of the type <class>URL</class>.</li>
1843
1844<li>The URL to string conversion function have changed:
1845<meth>URL.asString</meth> returns the URL with path markers,
1846<meth>URL.asPlainString</meth> returns the URL without path markers.</li>
1847
1848<li>Added the <lit>i18n</lit> attribute to the <class>font</class> element.</li>
1849
1850<li>Fixed the clashes between the class names for the elements
1851and entities <class>sub</class> and <class>sup</class> in <filename>html.py</filename>.</li>
1852
1853<li>Several small enhancements and bug fixes contributed by
1854Hartmut Goebel.</li>
1855</ul>
1856</section>
1857
1858
1859<section><h>Changes in 0.4.3 (released 10/19/2000)</h>
1860<ul>
1861<li>Now processing instruction classes are registered in the
1862same way as elements and entities are.</li>
1863
1864<li>The leaf nodes (<class>Text</class>, <class>Comment</class>,
1865<class>ProcInst</class>) are now considered immutable.
1866This means that their <meth>asHTML</meth> method can
1867simply return <self/>, because now those nodes can be shared between
1868trees. Functionality for manipulation the objects is provided by a mixin
1869class very similar to <class>UserString</class>. All this results
1870in a speedup of about 10% for the python-quotes example.</li>
1871
1872<li>Small optimizations in the <meth>asHTML</meth> methods of <class>Element</class> and
1873<class>Frag</class> optimized away many calls to <meth>append</meth>,
1874<meth>extend</meth> and <meth>ToNode</meth> and result in a speedup
1875of about 30% for the python-quotes example. One consequence of this is
1876that <class>Null</class> objects will no longer be ignored.</li>
1877</ul>
1878</section>
1879
1880
1881<section><h>Changes in 0.4.2 (released 09/24/2000)</h>
1882<ul>
1883<li>New elements <class>keywords</class> and <class>description</class> in
1884<filename>meta.py</filename>.</li>
1885
1886<li>Fixed a bug in <meth>Namespace.register</meth>, now setting <lit>name=None</lit>
1887to prevent an element from being registered works again.</li>
1888</ul>
1889</section>
1890
1891
1892<section><h>Changes in 0.4.1 (released 09/21/2000)</h>
1893<ul>
1894<li>A new module named <filename>meta.py</filename> has been created, that simplifies
1895generating meta tags.</li>
1896
1897<li>Various small bugfixes.</li>
1898</ul>
1899</section>
1900
1901
1902<section><h>Changes in 0.4 (released 09/19/2000)</h>
1903<ul>
1904<li>&xist; now requires at least Python 2.0b1.</li>
1905
1906<li>A new bugfixed version of the <app>sgmlop</app> source is available
1907from the <a href="ftp://ftp.livinglogic.de/pub/livinglogic/xist/">&ftp; site</a>.</li>
1908
1909<li>&xist; now completely supports Unicode. For output any
1910encoding known to Python can be used, so now you
1911can output your &html; in ASCII, Latin-1, UTF-8, UTF-16, ...</li>
1912
1913<li>All publishers have been updated to support Unicode.
1914The publishing interface has been streamlined (<arg>encoding</arg>
1915and <arg>XHTML</arg> parameters are now attributes of the publisher).</li>
1916
1917<li><meth>asString</meth> will now always return a Unicode string. If you
1918want a byte string use <meth>asBytes</meth> instead, where the encoding
1919can be specified as an argument.</li>
1920
1921<li>There an additional publisher class <class>FilePublisher</class>, which can
1922be used for publishing to a file (or anything else that has
1923a <meth>write</meth> and a <meth>writelines</meth> method, and is supported by the stream
1924writer available through <func>codecs.lookup</func>).</li>
1925
1926<li>Element and attribute names are no longer converted to lowercase.
1927If you have an attribute name which clashes with a Python
1928keyword (e.g. <lit>class</lit>) append an underscore (<lit>_</lit>),
1929which will be removed before accessing the attribute. This is the <z>official</z>
1930Python method for handling these cases.</li>
1931
1932<li>Elements and entities are no longer registered one by one. Now
1933you can build <class>Namespace</class> objects which are used for searching
1934and there are <meth>pushNamespace</meth> and <meth>popNamespace</meth>
1935functions in <mod>XSC.xsc</mod>. For more info, see the source.</li>
1936
1937<li>Image size calculation has been removed from <class>html.img</class> and
1938<class>html.input</class>. Use <class>specials.autoimg</class> and
1939<class>specials.autoinput</class> for that.</li>
1940
1941<li><meth>__getitem__</meth>, <meth>__setitem__</meth> and <meth>__delitem</meth>
1942of <class>Frag</class> and <class>Element</class> now accepts a list as an argument.
1943The method will be applied recursively, i.e. <lit>e[[0, 1, "foo", 2]</lit> is the
1944same as <lit>e[0][1]["foo"][2]</lit>.</li>
1945
1946<li>The deprecated module <filename>db.py</filename> no longer exists. Useful functions and elements
1947from <filename>db.py</filename> have been moved to <filename>sql.py</filename> and
1948<filename>form.py</filename> respectively.</li>
1949
1950<li>When using <func>xsc.make</func> the encoding and XHTML parameters to use can now
1951be specified on the command line (e.g. <lit>--encoding utf-8 --xhtml 2</lit>)</li>
1952
1953<li><p>Handling of multiline <markup>&lt;?xsc-eval?&gt;</markup> and <markup>&lt;?xsc-exec?&gt;</markup>
1954has been enhanced, although, &xist; will not be able to guess the correct indentation
1955in all cases. As a workarround simply add a Python comment to the beginning:</p>
1956<prog>
1957&lt;?xsc-exec
1958    for i in xrange(10):
1959        do(i)
1960?&gt;
1961</prog>
1962<p>won't work</p>
1963<prog>
1964&lt;?xsc-exec
1965    #
1966    for i in xrange(10):
1967        do(i)
1968?&gt;
1969</prog>
1970<p>will.</p>
1971</li>
1972
1973<li><p>Make functionality has been moved to <filename>make.py</filename>, as certain modules can't
1974be used as the main script, because reimporting them in processing
1975instructions won't work. Now you can simply call</p>
1976<example>
1977<h>The new make script</h>
1978<prog>make.py --import xist.html --import spam eggs.xsc</prog>
1979</example>
1980</li>
1981
1982<li><p>There is a new module <filename>cond.py</filename>, that contains
1983elements that can be used for conditionals:</p>
1984<prog>
1985&lt;?xsc-exec a=42?&gt;
1986&lt;if cond="a==21"&gt;
1987    &lt;b&gt;foo&lt;/b&gt;
1988&lt;elif cond="a==42"/&gt;
1989    &lt;i&gt;bar&lt;/i&gt;
1990&lt;else/&gt;
1991    baz
1992&lt;/if&gt;
1993</prog>
1994</li>
1995</ul>
1996</section>
1997
1998
1999<section><h>Changes in 0.3.9 (released 08/10/2000)</h>
2000<ul>
2001<li><app>sgmlop</app> will now be found either via <lit>import sgmlop</lit>
2002or via <lit>from xml.parsers import sgmlop</lit>.</li>
2003</ul>
2004</section>
2005
2006
2007<section><h>Changes in 0.3.8 (released 07/14/2000)</h>
2008<ul>
2009<li>Fixed a bug in <meth>URLAttr.publish</meth>, which prevented
2010<class>URLAttr</class> from working at all.</li>
2011</ul>
2012</section>
2013
2014
2015<section><h>Changes in 0.3.7 (released 07/06/2000)</h>
2016<ul>
2017<li>Fixed a bug in <class>html.img</class> and <class>html.input</class>.
2018Now image size calculation works again.</li>
2019</ul>
2020</section>
2021
2022
2023<section><h>Changes in 0.3.6 (released 07/04/2000)</h>
2024<ul>
2025<li>Fixed a bug in <meth>Node._matches</meth>, which resulted in a non working
2026<meth>find</meth>.</li>
2027</ul>
2028</section>
2029
2030
2031<section><h>Changes in 0.3.5 (released 07/02/2000)</h>
2032<ul>
2033<li>The documentation example has been enhanced. Now documenting methods works.</li>
2034
2035<li>When the member <lit>elementname</lit> in the element class is set before calling
2036<func>registerElement</func>, this element name will be used for the element. This
2037allows custom names even when using <func>registerAllElements</func>.</li>
2038
2039<li>Comparison of scheme and server in URLs is done case insensitive
2040(as <a href="http://www.ietf.org/rfc/rfc2068.txt">RFC 2068</a>
2041requires.)</li>
2042
2043<li><p>Image size calculation is now done in <meth>asString</meth> and
2044not in <meth>asHTML</meth>.
2045This allows to write faster code. Old method:</p>
2046<prog>e = html.div(html.img(...),gurk.hurz()).asHTML().asString()</prog>
2047<p>New method</p>
2048<prog>e = html.div(html.img(...),gurk.hurz().asHTML()).asString()</prog></li>
2049
2050<li>Image size calculation is now done for <markup>&lt;input type="image"&gt;</markup>.
2051The <lit>size</lit> attribute is set to the image width.</li>
2052
2053<li><p>Manipulating the path in an &url; is now done via the usual
2054<meth>__setitem__</meth>/<meth>__getitem__</meth> stuff,
2055which keeps the path in a consistent state.</p>
2056<prog>
2057&gt;&gt;&gt; from xist.URL import URL
2058&gt;&gt;&gt; u = URL("/foo/*/../bar/baz.gif")
2059&gt;&gt;&gt; del u[1]
2060&gt;&gt;&gt; u
2061URL(scheme='server', path=['bar'], file='baz', ext='gif')
2062</prog>
2063</li>
2064
2065<li><meth>findNodes</meth> (which has been shortened to <meth>find</meth>)
2066has an additional argument <arg>test</arg>, which can be a test function that will
2067be called when the node passes all other tests.</li>
2068
2069<li><meth>asString</meth> no longer generates a string directly, but uses the new method
2070<meth>publish</meth>, which has an additional argument <arg>publisher</arg>,
2071to which the strings to be output are passed.</li>
2072</ul>
2073</section>
2074
2075
2076<section><h>Changes in 0.3.4 (released 05/31/2000)</h>
2077<ul>
2078<li>Location information is now copied over in <meth>clone</meth>, <meth>asHTML</meth>
2079and <meth>compact</meth> where appropriate, so you know even in the &html; tree
2080where something came from.</li>
2081
2082<li><p><lit>xsc.repransi</lit> can now have three values:</p>
2083<ul>
2084<li><lit>0</lit>: coloring is off</li>
2085<li><lit>1</lit>: coloring is on for a dark background</li>
2086<li><lit>2</lit>: coloring is on for a light background</li>
2087</ul>
2088<p>All <lit>repransi</lit> variables are now arrays with two strings,
2089the first for dark, the second for light.</p></li>
2090</ul>
2091</section>
2092
2093
2094<section><h>Changes in 0.3.3 (released 05/30/2000)</h>
2095<ul>
2096<li>The workaround for the trailing CDATA bug in <app>sgmlop</app> has been removed, so now
2097you'll need a newer version of <app>sgmlop</app> (included in <app>PyXML 0.5.5.1</app>)</li>
2098</ul>
2099</section>
2100
2101
2102<section><h>Changes before 0.3.3</h>
2103<ul>
2104<li>These changes predate written history.</li>
2105</ul>
2106</section>
Note: See TracBrowser for help on using the browser.