Metadata-Version: 1.1
Name: lxml-wrapper
Version: 0.3.2
Summary: lxml wrapper that simplifies xml generation code.
Home-page: http://github.com/matee911/lxml-wrapper
Author: Mateusz `matee` Pawlik
Author-email: matee@matee.net
License: BSD
Download-URL: http://download.github.com/matee911-lxml-wrapper-a4e9572.zip
Description: 
        This wrapper simplifies your Python xml generation code.
        
        Example XML:
        
        <root attrib="10">
        text
        <child attrib="">
        childtext
        </child>
        tail
        </root>
        
        New way:
        
        E('root', attrib=10).add(
        'text',
        E('child', attrib=None).add(
        'childtext'),
        'tail')
        
        Old way:
        
        root = Element('root', attrib=str(10)) # cast to str
        root.text = 'text'
        child = SubElement(root, 'child', attrib=value or "") # change None to empty string
        child.text = 'childtext'
        child.tail = 'tail'
        
        
        Now with .add_if and .add_for methods:
        
        E('root').add_if(1==1, E('child')) -> <root><child /></root>
        
        E('root').add_if(1==0, E('child')) -> <root/>
        
        E('root').add_for([1,2], lambda item: E('item', attr=item)) -> <root><item attr="1"/><item attr="2"/></root>
        
        
Keywords: lxml wrapper dsl
Platform: Any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Requires: lxml
