IXMLDOMDocument

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chander

    #1

    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
    DevelopmentNow is an award-winning creative software development agency integrating mobile, web, hardware, mixed reality, and emerging technology.

  • Martin Honnen

    #2
    Re: IXMLDOMDocument



    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/

    Comment

    Working...