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 4:05:00 PM
<guillaume.bardy@g...> wrote in message
news:1154612832.207657.322810@b......
> 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 ?
>
What does your XML look like? One thing I ran into when switching to later
CLSIDs for MSXML is that some XML files suddenly failed to parse
(validateOnParse doesn't help if the XML isn't well formed). It turned out
that some files had white space preceeding the <?xml declare which was
ignored by older CLSIDs but using the more uptodate ones caused an error.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
