in reply to Re^4: XML-Twig - AS5.6.1 vs AS 5.8.8
in thread XML-Twig - AS5.6.1 vs AS 5.8.8

I think that is a bug. Every element remembers whether or not its parent has been previously flushed, and if it hasn't, then it prints the parent tag first. On the first "Aging", it thinks the Root hasn't been flushed yet, even though it really has because of the twig_print_outside_roots, so it doesn't need to print the root tag, but flushing "Aging" goes ahead and prints the root tag anyway. This is probably one for mirod to fix (Update: I'm not sure anymore if it is a bug...I don't think it is...use print instead of flush).

As a workaround hack, putting this right before the flush works (for now, probably at least until the module is fixed, so this is not really recommended as a permanent solution):

# (update: ignore this code) $balance->parent->_set_flushed;

Update: Instead of $balance->flush(\*OUTFILE) you should just $balance->print(\*OUTFILE).