34 string s1(R
"(<?xml version="1.0"?> 35 <simulation></simulation> 45 REQUIRE((
char*)root->name ==
string(
"simulation"));
49 REQUIRE(root_name ==
"simulation");
54 string s1(R
"(<?xml version="1.0"?> 55 <simulation name="qmc"> aa </simulation> 72 REQUIRE(attr_string_missing.empty());
77 string s1(R
"(<?xml version="1.0"?> 82 <item4>4.0 5.1</item4> 83 <item5>4.0 5.1,</item5> 94 xmlNodePtr item = xmlFirstElementChild(root);
95 REQUIRE(
string((
char*)item->name) ==
"item1");
100 item = xmlNextElementSibling(item);
101 REQUIRE(
string((
char*)item->name) ==
"item2");
107 CHECK(c == Approx(3.5));
110 item = xmlNextElementSibling(item);
111 REQUIRE(
string((
char*)item->name) ==
"item3");
115 item = xmlNextElementSibling(item);
116 REQUIRE(
string((
char*)item->name) ==
"item4");
121 item = xmlNextElementSibling(item);
122 REQUIRE(
string((
char*)item->name) ==
"item5");
143 const char* content = R
"( 145 <parameter name="p1">1</parameter> class that handles xmlDoc
TEST_CASE("read_file", "[xml]")
xmlXPathContextPtr getXPathContext()
void newDoc(const std::string &rootName)
class to handle xmlXPathObject
REQUIRE(std::filesystem::exists(filename))
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
bool putContent(T &a, xmlNodePtr cur)
replaces a's value with the first "element" in the "string" returned by XMLNodeString{cur}.
convert xmlNode contents into a std::string
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void addChild(xmlNodePtr newnode)
bool parse(const std::string &fname)
std::string getNodeName(xmlNodePtr cur)
void dump(const std::string &newxml)