Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: transformation giving E_FAIL transformation giving E_FAILTo: 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. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
