有没有办法将SharePoint的输出:AttachmentsField元素放入变量?我试过下面但是menuItemArrachments导致空白。
<td>
<xsl:variable name="menuItemAttachments">
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
<xsl:attribute name="ControlMode">Display</xsl:attribute>
<xsl:attribute name="ItemId">
<xsl:value-of select="@ID"/>
</xsl:attribute>
</xsl:element>
</xsl:variable>
<xsl:value-of select="$menuItemAttachments" /> <!-- produces blank -->
</td>
不使用变量,下面相同的代码会生成一个sharepoint附件文件列表:
<td>
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
<xsl:attribute name="ControlMode">Display</xsl:attribute>
<xsl:attribute name="ItemId">
<xsl:value-of select="@ID"/>
</xsl:attribute>
</xsl:element>
</td>