* Bryan Tong Minh <[email protected]> [Mon, 29 Mar 2010 10:57:49 +0200]: > On Mon, Mar 29, 2010 at 7:54 AM, Dmitriy Sintsov <[email protected]> > wrote: > > Calls has to be short so the code won't grew too much. > I disagree. Readability counts and you only have to write a certain > code once, but you will read it many times. Therefore a clear, but > longer function call is preferable if it is more readable than a short > one. > Bryan, sorry for going a bit offtopic (although my question is also related to generation of output). Why XML class does not allow to close _arbitrary_set_ of opened tags automatically (not a rendering of DOM-like trees, but at least a mere list of opened XML tags in a stack). There is a method SpecialAllpages::namespaceForm() with uses multiple Xml::openElement() then multiple Xml::closeElement() in "reverse order" before to return. Eg. right now I am making customization of Special:Allpages. I've added some more tag nesting to that method. Why one should not implement XML::startStack(), XML::OpenElement('table'), XML::OpenElement('div') and so on and at the end simply one XML::flushStack() call instead of set of XML::closeElement() (which are simply the manual "stack pop outs") ? Such way ::closeElement() would be much less often required to call manually in reverse order, and XML::flushStack() is called once and fixed - no matter how many XML::OpenElement() calls you made. Dmitriy
_______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
