469,581 Members | 1,839 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,581 developers. It's quick & easy.

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 3600


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 suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.