XML finds all the nodes of a name

xiaoxiao2021-03-17  197

The following code can be done to find the name from an XML file for the function of all nodes of the time of IXMLDOMNodeList * pIDOMNodeList = NULL; IXMLDOMNode * pIDOMNode = NULL; long value; BSTR bstrItemText; HRESULT hr; BSTR tag = SysAllocString (L "time"); HR = PXMLDOC-> getElementsBytagname ((tag, & pidomnodelist); hr = pidomnodelist-> get_length (& value); if (succeeded (hr)) {pidomnodelist-> reset (); for (int II = 0; II get_item (ii, & pIDOMNode); if (pIDOMNode) {pIDOMNode-> get_text (& bstrItemText); :: MessageBox (NULL, bstrItemText, "time", MB_OK); pIDOMNode-> Release (); pIDOMNode = NULL }}} Pidomnodelist-> release (); pidomnodelist = null; sysfreestring (tag);

转载请注明原文地址:https://www.9cbs.com/read-129694.html

New Post(0)