Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
Hello, recently I've developed a web service that, when users enter specific info on a website, it calls the web-service which then loads a from template (that is published on a sharepoint lib) from the disc (I extracted the template.xml from the xsn file), then it populates the fields in the form based on user input, and uploads the form to a form library, all done programaticly. This is now working but I'm not satisfied with the process, or I think it can be done more elegantly.
What I would like to do, is to programaticly get the template.xml from the sharepoint library(when ever the form is updated i need to replace the old xml with the new one), now there are ways of doing this using external extractors wich I cannot use. Is there a fucntion or a .net library that does this or is there a better way of doing this, couse Im not shure if this is the best approach.
BTW I can get to the xsn file in the library.
using (SPSite site = new SPSite(siteUrl)
    site.AllowUnsafeUpdates = true;
    using (SPWeb currWeb = site.OpenWeb())
        list = currWeb.Lists[libraryName];
        SPXmlDocumentCollection collection = ContentTypes[formName].XmlDocuments;
        //do something with template
Thanks for your answers!
Posted 9-Jan-13 21:37pm
Edited 27-Jan-13 3:17am
AnandSharmaUK at 28-Mar-13 5:47am
I would use XPathNavigator objects while dealing with .xsn files

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Gihan Liyanage 332
1 Sergey Alexandrovich Kryukov 265
2 ClimerChinna 222
3 vikinghunter 188
4 OriginalGriff 161
0 Sergey Alexandrovich Kryukov 8,363
1 OriginalGriff 7,112
2 CPallini 2,598
3 Richard MacCutchan 2,025
4 Abhinav S 1,788

Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100