[lxml-dev] conditional pretty_print

Hi, In short: While printing, 1. Ignore *all* attributes(keys()) of every element. 2. Ignore *certain* attributes(keys()) of every element. 3. Ignore *certain* attributes(keys()) of element with *tag* <string>. Prashant Python 2.6.2 lxml 2.2.4 The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

Prashant Saxena, 23.01.2010 19:01:
In short:
Too short, I guess.
While printing,
1. Ignore *all* attributes(keys()) of every element. 2. Ignore *certain* attributes(keys()) of every element. 3. Ignore *certain* attributes(keys()) of element with *tag* <string>.
If the above is intended to describe a custom serialisation scheme, I assume you want to use this scheme to serialise an XML tree, right? Two ways to do that: 1) strip all unwanted information from the tree before serialising 2) roll your own serialiser (IIRC, the ElementTree docs mention this somewhere) Which way is better for you is mostly dependent on whether you want an opt-in or opt-out solution, I guess. Stefan
participants (2)
-
Prashant Saxena
-
Stefan Behnel