我正在尝试确定项目的内容类型。我试过这个,但我认为 results.aspx webpart 中的 ContentType 以另一个名字而闻名。
<xsl:if contenttype="mycustomcontenttype">
<xsl:Value-of select="contenttype" />
<xsl:if>
我正在尝试确定项目的内容类型。我试过这个,但我认为 results.aspx webpart 中的 ContentType 以另一个名字而闻名。
<xsl:if contenttype="mycustomcontenttype">
<xsl:Value-of select="contenttype" />
<xsl:if>
您的 XSLT 格式错误。
没有这样的xsl:if
属性被称为contenttype
- 也没有<xsl:Value-of
因为所有指令都区分大小写,并且应该是小写的。
你的代码应该是这样的......
<xsl:if test="contenttype='mycustomcontenttype'">
<xsl:value-of select="contenttype" />
<xsl:if>
甚至这个单行(根本不使用条件):
<xsl:value-of select="contenttype[.='mycustomcontenttype']"/>