in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

Extracting Xml from XmlFormView.XmlForm

Last post 11-01-2007 10:52 AM by komo. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-24-2007 10:20 AM

    • arzo2000
    • Top 500 Contributor
    • Joined on 10-24-2007
    • Ontario, Canada

    Extracting Xml from XmlFormView.XmlForm

    Hi all,

    I have been trying to get the Xml string (or OuterXml or whatever you want to call it) from an InfoPath XmlForm object but with no success.

    Is there such a way to do so?

    Thanks in advance.

    Application Developer
    MCTS - MS WSS 3.0 Application Development
    Filed under: , ,
  • 11-01-2007 10:52 AM In reply to

    • komo
    • Not Ranked
    • Joined on 11-01-2007

    Re: Extracting Xml from XmlFormView.XmlForm

    Like this:

     

    System.Xml.XPath.
    XPathNavigator xMain = this.XmlFormView1.XmlForm.MainDataSource.CreateNavigator();

    System.Xml.XmlNamespaceManager xNameSpace = new System.Xml.XmlNamespaceManager(new System.Xml.NameTable());

    xNameSpace.AddNamespace("my", this.XmlFormView1.XmlForm.NamespaceManager.LookupNamespace("my").ToString());System.Xml.XPath.XPathNavigator FieldNavn = xMain.SelectSingleNode("/my:myFields", xNameSpace);

    // System.Xml.XPath.XPathNavigator currentNode = xNavMain.SelectSingleNode("/my:myFields/my:somefield", xNameSpace);

    Label1.Text = FieldNavn.InnerXml;

Page 1 of 1 (2 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.