0

我创建了一个工作流来创建任务并使用自定义信息路径表单批准该任务。单击“批准/拒绝”按钮时,任务表单会引发 XML 异常,如下所示

“日期”是一个意外的标记,预期的标记是“=”。

下面我列出了异常的堆栈跟踪,


Server Error in '/' Application.

'Date' is an unexpected token. The expected token is '='. Line 1, position 22.

 Description: An unhandled exception occurred during the execution of the current web request.

Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details:
System.Xml.XmlException: 'Date' is an unexpected token. The expected token is '='. Line 1, position 22. 
Source Error:  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:  [XmlException: 'Date' is an unexpected token. The expected token is '='. Line 1, position 22.]   

System.Xml.XmlTextReaderImpl.Throw(Exception e) +95   
System.Xml.XmlTextReaderImpl.ParseAttributes() +5089862   
System.Xml.XmlTextReaderImpl.ParseElement() +378   
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +429   
System.Xml.XmlReader.MoveToContent() +22   
       Microsoft.SharePoint.Workflow.SPWorkflowTask.GetExtendedPropertiesAsHashtable(SPListItem task) +289   
Microsoft.SharePoint.Workflow.SPWorkflowTask.SetWorkflowData(SPListItem task, Hashtable newValues, Boolean ignoreReadOnly) +471   
Microsoft.SharePoint.Workflow.SPWorkflowTask.AlterTask(SPListItem task, Hashtable htData, Boolean fSynchronous) +110   
Microsoft.Office.Workflow.WrkTaskIPPage.XmlFormControl_OnClose(Object sender, EventArgs e) +700   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.CloseDocument(EventLogStart eventLogStart) +113   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.PlayServerMessages(EventLogStart eventLogStart) +192   
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.OnDataBindHelper() +428
Microsoft.Office.InfoPath.Server.Controls.XmlFormView.OnDataBinding(EventArgse) +97
System.Web.UI.WebControls.WebParts.Part.DataBind() +42   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
System.Web.UI.Control.DataBindChildren() +11046927   
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182   
Microsoft.Office.Workflow.WrkTaskIPPage.OnLoad(EventArgs ea) +3270   
System.Web.UI.Control.LoadRecursive() +66   
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
4

1 回答 1

4

试试这个可能有用...

您必须在任务创建属性中具有扩展属性声明。只需在可用空间中添加x0020即可。代码可能看起来像

SPTaskCreate_TaskProperties.ExtendedProperties["Start_x0020_Date"] = DateTime.Now;

并不是

SPTaskCreate_TaskProperties.ExtendedProperties["Start Date"] = DateTime.Now;
于 2012-11-19T14:55:25.600 回答