[lxml-dev] objectify.deannotate: call to etree.cleanup_namespaces in 2.1beta

jholg at gmx.de jholg at gmx.de
Tue Jul 1 10:48:36 CEST 2008


>  
> > >could we make the call to cleanup_namespaces optional (defaults 
> > > to True) in deannotate()? 
> > 
> > I wasn't entirely sure if it was a good idea when I added it. I guess 
> > it's
> > best to keep it out or make it optional (default False).
> > 
> 
> 
> I'll remove it, then.
> 
> Rationale: lxml does a good job of keeping namespace declarations clean 
> when
> 
> adding elements to a tree anyway, so with objectify's default nsmap 
> namespace
> 
> declarations concerning xsi:type and py:pytype are usually located at the 
> root element
> 
> only.
> 
> Anyone who needs a real clean document can still conveniently call 
> etree.cleanup_namespaces()
> 
> after deannotate().
 Committed to trunk (revision 56199):

 $ svn diff -r55702:56199 src/lxml/lxml.objectify.pyx
Index: src/lxml/lxml.objectify.pyx
===================================================================
--- src/lxml/lxml.objectify.pyx (revision 55702)
+++ src/lxml/lxml.objectify.pyx (revision 56199)
@@ -1752,7 +1752,6 @@
             cetree.delAttributeFromNsName(
                 c_node, _XML_SCHEMA_INSTANCE_NS, "type")
         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
-    etree.cleanup_namespaces(element)
 
 

 ################################################################################ 

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20080701/7a3ba92a/attachment.htm 


More information about the lxml-dev mailing list