Casting from XmlDocument to XDocument - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Casting from XmlDocument to XDocument

Last post 11-20-2010 06:48 AM by mstaples709. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-19-2010 10:40 AM

    Casting from XmlDocument to XDocument

    Hello,

    I am developing an InfoPath 2003 template with C# code behind and am trying to cast from System.Xml.XmlDocument() to Microsoft.Office.Interop.InfoPath.Semitrust.XDocument().  So far, I have had no luck finding any examples of how to do this.  I believe someone wrote a post about casting to System.Xml.Linq.XDocument(), but unfortunately this does not seem to work for the InfoPath XDocument().  If you need a code snippet, let me know.

    Thanks in advance!

  • 11-19-2010 05:15 PM In reply to

    Re: Casting from XmlDocument to XDocument

    What is it you are trying to accomplish, specifically?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-20-2010 06:48 AM In reply to

    Re: Casting from XmlDocument to XDocument

    Hi Jimmy,

    I am trying to use the replaceChild method, so need to pass it 2 IXMLDOMNode parameters (newChild, oldChild).  The nodes from the XmlDocument would be the newChild and the existing nodes in the XDocument (i.e. thisXDocument) are the oldChild.  So, really, I need a way to get at the XmlDocument nodes and cast them to an IXMLDOMNode, but I assume that I need to go through an XDocument first.  I have done this in InfoPath 2007 and it was much easier, but of course IP 2003's object model is very different.

    Let me know if you need further details.

    Thanks!

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.