Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: MSXML crashed due to invalide character MSXML crashed due to invalide characterTo: NULL Date: 9/3/2005 4:29:00 PM Hi, I'll definately need some help on this one.
I'm using VS.NET(C++). When using the following code to load xml from a file,
an exception was thrown and complaining about an invalid character.
MSXML2::IXMLDOMDocumentPtr pXMLDom;
HRESULT hr;
CoInitialize(NULL);
hr= pXMLDom.CreateInstance(__uuidof(DOMDocument30));
if (FAILED(hr))
{
printf("Failed to instantiate an XML DOM.\n");
return -1;
}
pXMLDom->async = VARIANT_FALSE; // default - true,
if(pXMLDom->load("problem.xml")!=VARIANT_TRUE)
{
printf("Failed to load problem.xml:\n%s\n",
(LPCSTR)pXMLDom->parseError->Getreason());
return -1;
}
My xml file has this set: encoding="UTF-8", and I'm using MSXML3.dll.
My puzzle is I can open the same xml file with IE without any error. Why is
this inconsistency?
My second problem is, if I load the same xml content from memory directly
into DOM, an exception (0xE0000001) will be thrown and won't propergate to
my C++ try and catch. How can I set it so that I can catch this type of
error using try and catch?
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
