| 2502 | |
| 2503 | |
| 2504 | void XMLPrinter::OpenElement(const char* name, bool compactMode) |
| 2505 | { |
| 2506 | SealElementIfJustOpened(); |
| 2507 | _stack.Push(name); |
| 2508 | |
| 2509 | if (_textDepth < 0 && !_firstElement && !compactMode) { |
| 2510 | Print("\n"); |
| 2511 | } |
| 2512 | if (!compactMode) { |
| 2513 | PrintSpace(_depth); |
| 2514 | } |
| 2515 | |
| 2516 | Print("<%s", name); |
| 2517 | _elementJustOpened = true; |
| 2518 | _firstElement = false; |
| 2519 | ++_depth; |
| 2520 | } |
| 2521 | |
| 2522 | |
| 2523 | void XMLPrinter::PushAttribute(const char* name, const char* value) |