Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: MSXML crashed due to invalide character

From: "Julian F. Reschke" <julian.reschke@-----------------.-->
To: NULL
Date: 9/4/2005 11:58:00 AM
Chris wrote:
> 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.

Then the file probably contains byte sequences that aren't legal UTF-8. 
Can you post an example?

> My puzzle is I can open the same xml file with IE without any error. Why is 
> this inconsistency? 

If you have all service packs applied, IE should display a warning in 
the status bar. In doubt, simply verify with a different parser.

> 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?

Best regards, Julian


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