| 72 | namespace mdf { |
| 73 | |
| 74 | void ExpatXml::StartElement(const XML_Char *fullname, |
| 75 | const XML_Char **attributes) { |
| 76 | std::unique_ptr<XmlNode> p = std::make_unique<XmlNode>(fullname); |
| 77 | p->SetAttribute(attributes); |
| 78 | auto *current = node_stack_.empty() ? nullptr : node_stack_.top(); |
| 79 | node_stack_.push(p.get()); |
| 80 | if (!root_node_) { |
| 81 | root_node_ = std::move(p); |
| 82 | } else if (current != nullptr) { |
| 83 | current->AddNode(std::move(p)); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void ExpatXml::EndElement(const XML_Char *) { |
| 88 | if (!node_stack_.empty()) { |
no test coverage detected