XIST 0.4 - an XML based extensible HTML generator

Walter Dörwald walter@bnbt.de
Tue, 19 Sep 2000 11:17:09 GMT

Hi all!

XIST 0.4 is released!

What is it?

XIST is an XML based extensible HTML generator.
Some of the significant features of XIST include:

   * Easily extensible with new XML elements
   * Can be used for offline or online page generation
   * Allows embedding Python code in XML files
   * Works together with httpdapy/mod_python/PyWX
   * Simplifies handling of deeply nested directory trees
   * Automatically generates HEIGHT and WIDTH attributes for images

It was written as a replacement for the HTML preprocessor HSC
(http://www.giga.or.at/~agi/hsc/), and borrows some features and
ideas from it.

It also borrows the basic ideas (XML/HTML elements as Python objects)
from HTMLgen or HyperText.

What's new?

XIST now requires at least Python 2.0b1.

A new bugfixed version of the sgmlop source is available
from the FTP site.

XIST now completely supports Unicode. For output any
encoding known to Python can be used, so now you
can output your HTML in ascii, latin1, utf8, utf16,
and even shift_jis if you have the codec installed.

All publishers have been updated to support Unicode.
The publishing interface has been streamlined (encoding
and XHTML parameters are now attributes of the publisher)

asString() will now always return a Unicode string. If you
want a byte string use asBytes() instead, where the encoding
can be specified as an argument.

There an additional publisher class FilePublisher, which can
be used for publishing to a file (or anything else that has
a write and a writelines method, and is supported by the stream
writer available through codecs.lookup).

Element and attribute names are no longer converted to lowercase.
If you have an attribute name which clashes with a Python
keyword (e.g. "class") append an underscore (_), which will be
removed before accessing the attribute. This is the "official"
Python method for handling these cases.

Elements and entities are no longer registered one by one. Now
you can build Namespace objects which are used for searching
and there are pushNamespace and popNamespace functions in XSC.xsc.
For more info, see the source.

Image size calculation has been removed from html.img and html.input.
Use specials.autoimg and specials.autoinput for that.

{Frag,Element}.__{set,get,del}item__ now accepts a list as an argument.
The method will be applied recursively, i.e. e[[0, 1, "foo", 2] is the
same as e[0][1]["foo"][2].

The deprecated module db no longer exists. Useful functions and elements
from db have been moved to sql.py and form.py respectively.

When using xsc.make() the encoding and XHTML parameters to use can now
be specified on the command line (e.g. --encoding utf-8 --xhtml 2)

Handling of multiline <?xsc-eval?> and <?xsc-exec?> has been enhanced,
although XIST will not be able to guess the correct indentation in all
cases. As a workaround simply add a Python comment at the beginning:
    for i in xrange(10):
won't work
    for i in xrange(10):

Make functionality has been moved to make.py, as certain modules
can't be used as the main script, because reimporting them in processing
instructions won't work. Now you can simply call
python make.py --import xist.html --import project.main foo.xsc

There is a new module cond, that contains elements that can be used for
<?xsc-exec a=42?>
<if cond="a==21">
<elif cond="a==42"/>

Where can I get it?

XIST is available from ftp://titan.bnbt.de/pub/livinglogic/xist/.
Direct questions regarding XIST to walter@livinglogic.de.

<p><a href="ftp://titan.bnbt.de/pub/livinglogic/xist/">XIST 0.4</a> -
an XML based extensible HTML generator. (19-Sep-2000)

    Walter Dörwald

Sent via Deja.com http://www.deja.com/
Before you buy.