Showing posts with label The form definition (.xsf) file contains elements. Show all posts
Showing posts with label The form definition (.xsf) file contains elements. Show all posts

Jun 2, 2008

InfoPath 2007 Be aware of Its traps

I worked on an ordinary form for my customer in Infopath 2007. I updated the data source connection (Web Service) by saving the changes and closed the form, so infopath will be updated with the changes.
When I tried to open my form I get the next Error :

The form definition (.xsf) file contains elements, attributes, or structures that are not valid.

Error details:
The keyref 'RepeatingData_15' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}xmlToEdit_name_key'.

Line 689, Position 5

----^

It took me one hour but I managed to reopen my form.
I solve it by:

  • extracting the XSN file ( just change the xsn to cab, it's a regularly cab file)
  • deleted any keref in the manifest.xsf file. (each time I reopen the form and get the same error but different keyref)
Infopath saves a temp refs in the form which after a while becomes junk that avoiding you to work on your form.
I suggest to save the form for each change and reopen it after the save.

I know it's sounds not so good but it's better than seating for a hour and editing xsf file by hand.