transformNode fails on documents that work fine with IE9

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am using VS2008 and C++ in order to create HTML from XML and XSLT.
Some files can be transformed successfully, while others do fail, though they work fine with IE9.<br/>
When calling transformNode I see half a dozen exceptions in the output window and the function fails:
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.<br/>
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.<br/>
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.<br/>
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.<br/>
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.<br/>
<span style="font-size:x-small First-chance exception at 0x7577b9bc in HMI_Office.exe: 0xE0000001: 0xe0000001.
Basically my code looks like this (test code!):
<span style="font-size:x-small
IXMLDOMDocument3* pxmldXMLDoc = NULL;<br/>
IXMLDOMDocument3* pxmldXSLDoc = NULL;
HRESULT hr = ::CoCreateInstance(<br/>
CLSID_DOMDocument60,<br/>
NULL,<br/>
CLSCTX_INPROC_SERVER,<br/>
IID_IXMLDOMDocument3,<br/>
(vo<span style="color:#0000ff; font-size:x-small <span style="color:#0000ff; font-size:x-small id<span style="font-size:x-small **)&pxmldXMLDoc
);

<span style="font-size:x-small pxmldXMLDoc->put_async( VARIANT_TRUE );<br/>
pxmldXMLDoc->put_validateOnParse( VARIANT_TRUE );<br/>
<span style="font-size:x-small pxmldXMLDoc->put_resolveExternals( VARIANT_TRUE );<br/>
VARIANT_BOOL varLoaded;<br/>
CComVariant varXmlFile = wstrReportXmlFileSpec;<br/>
pxmldXMLDoc->load( varXmlFile, &varLoaded );
<span style="font-size:x-small
hr = ::CoCreateInstance(<br/>
CLSID_DOMDocument60,<br/>
NULL,<br/>
CLSCTX_INPROC_SERVER,<br/>
IID_IXMLDOMDocument3,<br/>
(<span style="color:#0000ff; font-size:x-small <span style="color:#0000ff; font-size:x-small void<span style="font-size:x-small **)&pxmldXSLDoc
);

<span style="font-size:x-small pxmldXSLDoc->put_async( VARIANT_TRUE );<br/>
pxmldXSLDoc->put_validateOnParse( VARIANT_TRUE );<br/>
pxmldXSLDoc->put_resolveExternals( VARIANT_TRUE );<br/>
CComVariant varXslFile = wstrXslFileSpec;<br/>
hr = pxmldXSLDoc->load( varXslFile, &varLoaded );
<span style="font-size:x-small
CComBSTR bstrText;<br/>
hr = pxmldXMLDoc->transformNode( pxmldXSLDoc, &bstrText );

The files which can be transformed successfully are pretty simple; those which fail do contain bitmaps and svgs. Older versions of IE and also Firefox cannot display them properly either. This most likely is the reason why my code fails.
Now my questions are:
1) Is there a way to get more information about the errors which occur during transformation?<br/>
2) Is there an engine equivalent to the one used by IE9, which I can use in my software?
thanks a lot
Hansjoerg



View the full article
 
Back
Top