Hello i need to know "how to read a part of xml file in C++ using Libxml2". In my xml file I have :
<svg>
<g>
<path d="11"/>
</g>
</svg>
I want to see a value of "d" on my c++ program, when I come to this point :
xmlNode *cur_node = NULL;
for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
if(xmlStrEqual(xmlCharStrdup("path"),cur_node->name)){
printf("element: %s\n", cur_node->name);
}
print_element_names(cur_node->children);
}
}
I dont know what I need to do, please help me.
Below function will read complete xml with node and values,
I'm not sure I understand the question, but it sounds like you want to print the attribute "d" in the element "path". In the code above, you need something like this:
something like that ?