Simple question to get attribute of IXMLDOMNode in using MSXML
-
Hi, I am using MSXML::IXMLDOMNode::baseName to get the name of the node. i.e., the name of the following node is "modem". 15400979 5 Does someone know how to get the attribute of this node, i.e. "1.6"? Thanks!
-
Hi, I am using MSXML::IXMLDOMNode::baseName to get the name of the node. i.e., the name of the following node is "modem". 15400979 5 Does someone know how to get the attribute of this node, i.e. "1.6"? Thanks!
The node "modem" has several child nodes. One of which is the attribute node called "ID" as well as child element nodes called Number and Interval. You also has child text nodes that contain your formating text. Given that pNode is the pointer to your "modem" node. // Get Attributes IXMLDOMNamedNodeMap *AtMap; hr = pNode->get_attributes(&AtMap); long atpos,atlen; hr = AtMap->get_length(&atlen); IXMLDOMNode *item; for(atpos=0;atposget_item(atpos,&item); hr = item->get_baseName(&txt); name = txt; hr = item->get_text(&txt); data = txt; } The above code will step through all of the attribute nodes and give you their base name and text value. "I will find a new sig someday."