Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: MSXML XPATH possibilities >Thread Next - Re: MSXML XPATH possibilities Re: MSXML XPATH possibilitiesTo: NULL Date: 8/3/2006 6:47:00 AM
I still have a problem : because now i can't load my xml document
anymore in using IXMLDOMDOCUMENT2. I guessed it was because there was a
validation during the loading so I tried to set the property
ValidateOnParse to false but it still doesn't work...
Here is my code before the loading thingy (I use the AfxMessageBox to
Debug coz i'm working on a PocketPC and the iSafety stuff seems to be a
bug fix for PocketPcs).
This code is OK for IXMLDocument (except i had
iXMLDoc.CoCreateInstance(__uuidof(DOMDocument)); and not this stuff) :
VARIANT vXMLSrc;
vXMLSrc.vt = VT_BSTR;
vXMLSrc.bstrVal=::SysAllocString(L"\\FichierDonneesCE07.xml");
HRESULT hr = ::CoInitializeEx( NULL , COINIT_MULTITHREADED );
CComPtr<IXMLDOMDocument2> iXMLDoc;
CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument2,
(void**)&iXMLDoc);
CComQIPtr< IObjectSafety, &IID_IObjectSafety>iSafety(iXMLDoc);
if (iSafety)
{
DWORD dwSupported, dwEnabled;
iSafety->GetInterfaceSafetyOptions(IID_IXMLDOMDocument2,
&dwSupported,&dwEnabled);
iSafety->SetInterfaceSafetyOptions(IID_IXMLDOMDocument2,
dwSupported,0);
}
VARIANT_BOOL bSuccess=false;
CString a ("1");
AfxMessageBox(a);
VARIANT pasValider;
pasValider.boolVal = false;
iXMLDoc->setProperty(_T("ValidateOnParse"),pasValider);
hr=iXMLDoc->load(vXMLSrc,&bSuccess);
CString b ("2");
AfxMessageBox(b);
//iXMLDoc->setProperty(_T("SelectionLanguage"),xpat);
CString c ("3");
AfxMessageBox(c);
SysFreeString(vXMLSrc.bstrVal);
Does anyone see the problem ?
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
