求教,怎么用selectSingleNode获得XML的节点啊???
环境:win7 x64 vs2008
HRESULT hr; XMLDocPtr pDoc; hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument30)); if (FAILED(hr)) { AfxMessageBox("无法创建DOMDocument对象,请检查是否安装了MS XML Parser 运行库!"); return; } CString xmlfilePath = "D:\\strings.xml"; pDoc->load((LPCTSTR)xmlfilePath); if(pDoc == NULL) { AfxMessageBox("pDoc is null !!!"); } XMLNodePtr pNode = pDoc->selectSingleNode((LPCTSTR)"???????");//这里问号里该写什么?? if (pNode) { AfxMessageBox("start"); CString CBIname = ""; GetXMLNodeValue(pNode, "@name", CBIname);//获取CString AfxMessageBox(CBIname); } else { AfxMessageBox("pNode is null!!!"); }<?xml version="1.0" encoding="utf-8"?><resources> <string name="hello">hello</string> <string name="world">world</string></resources>