url阻止使用sharepoint发送的邮件中的Outlook错误

时间:2012-01-31 11:03:53

标签: xml sharepoint-2010 xml-parsing

我有一个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&amp;ID=</xsl:text>
        <xsl:value-of
            select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
            disable-output-escaping="yes"/>
        <xsl:text>&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;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&amp;ID=35&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;WorkflowInstanceID=11e09c76-29ec-4c7f-ace3-ad7a8c9e7b44">
    Approve/Reject
</a>

当我在浏览器中复制并粘贴网址时,我会收到提示“出现意外错误”的提示,然后我用&amp;替换&amp;在浏览器中,我正确地打开了表单。

这是outlook的任何解析问题,但是&amp;的另一个链接对我有用吗?

1 个答案:

答案 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&amp;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">&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;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&amp;ID=<xsl:value-of
        select="substring-before(/SRWorkflowDetails/SRLevel[level=$level and contains(Approver,$Id)]/URL,';')" 
        disable-output-escaping="yes"/>&amp;Source=http://stage/_layouts/WrkStat.aspx?List=089f13be%2D3147%2D4818%2Da30e%2Da332cb63195d&amp;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?

中描述的解决方法