Click here to Skip to main content
12,509,728 members (47,458 online)
Rate this:
 
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!
B
Posted 9-Jan-13 21:37pm
pykos669
Updated 27-Jan-13 3:17am
Joezer BH38.7K
v3
Comments
AnandSharmaUK 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2016
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