0

I am trying to read node values and do some arithmetic calculations. This <xmin>174</xmin> is the line and I want to read 174 and do some arithmetic calculations e.g. using as an integer. The code below is created for string format. I tired get_nodeValue, get_attributes instead of get_text but I could not display the number. I got some unrelevant numbers, I guess they indicate the address.

IXMLDOMNode *pNode = NULL;
BSTR name = NULL;
BSTR NpdeName = NULL;
CHK_HR(pNode->get_nodeName(&bstrNodeName));
printf("Node (%d), <%S>:\n", i, bstrNodeName);
CHK_HR(pNode->get_text(&name));
printf("\t%S\n", name);

The codes below I already tried.

IXMLDOMNamedNodeMap *attribute;
CHK_HR(pNode->get_attributes(&attribute));
printf("\t%d\n", attribute);

AND

VARIANT value;
CHK_HR(pNode->get_nodeValue(&value));
printf("\t%d\n", value);

Thanks in advance...

garnettburak
  • 143
  • 1
  • 9
  • This can maybe help? I usually used those XPath expressions while selecting the value of concrete node: http://stackoverflow.com/questions/5415788/read-write-xml-file-in-c/9007771#9007771 – LihO Jan 29 '14 at 23:08
  • I converted `BSTR name` into `int` by using `int value = _wtoi(name)`. This works fine. – garnettburak Jan 30 '14 at 03:57

0 Answers0