Click here to Skip to main content
Rate this: bad
good
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 22:37pm
pykos560
Edited 27-Jan-13 4:17am
(no name)35.5K
v3
Comments
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 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web03 | 2.8.141220.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