root/livinglogic.python.xist/NEWS.xml @ 2698:9fc346354b5c

Revision 2698:9fc346354b5c, 78.5 KB (checked in by Walter Doerwald <walter@…>, 13 years ago)

Note that updatenow() and updateexisting() are gone.

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