-----------------------------------------------------------------------------
| 454 | } |
| 455 | //----------------------------------------------------------------------------- |
| 456 | std::string XDMFFile::read_information(const std::string& name, |
| 457 | const std::string& xpath) |
| 458 | { |
| 459 | pugi::xml_node node = _xml_doc->select_node(xpath.c_str()).node(); |
| 460 | if (!node) |
| 461 | throw std::runtime_error("XML node '" + xpath + "' not found."); |
| 462 | pugi::xml_node info_node |
| 463 | = node.select_node(("Information[@Name='" + name + "']").c_str()).node(); |
| 464 | if (!info_node) |
| 465 | throw std::runtime_error("<Information> with name '" + name |
| 466 | + "' not found."); |
| 467 | |
| 468 | // Read data and trim any leading/trailing whitespace |
| 469 | std::string value_str = info_node.attribute("Value").as_string(); |
| 470 | return value_str; |
| 471 | } |
| 472 | //----------------------------------------------------------------------------- |
| 473 | void XDMFFile::flush() |
| 474 | { |