Tuesday 29 September 2009

How to keep infopath form in source control

Microsoft infopath form saved with .xsn extension. This is a binary format. If you add a xsn file to source control, you will have record of different version of the form, but you won't be getting the change details.

This can be solved easily by doing it little bit differently. xsn files are basically cab file. And it contains lots of xml, xsd, image and other files. The good thing is Infopath provides a option to save files in its source form, i.e. instead of one big xsn(cab) file, you can save all internal files separately in one location. In that case most of those files are text file. And source control will be able to track all changes in the file.
Save As Source Files option available in the File menu as shown in the image.
And it looks like the image in right.
number of files and types depends on the content of the form. It will always have a manifest file(xsf). Right Click on the manifest file and choose design to open the form in design mode.
There will be xsd files for every data connection/data types. There will be one xsl files for each view, and all images displayed in the form etc.

This makes version controlling worthwhile. Doing this you can merge between branches meaningfully.

One last thing whenever this form is published it will be published as .xsn file in its publish location.

No comments:

Post a Comment