Question
2008-01-30 20:42:12 GopiGrut
PROBLEM DESCRIPTION
==================
A view in an InfoPath form template has a print footer. That form template is opened and a print header is added to the view. Once the form template is saved and closed, it cannot be reopened. InfoPath displays an error:
ERROR
=======
InfoPath cannot open the form.
The form definition (.xsf) file contains errors.
The form definition (.xsf) file contains elements, attributes, or structures that are not valid.
Error details:
Element '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}header' is unexpected according to content model of parent element '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}printSettings'.
Line 145, Position 17
<xsf:header>
----------------^
O: (Objective)
ENVIRONMENT
===========
Microsoft Office InfoPath 2003 Sp2
A: (Assessment)
RESOLUTION
=============
Unfortunately, this problem is a known bug introduced by a regression in SP1 for InfoPath 2003. In the InfoPath form template’s manifest.xsf file, the “xsf:printSettings” node contains the print settings for a view in the form template. Included in this node are (optionally) an “xsf:header” and “xsf:footer” node which contain the header and footer information for the view, respectively. The “xsf:header” node, if present, must come before the “xsf:footer” node, if present. When the problem occurs, these two nodes have gotten reversed, so the “xsf:header” node follows the “xsf:footer” node. This violates the schema for the manifest file, so InfoPath cannot open the form template.
This problem was detected and corrected in Microsoft Office InfoPath 2007.
To ensure that the problem does not occur, be sure to add the print header for a view before adding the print footer. This ensures the proper order of the nodes in the form’s manifest file. Note that once the footer node has been added to the manifest, it is not removed, so it is not sufficient to remove the footer from the form before adding a header.
If a form template view already has a footer, or if an existing form template has already become corrupted by this problem, it will be necessary to edit the form template manifest manually to correct the problem. An InfoPath form template (.XSN) is just a special CAB file, and it can be opened and extracted using common tools like WinZip. Therefore, use these steps to correct the problem in an existing form:
1) Make a backup copy of the form template just in case you make a mistake editing the form template so you don’t lose your work.
2) Open the form template in WinZip and extract all the files into a folder.
3) Open the “manifest.xsf” file in a text editor like Notepad. (In very rare cases, the file may not be named “manifest.xsf”, but it will have a “.xsf” file extension. There will only be one such file in a form template.)
4) Find the “xsf:printSettings” node in the manifest file.
a. To remove an existing footer so a header can be added, delete the “xsf:footer” node (everything from <xsf:footer> to </xsf:footer> inclusive) inside the “xsf:printSettings” node.
b. To repair existing corruption, move the “xsf:header” node (everything from <xsf:header> to </xsf:header> inclusive) inside the “xsf:printSettings” node so that it comes immediately before the “xsf:footer” node (everything from <xsf:footer> to </xsf:footer> inclusive).