using getAttribute

wxdqz

New Member
Hi,I program in C++, use MSXML/DOM and try to access the age attribute in thefollowing XML fragment:<book><writer age="54">some writer</writer></book>requirement:I want to use getAttribute() which is much easier than using the get_attributes()method which returns a NamedNodeMap, which I would then have to query usinggetNamedItem, which returns a node (of type attribute) of which I can getthe node value.problem:the getAttribute is a method of the IXMLDOMElement interface, and that interfaceseems to be available on the root element only. In other words, once I startnavigating to the <writer> element, I end up with an interface of type Node,on which I can not use getAttribute.Am I missing something? Can anyone show me the code to simply access thisattribute?Joop
 
Back
Top