root/livinglogic.python.xist/NEWS.xml @ 2590:7b6bba35f3a0

Revision 2590:7b6bba35f3a0, 75.9 KB (checked in by Walter Doerwald <walter@…>, 13 years ago)

htmlspecials.pixel() now no longer uses colored pixels, instead color is
done via CSS. The URL for the one remaining transparent pixel can now be
specified via src (either as an XML attribute or via the converter context).

Rename attrs methods with() and without() to withnames() and withoutnames()
(for Python 2.5 compatibility).

Use elinks instead of w3m for asText() and move/rename this method to a
function ll.xist.ns.html.astext().

Try to make XIST independent from PyXML (however PyXML is still required
for parsing via expat and for dtd2xsc.py (because this requires xmlproc)).

Remove the long dperecated method withSep().

Use Py_ssize_t in the C source where appropriate.

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