开发者

MSXML2: How can I get value of a node?

I have this node

MSXML2::IXMLDOMNodePtr node;    

node->Getxml() returns "<level3>333<level4 atribute="444"><level5>555<level6>666</level6></level5></level4></level3>"

node->Gettext(); return开发者_如何学Pythons "333555666"

node->GetnodeValue() throws exception if node is not an attribute.

How can I get the value 333 ???


You have to walk the children of the node you have in hand - you can get a list using childNodes after checking the node has children of course, then you can use Gettext() to extract the individual element texts.

It's quite painful to code to the MSXML DOM, in my experience. Glad to see you are using the built-in smart pointers, anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜