Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: MSXML XPATH possibilities

From: "Anthony Jones" <Ant@------------.--->
To: 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.





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent