473,583 Members | 2,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IXMLDOMDocument

Hi! As i'm new this XML and DOMDocument, can someone help me in casting DOMDocument schema into XMLDocument and assign the value. below attached is the piece of code which uses MSXML2 with a Thirdparty API.
MyDoc is a Document created using Thirdparty API.
MyDoc.get_XML returns the DOCDocument Schema of the Template for the id passed.
When i tried to cast the DoMDocument into XMLDocument getting error message
"Specified cast is not valid"

KOCLIENTLib.Dat aEntryTemplate myTemplate = myKovis.DataEnt ryTemplates[templateId];
KOCLIENTLib.Doc ument myDoc = myTemplate.Crea teDocument();
MSXML2.IXMLDOMD ocument myXML = myDoc.get_xml() ;
XmlDocument myNewDoc = (XmlDocument)my XML;
myDoc.set_xml(( MSXML2.IXMLDOMD ocument) myNewDoc);

Thanks
Chander

From http://www.developmentnow.com/g/49_2...dotnet-xml.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Aug 15 '06 #1
1 3810


chander wrote:
Hi! As i'm new this XML and DOMDocument, can someone help me in casting DOMDocument schema into XMLDocument and assign the value. below attached is the piece of code which uses MSXML2 with a Thirdparty API.
MyDoc is a Document created using Thirdparty API.
MyDoc.get_XML returns the DOCDocument Schema of the Template for the id passed.
When i tried to cast the DoMDocument into XMLDocument getting error message
"Specified cast is not valid"

KOCLIENTLib.Dat aEntryTemplate myTemplate = myKovis.DataEnt ryTemplates[templateId];
KOCLIENTLib.Doc ument myDoc = myTemplate.Crea teDocument();
MSXML2.IXMLDOMD ocument myXML = myDoc.get_xml() ;
XmlDocument myNewDoc = (XmlDocument)my XML;
myDoc.set_xml(( MSXML2.IXMLDOMD ocument) myNewDoc);
I am not sure what you are trying to do but the .NET framework XML DOM
implementation in System.Xml with XmlDocument, XmlNode and so on is
completely independent of and different from the COM based MSXML DOM
implementation.
Microsoft does not support using MSXML with the .NET framework
<http://support.microso ft.com/kb/815112/en-us>
I think you have to decide, either use .NET's XML classes or use MSXML.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
428
by: Alexandra | last post by:
Hi, I am trying to parse an XML file using DOM in VC++. I need an element which is inside other elements. So I am loading the file.
1
4216
by: Leo | last post by:
I'm going from VS 6.0 to VS .NET 2003. I'm converting a project and can't get it to compile. I've created a small Win32 console app that reproduces the compiler error. This has got to be something dumb. Please help. #import <msxml.dll> int _tmain(int argc, _TCHAR* argv) { IXMLDOMDocumentPtr Xml; Xml->createElement(_T("Tagname"));
2
2157
by: Joe | last post by:
Dear All, Can anyone help me with these two questions? Thank you. I am using MSXML 4.0 SP2 and VC++ .NET.
1
3789
by: lucho | last post by:
Hi everyone, I have the same problem as described under Q316317 (http://support.microsoft.com/default.aspx?scid=kb;en- us;316317) ie a compiler error saying c:\Program Files\Microsoft Visual Studio .NET\Vc7 \PlatformSDK\Include\ShObjIdl.h(9528) : error C2872: 'IXMLDOMDocument' : ambiguous symbol could be 'c:\Program Files\Microsoft Visual...
3
2269
by: Polaris | last post by:
Hi Experts: Is there a way to load an existing buffer (an XML file) using IXMLDOMDocumentPtr->load()? I know it works for loading an XML file, but I need to load an existing buffer with known length. Thanks In Advance! Polaris
6
5142
by: Sigmathaar | last post by:
Hi, I'm having some trouble while debuging some code. My compiler says the code is OK but whenever I try to execute the program nothing happens. Using my debuger I got the next message : Detected memory leaks! Dumping objects -> {56} normal block at 0x02EA5DF8, 6 bytes long. Data: <U> 50 75 65 62 6C 61 {55} normal block at 0x02EA5DB0, 7...
0
1818
by: Sathya | last post by:
Hi, I have a vb.net webservice which takes XMLDocument as a parameter and returns bool. Signature of the method is some thing like this AddXmlEmpDetails(xmlEmp as XMLDocument) as Boolean. I am able to call this method from vb.net desktop client and add a record to the database(this I used to test if there is any problem in the...
0
1273
by: alvin | last post by:
Dear friends, I am new to vc++ .net programing. Please anyone help me to solve my issue Following is my code: /***********************************************************************************/ CComPtr<IXMLDOMDocumentdoc; HRESULT r = doc.CoCreateInstance(CComBSTR("MSXML2.FreeThreadedDOMDocument.4.0"));
1
3926
by: sree83 | last post by:
Hi All, I am new to MSXML. Now i have am facing a strange problem while loading xml file using c++. I have a C++ library which is used to parse an xml having server configurations.. We have managed C++ bridge to this assembly, for our .NET modules. I have a .Net client which tries to get server details from configuration files..but while...
0
7811
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8314
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7922
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.