InfoPath xml (manifest.xsf) editing with code

When you are extracting an InfoPath file you will get many diffent files, one of them is the manifest.xsf file. I had to modify the manifest.xsf file with C# code and change some values inside the xml.
For this task I used the XmlDocument class from .NET. After I saved the modified file and repacked all InfoPath files back to an .xsn file with the CabPacker tool I recognized that the file can not be opened by InfoPath.
It showed an error about invalid xml. After some reasearch I figured out that the new manifest.xsf looks different that the original one.
Here is an screenshot of the different files (left side: old; right side: new):
image
As you can see on the right side the XmlDocument class adds a line break before the end tag.

You can disable this by setting “PreserveWhiteSpace” to true.
image

Now it should work.


Posted Feb 18 2016, 05:53 PM by Holger Vetter
Filed under: ,

Comments

Damir Dobric wrote re: InfoPath xml (manifest.xsf) editing with code
on 02-19-2016 23:01

Cool. Thanks

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
developers.de is a .Net Community Blog powered by daenet GmbH.