Phlip, 07.01.2010 17:44:
On Jan 7, 5:36 am, Stefan Behnel <stefan...@behnel.de> wrote:

Well, then note that there are tons of ways to generate XML with Python,
including the one I pointed you to.

        from lxml.html import builder as E
        xml = E.foo()

All I want is "<foo/>", but I get "AttributeError: 'module' object has
no attribute 'foo'".

A peek at dir(E) shows it only has HTML tags, all hard coded.

Note how you imported 'E' from a package called 'lxml.html'. The last part of that package name gives a hint on what it specialises in.


So how to get it to generate any random XML tag my clients think of?

Have you thought of taking a look at the tutorial?

http://codespeak.net/lxml/tutorial.html#the-e-factory

Stefan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to