InfoPath - Cannot open, Form definition (.xsf) contains errors

99封情书 提交于 2019-12-22 14:04:33

问题


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:


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.




回答2:


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".




回答3:


I also faced this issue, tried to edit xsf (saved form in local drive, renamed to cab, and extracted in the folder) but there was no reference to error. Another file UpdateItem.xls had the reference to the error, I removed that but after that was not sure how to rebuild the form. Tried to zip the folder again, rename to xsn, but didn't work.

Finally, I figured out that one of the "views" in the form still referenced the deleted data connection. So, if the form has multiple views (Edit, Display, etc.) - Check in Page Design tab, first section in Ribbon - cycle through all the views and check that none of the views has reference to deleted data connection.



来源:https://stackoverflow.com/questions/1363037/infopath-cannot-open-form-definition-xsf-contains-errors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!