| 1993 | |
| 1994 | |
| 1995 | void XMLPrinter::CloseElement( bool compactMode ) { |
| 1996 | --_depth; |
| 1997 | const char* name = _stack.Pop(); |
| 1998 | |
| 1999 | if ( _elementJustOpened ) { |
| 2000 | Print( "/>" ); |
| 2001 | } else { |
| 2002 | if ( _textDepth < 0 && !compactMode) { |
| 2003 | Print( "\n" ); |
| 2004 | PrintSpace( _depth ); |
| 2005 | } |
| 2006 | Print( "</%s>", name ); |
| 2007 | } |
| 2008 | |
| 2009 | if ( _textDepth == _depth ) { |
| 2010 | _textDepth = -1; |
| 2011 | } |
| 2012 | if ( _depth == 0 && !compactMode) { |
| 2013 | Print( "\n" ); |
| 2014 | } |
| 2015 | _elementJustOpened = false; |
| 2016 | } |
| 2017 | |
| 2018 | |
| 2019 | void XMLPrinter::SealElementIfJustOpened() { |