我有一个xml数据,我正在使用xsl样式表转换为形成邮件正文的内容,我使用SPUtility.SendEmail方法发送邮件。我有两个链接,一个用于查看infopath表单,另一个用于批准/拒绝任务表单。 infopath表单链接在我的邮件中正常工作,但不能在另一个邮件中正常工作。我在Outlook Web客户端中收到“url因安全而被阻止”错误。
<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
<xsl:attribute name="href">
<xsl:text>http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&ID=</xsl:text>
<xsl:value-of
select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>
<xsl:text>&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&WorkflowInstanceID=</xsl:text>
<xsl:value-of
select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>
</xsl:attribute>
Approve/Reject
</a>
输出格式化链接
<a
title="Approve/Reject"
style="color:#b94e0a;text-decoration:underline;"
href="http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&ID=35&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&WorkflowInstanceID=11e09c76-29ec-4c7f-ace3-ad7a8c9e7b44">
Approve/Reject
</a>
当我在浏览器中复制并粘贴网址时,我会收到提示“出现意外错误”的提示,然后我用&amp;替换&
在浏览器中,我正确地打开了表单。
这是outlook的任何解析问题,但是&
的另一个链接对我有用吗?
答案 0 :(得分:0)
尝试将disable-output-escaping添加到xsl:text元素:
<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
<xsl:attribute name="href">
<xsl:text disable-output-escaping="yes">http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&ID=</xsl:text>
<xsl:value-of
select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&WorkflowInstanceID=</xsl:text>
<xsl:value-of
select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>
</xsl:attribute>
Approve/Reject
</a>
或尝试取消使用xsl:text元素:
<a title="Approve/Reject" style="color:#b94e0a;text-decoration:underline;">
<xsl:attribute name="href">
http:/stage/_layouts/WrkTaskIP.aspx?List=91be5c14%2D6eea%2D4223%2D802e%2D7fa28b5d14ba&ID=<xsl:value-of
select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>&Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&WorkflowInstanceID=<xsl:value-of
select="substring-after(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')"
disable-output-escaping="yes"/>
</xsl:attribute>
Approve/Reject
</a>
如果这些都不起作用,请尝试How to disable output escaping for an attribute?
中描述的解决方法