472,119 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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.DataEntryTemplate myTemplate = myKovis.DataEntryTemplates[templateId];
KOCLIENTLib.Document myDoc = myTemplate.CreateDocument();
MSXML2.IXMLDOMDocument myXML = myDoc.get_xml();
XmlDocument myNewDoc = (XmlDocument)myXML;
myDoc.set_xml((MSXML2.IXMLDOMDocument) 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 3698


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.DataEntryTemplate myTemplate = myKovis.DataEntryTemplates[templateId];
KOCLIENTLib.Document myDoc = myTemplate.CreateDocument();
MSXML2.IXMLDOMDocument myXML = myDoc.get_xml();
XmlDocument myNewDoc = (XmlDocument)myXML;
myDoc.set_xml((MSXML2.IXMLDOMDocument) 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.microsoft.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Joe | last post: by
6 posts views Thread by Sigmathaar | last post: by
reply views Thread by leo001 | last post: by

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.