Parse a version information xml and print it using c++ libxml
Here is the input I get.
<record name="Version">
<field name="major" value="03 "/>
<field name="minor" value="01 "/>
<field name="micro" value="00 "/>
<field name="patch" value="05 "/>
</record>
need to print it like "Version: 03.01.00.05"
MgmtXml::dumpXmlNode(
recordNodePtr,
str);
//with above statement, I get the xml file into "str" in same format
every-time
doc = xmlParseMemory(str.c_str(), str.length());
cur = xmlDocGetRootElement(doc);
v = xmlGetProp(cur, (const xmlChar *)"name");
printf("\n%s:\n", v); //here it prints Version:
// don't know how to print the rest, which is 03.01.00.05
Thanks!
No comments:
Post a Comment