MFC对XML的操作

1.项目中添加

  #inport "MSXML4.dll"

  using namespace MSXML2;

2.可以使用如下代码进行节点、属性等的添加 

  MSXML2::IXMLDOMDocumentPtr pDoc = NULL; //XML文档
  MSXML2::IXMLDOMProcessingInstructionPtr pProInstruction = NULL; //XML申明
  MSXML2::IXMLDOMCommentPtr pComment = NULL; //注释
  MSXML2::IXMLDOMElementPtr pRootElement/*根节点*/ = NULL, pElement /*元素*/= NULL;
  MSXML2::IXMLDOMNodePtr pNode = NULL, pNode1 = NULL, pNode2 = NULL; //节点
  MSXML2::IXMLDOMAttributePtr pAttriNode = NULL; //属性

posted @ 2016-08-11 20:09  Zohar  阅读(590)  评论(0编辑  收藏  举报