Go to the documentation of this file.
10 #include <pugixml.hpp>
19 xml_document rootNode;
20 xml_node GCMDKeywordsNode;
23 if ((dataRoot = getenv(
"OCDATAROOT")) ==
NULL) {
24 printf(
"-E- OCDATAROOT environment variable is not defined.\n");
27 string GCMDKeywordsXMLFileName = (
string) dataRoot +
"/common/GCMDKeywords.xml";
29 xml_parse_result xmlResult = rootNode.load_file(GCMDKeywordsXMLFileName.c_str());
36 printf(
"-E- %s Line %d: Can not load %s. %s\n", __FILE__, __LINE__,
37 GCMDKeywordsXMLFileName.c_str(), xmlResult.description());
41 GCMDKeywordsNode = rootNode.child(
"GCMDKeywords");
42 if (!GCMDKeywordsNode) {
43 printf(
"-E- %s Line %d: could not find GCMDKeywords tag in XML file = %s\n",
44 __FILE__, __LINE__, GCMDKeywordsXMLFileName.c_str());
49 xml_node suiteNode = GCMDKeywordsNode.find_child_by_attribute(
"suite",
"name", suite);
53 xml_node keywordNode = suiteNode.child(
"keyword");
62 keyStr += keywordNode.child_value();
63 keywordNode = keywordNode.next_sibling(
"keyword");
69 return keyStr.c_str();
const char * getGCMDKeywords(const char *suite)