| 260 | } |
| 261 | |
| 262 | void Document::Expat::start_element_handler(void* data, const XML_Char* name, const XML_Char** atts) |
| 263 | { |
| 264 | Document* doc = static_cast<Document*>(data); |
| 265 | |
| 266 | if (!doc->root) |
| 267 | { |
| 268 | doc->root = new Node(name, atts); |
| 269 | } |
| 270 | else |
| 271 | { |
| 272 | Node::Children* cld = &(doc->root->children); |
| 273 | |
| 274 | for (int i = 1; i < doc->m_depth; ++i) |
| 275 | { |
| 276 | cld = &(cld->back().children); |
| 277 | } |
| 278 | cld->push_back(Node(name, atts)); |
| 279 | |
| 280 | } |
| 281 | doc->m_depth++; |
| 282 | } |
| 283 | |
| 284 | void Document::Expat::character_data_handler(void* data, const XML_Char* chars, int len) |
| 285 | { |