Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Cannot use xpath in this document [Thread Next] Re: Cannot use xpath in this documentTo: NULL Date: 12/28/2008 8:47:00 AM "rimo" <rimo@n...> wrote in message
news:15BF6891-1D77-437E-B986-B39AEFB0D605@m......
> xml document: http://blog.163.com/desc/rsd.xml
>
> my code:
> CComPtr<IXMLDOMDocument> m_spXMLDoc;
> VARIANT_BOOL vb;
> HRESULT hr=m_spXMLDoc->load(CComVariant(m_url),&vb);
> CComPtr<IXMLDOMNodeList> spNodeList;
> CString m_xpath=L"/rsd";
> m_spXMLDoc->selectNodes(CComBSTR(m_xpath),&spNodeList);//err, cannot find!
> long len;
> spNodeList->get_length(&len);
> if (spNodeList!=NULL&&len>0){
> ...
> }
>
>
You need to set the DOM async property to false. By default its true which
will mean the Load function will return immediately but will not yet have
loaded the DOM.
--
Anthony Jones - MVP ASP/ASP.NET
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
