Improving performance of XML manipulation - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Improving performance of XML manipulation

Last post 06-02-2012 09:15 AM by TerryB. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-01-2012 09:30 PM

    Improving performance of XML manipulation

    I have an InfoPath form that pulls some records from a database and displays them on the form. This is all done in code behind. The way I populate the nodes is to use the .NET StringBuilder object to construct the XML string, which may contain 20 or so base nodes, and each of those containing their own elements/nodes. The entire tree averages a couple of hundred elements/nodes in total.

    After building the string, I use XPATHNavigator.AppendChild() to insert the nodes into my form. Problem is InfoPath's node parsing performance is terrible. A typical time taken for each part is around about:

    - Connect to Database and retreive data set: 30ms
    - Use StringBuilder to construct XML nodes: 0ms (Too fast to measure)
    - Calling XPATHNavigator.AppendChild(): 4000ms

    Now it shouldn't be taking this long, so I'm wondering if you guys know any techniques to create nodes in the form faster. I assumed that building the XML string manually and then calling AppendChild() only once would speed things up, but apparently it has not.
  • 06-02-2012 09:15 AM In reply to

    Re: Improving performance of XML manipulation

    I'm not sure if this will help, but have you checked out XDocument.View.DisableAutoUpdate() and XDocument.View.EnableAutoUpdate(). If you disable before you compose all your nodes etc. and the enable after this might improve performance.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.