Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


transformation giving E_FAIL

From: noureensyed@-----.---
To: NULL
Date: 11/4/2005 12:59:00 PM
Hi there,

The following is code and explanation of steps I'm performing leading
upto a transformation. However, my transformation fails and returns an
E_FAIL. Please help!

1. I create an xml and xsl doc and template as follows:
MSXML2::IXMLDOMDocumentPtr  m_xsldoc;
IXSLTemplatePtr	m_pTemplate;
IXSLProcessorPtr     m_pProcessor;

CoInitialize(NULL);
m_xmldoc.CreateInstance(MSXML2::CLSID_DOMDocument40);
m_xsldoc.CreateInstance(CLSID_FreeThreadedDOMDocument40);
m_pTemplate.CreateInstance(CLSID_XSLTemplate40);

2. Load the xml and xsl:
m_xmldoc->load(v);
m_xsldoc->load(_bstr_t(xsl));

3. Load the template and create a processor: (these execute
successfully, as I check the HRESULT returned)
m_pTemplate->putref_stylesheet(m_xsldoc);
m_pProcessor = m_pTemplate->createProcessor();

4. Perform a couple of addParameters:
m_pProcessor->addParameter(_bstr_t(paramName),_variant_t(paramVal),
_bstr_t(""));

5. Give input xml (again, this is successful)
m_pProcessor->put_input(_variant_t((IUnknown*)xml.Interface()));

6. Create output and call a wrapper transform function, that takes in
this output, as follows:
IUnknown* docOutput;
m_xsldoc.Transform(docOutput); //of the form Transform(IUnknown*
&outDoc)

Inside Transform wrapper:
VERIFY(SUCCEEDED(CoCreateInstance( CLSID_DOMDocument40, NULL,
CLSCTX_INPROC_SERVER, IID_IUnknown,
reinterpret_cast<LPVOID*>(&outDoc))));
m_pProcessor->put_output(_variant_t(outDoc));
m_pProcessor->transform();
return TRUE;

This is where the problem happens. I don't go to return true, except
catch an exception which is "E_FAIL".

What am I doing wrong? I really apprecite your help.

Thank you.



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