Xslt 如何筛选到数据视图中的联接项列?

Xslt 如何筛选到数据视图中的联接项列?,xslt,sharepoint-2013,dataview,Xslt,Sharepoint 2013,Dataview,当我使用过滤器对话框生成过滤器时,SPD生成以下行过滤器 <xsl:variable name="Rows" select="/dsQueryResponse/Benefits/Rows/Row[normalize-space(@Benefit_x0020_Type) = $pBenefit and normalize-space(@Level) = $pLevel]"/> @Benefit_x0020_类型的过滤器工作正常(这只是一个常规的、非链接的项目),但@Level的过

当我使用过滤器对话框生成过滤器时,SPD生成以下行过滤器

<xsl:variable name="Rows" select="/dsQueryResponse/Benefits/Rows/Row[normalize-space(@Benefit_x0020_Type) = $pBenefit and normalize-space(@Level) = $pLevel]"/>

@Benefit_x0020_类型的过滤器工作正常(这只是一个常规的、非链接的项目),但@Level的过滤器不工作@级别是一个连接项,声明如下

<xsl:value-of disable-output-escaping="yes" select="../../../Projects/Rows/Row[@ID=current()/@Project_x003a_ID]/@Level" />


如何使筛选器适用于已加入的项目?

我找到的解决方案是在SharePoint呈现$Rows节点集之前,编辑该节点集以包含已加入的字段

<xsl:variable name="Rows" select="/dsQueryResponse/Benefits/Rows/Row"/>

<xsl:variable name="myRowsFractured">
  <xsl:for-each select="$Rows">
    <xsl:variable name="projectID" select="@Project_x003a_ID"/>
    <xsl:variable name="level" select="/dsQueryResponse/Projects/Rows/Row[@ID=$projectID]/@Level"/>
    <xsl:if test="$level = $pLevel">
      <xsl:copy>
        <xsl:copy-of select="@*|node()"/>
        <xsl:attribute name="Level">
          <xsl:value-of select="$level"/>
        </xsl:attribute>
        <xsl:attribute name="Title">
          <xsl:value-of select="/dsQueryResponse/Projects/Rows/Row[@ID=$projectID]/@Title"/>
        </xsl:attribute>
      </xsl:copy>
    </xsl:if>
  </xsl:for-each>
</xsl:variable>

<xsl:variable name="myRows" select="msxsl:node-set($myRowsFractured)/*"/>

(从查询字符串中获取$pLevel)


然后,我将$Rows的任何后续引用替换为$myRows。这种技术的优点是任何计算(如dvt_行数)都是有效的

我找到的解决方案是,在SharePoint呈现$Rows节点集之前,编辑该节点集以包含关联的字段

<xsl:variable name="Rows" select="/dsQueryResponse/Benefits/Rows/Row"/>

<xsl:variable name="myRowsFractured">
  <xsl:for-each select="$Rows">
    <xsl:variable name="projectID" select="@Project_x003a_ID"/>
    <xsl:variable name="level" select="/dsQueryResponse/Projects/Rows/Row[@ID=$projectID]/@Level"/>
    <xsl:if test="$level = $pLevel">
      <xsl:copy>
        <xsl:copy-of select="@*|node()"/>
        <xsl:attribute name="Level">
          <xsl:value-of select="$level"/>
        </xsl:attribute>
        <xsl:attribute name="Title">
          <xsl:value-of select="/dsQueryResponse/Projects/Rows/Row[@ID=$projectID]/@Title"/>
        </xsl:attribute>
      </xsl:copy>
    </xsl:if>
  </xsl:for-each>
</xsl:variable>

<xsl:variable name="myRows" select="msxsl:node-set($myRowsFractured)/*"/>

(从查询字符串中获取$pLevel)

然后,我将$Rows的任何后续引用替换为$myRows。这种技术的优点是任何计算(如dvt_行数)都是有效的