views:

1079

answers:

2

Hi All,

I have somehow managed to break my infopath form :( When I try to open it (both preview mode and design mode) I get the following error: InfoPath cannot open the following form D:\infopath\formname.xsn. The form definition (.xsf) file contains errors.

When I click on more details I get this:

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

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

Line 232, Position 3
</xsf:xDocumentClass>
--^

Is there any way to resolve this? Or is my only option to re-create the form? Thanks in advance for any advice!

+1  A: 

Edit the .xsf file manually and remove any reference to "ruleSet_5" and save. Try to re-open form.

If not remove the container XML node of "ruleSet_5".

I couldn't see how to get to the .xsf file. Jamie answered below though. Thanks very much for your help! :-)
samcooper11
+1  A: 

Yep - seen this a couple times...

You'll need to edit the manifest.xsf. In fact, an InfoPath form is an archive, so rename the .xsn template to .cab, and extract in the normal way. Now edit the manifest.xsf to remove the reference to the keyref on line 232.

Finally, rebuild your form, by right-clicking on the manifest.xsf and selecting design (You may find there are more than one errors - you're only seeing the first one reported back, so you may need to repeat the above for each error). Finally, you'll need to republish.

Jamie Lakritz