Hi Christoph,

Yes, sorry this is a bug, fixed in the Cascadenik development version (but I 
don't recommed using the dev version yet).

Basically it looks like you are using the latest release via pypi and in that 
version there are several imports at the top of cascadenik/compile.py which 
attempt to allow fallbacks to different xml parsers that implement an etree 
interface.

lxml (python bindings to libxml2) is preferred and it turns out its interface 
is slightly different and while it has doc.write() others may not.

So, the easiest way to fix this issues is to install lxml. On ubuntu I think 
that is:

sudo apt-get install python-lxml

Dane


On Nov 2, 2010, at 2:10 PM, Christoph Lingg | komoot wrote:

> Hi list,
> 
> I recently installed cascadenik on a new server and encountered an error 
> while compiling my mml file. First I thought this might be due a wrong mml 
> file, but even the example given by cascadenik doesn't work:
> 
>> christ...@server:~/mapnik-Cascadenik-796acf2$ cascadenik-compile.py 
>> example.mml > test.xml
>> Traceback (most recent call last):
>>   File "/usr/local/bin/cascadenik-compile.py", line 114, in <module>
>>     sys.exit(main(layersfile, **options.__dict__))
>>   File "/usr/local/bin/cascadenik-compile.py", line 46, in main
>>     doc.write(f)
>> AttributeError: _ElementInterface instance has no attribute 'write'
> 
> 
> I am quite lost and would be very happy if somebody knows more about this 
> issue!
> 
> Thanks a lot in advance!
> Christoph
> 
> PS:
> I am running Ubuntu 10.10 and the content of test.xml looks like:
>> cat test.xml
>> <Element Map at 26c7fc8>
> 
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to