| 2158 | |
| 2159 | |
| 2160 | void XMLPrinter::CloseElement( bool compactMode ) |
| 2161 | { |
| 2162 | --_depth; |
| 2163 | const char* name = _stack.Pop(); |
| 2164 | |
| 2165 | if ( _elementJustOpened ) { |
| 2166 | Print( "/>" ); |
| 2167 | } |
| 2168 | else { |
| 2169 | if ( _textDepth < 0 && !compactMode) { |
| 2170 | Print( "\n" ); |
| 2171 | PrintSpace( _depth ); |
| 2172 | } |
| 2173 | Print( "</%s>", name ); |
| 2174 | } |
| 2175 | |
| 2176 | if ( _textDepth == _depth ) { |
| 2177 | _textDepth = -1; |
| 2178 | } |
| 2179 | if ( _depth == 0 && !compactMode) { |
| 2180 | Print( "\n" ); |
| 2181 | } |
| 2182 | _elementJustOpened = false; |
| 2183 | } |
| 2184 | |
| 2185 | |
| 2186 | void XMLPrinter::SealElementIfJustOpened() |