1
我有这样的XML:XML命名空间,不能选择节点
<?xml version="1.0" encoding="utf-8" ?>
<ArrayOfFileInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/"> <Data> ......
当我在XML离开"xmlns="http://tempuri.org/"
,下面不返回任何节点:
CString tag = L"//Data";
MSXML2::IXMLDOMNodeListPtr pDataTag = pXMLDocument->selectNodes((_bstr_t)tag);
当我删除了属性,但一切工作正常。
你能帮我吗?
致谢的XPath的属性,多数民众赞成它。 – lalelu 2014-10-28 12:58:03
@lalelu如果这个答案解决了你的问题,那么请[**接受它作为答案**](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)。谢谢! – 2014-10-28 22:19:17