root/livinglogic.python.xist/NEWS.rst @ 3191:7008feab3db9

Revision 3191:7008feab3db9, 72.6 KB (checked in by Walter Doerwald <walter@…>, 12 years ago)

Document fix.

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