This is a weird one.
Situation:
Going back to a SharePoint 2007 site formerly published with InfoPath 2007. Downloaded the form template and made some changes. When I went to re-publish I encountered an “unsupported expression” error.
The actual long message was as follows.
The following expression could not be parsed because of a syntax error or because it uses an undefined namespace prefix or unsupported function: pc:DisplayName
This appeared to have been coming from one of the people pickers (circa 2007 variety) but copying the Xpath on each of them yielded no easily identifiable pc:DisplayName.
/my:myFields/my:EmployeeManager/my:Person/my:DisplayName
/my:myFields/my:EmployeeGroup/my:TerminatingEmployee/my:Person/my:DisplayName
I went back to the original template with no changes and it didn’t throw the same error during publishing.
I changed the Form type from Web Browser Form (InfoPath 2007) to InfoPath 2007 Filler Form and attempted publishing. The error went away.
So, I changed it back to Web Browser Form (InfoPath 2007) again…the way it originally was. The error stayed away and I published the form.
However, after publishing, the error came back. So I decided to look “under the covers.”
I saved the XSN as source files and looked within all the files. I was able to find where the pc: schema infiltrated my form template. Within view1.xsl I found the offending pc:DisplayName, and all the other related pc: references.
I’m not sure how this made its way into the form template, as I never specifically made this change, nor do I know how one would force this.
</xsl:if>
<param NAME="ButtonFont" VALUE="Verdana,12,0,400,0,0,0"/>
<param NAME="ButtonText" VALUE=""/>
<param NAME="DisplayNameXPath" VALUE="pc:DisplayName"/>
<param NAME="ObjectIdXPath" VALUE="pc:AccountId"/>
<param NAME="ObjectTypeXPath" VALUE="pc:AccountType"/>
<param NAME="SiteUrlXPath" VALUE="/Context/@siteUrl"/>
<param NAME="SiteUrlDataSource" VALUE="Context"/>
<param NAME="NewNodeTemplate" VALUE="<pc:Person xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls"> <pc:DisplayName></pc:DisplayName> <pc:AccountId></pc:AccountId> <pc:AccountType></pc:AccountType> </pc:Person>"/>
<param NAME="BackgroundColor" VALUE="2147483653"/>
<param NAME="MaxLines" VALUE="4"/>
<param NAME="Direction" VALUE="0"/>
I did a simple “find and replace” on all the pc: occurrences with my: and saved and tested my work. All appears to be okay.
Sure would be nice to know how this happens!
0 Responses to “Unsupported Expression in InfoPath 2010”