[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Usage of transformNodeToObject using MSXML4.0, VC+

Subject: RE: Usage of transformNodeToObject using MSXML4.0, VC++, MFC (Automation)
From: Nirmala R <nirmala.r@xxxxxxxxxx>
Date: Fri, 18 Oct 2002 10:19:52 +0530
transformnodetoobject
Hello,

I could solve the problem.
It was because the out xml created after applying the xsl for the input xml
was not a well-formed xml document. (There was no root element). Since
for transformNodeToObject, am giving a DOMDoucment object pointer as the
resultant output, the transformed result could not make a proper resultant
DOMDocument and an exception was thrown.

Thanks & Regards,
Nirmala


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Nirmala R
Sent: Thursday, October 17, 2002 9:00 AM
To: Xsl-List
Subject:  Usage of transformNodeToObject using MSXML4.0, VC++, MFC
(Automation)


Hello,

I have a problem in using transformNodeToObject using MSXML4.0.
 I have a VC++ MFC application in which msxml4.dll has been included using
OLE Automation (as a type library).
This creates the wrapper files msxml4.h and .cpp files.
Here, I have a sample.xml file and a corresponding sample.xsl file. I want
to create a new DOM Document using the above API by performing
transformNodeToObject. Here the code goes:

// Load the source XML Doc
IXMLDOMDocument aXMLDoc;
aXMLDoc.CreateDispatch("Msxml2.DOMDocument.4.0");
aXMLDoc.load(COleVariant("c:\\sample.xml"));

// Load the XSL Document
IXMLDOMDocument aXSLDoc;
aXSLDoc.CreateDispatch("Msxml2.DOMDocument.4.0");
aXSLDoc.load(COleVariant("c:\\sortsample.xsl"));

// Create an empty Result DOM Document
IXMLDOMDocument aXMLResDoc;
aXMLResDoc.CreateDispatch("Msxml2.DOMDocument.4.0");
VARIANT aVar;
memset(&aVar, 0, sizeof(aVar));
aVar.vt = VT_DISPATCH;
aVar.pdispVal = aXMLResDoc.m_lpDispatch;
aXMLDoc.transformNodeToObject(aXSLDoc.m_lpDispatch,
				aVar);

COleVariant aDest("c:\\out.xml");
aXMLResDoc.save(aDest);

aXMLResDoc.DetachDispatch();
aXSLDoc.DetachDispatch();
aXMLDoc.DetachDispatch();

Here, looks like the way I am passing the output VARIANT DOMDocument object
is not proper. I am getting an exception in transformNodeToObject. The API
wrapper created using the above automation  for transformNodeToObject is
IXMLDOMDoucment::transformNodeToObject(LPDISPATCH stylesheet,
                                    const VARIANT &outputobject);
Can you please tell me how should i pass the resultant DOMDocument object as
a VARIANT for this function?
I am stuckup with this problem and not able to proceed further.

Thanks in advance,
Nirmala


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.