I'm keep getting the following error when i try to preview my infopath form
InfoPath cannot open the selected form because of an error in the form's code.
The attribute 'http://www.w3.org/XML/1998/namespace}lang' on the element 'http://namespace}InfoPathRoot' is not defined in the DTD/Schema.InfoPathRoot is the root element of the schema.
To avoid this issue, i added the "anyAttribute" to my schema definition
<xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>I was hoping that with anyAttribute and processContents=skip, the infopath form would not attempt to find
or validate the lang attribute in the InfoPathRoot element. However, once i've added this, i get the following error
InfoPath cannot open the selected form because of an error in the form's code.
A floating attribute may not be passed as the context node for an XSLT transform or an XPath query.The form has managed code attached to it(C# , Visual Studio 2005 and Infopath 2003)
An interesting observation is that if the same schema is imported into an infopath form that does not have any code behind it, then the first (lang) error does not occur and the form can be previewed successfully
Is there something that i'm missing?
I thank you in advance
-Tanveer Rashid