I have in XML file like this
<ViewFields>
<FieldRef Name="Approval Status" />
<FieldRef Name="Requirement Status" />
<FieldRef Name="Development Status" />
<FieldRef Name="Testing Status" />
</ViewStatus>
I have the following XSL code to get FieldRef values.
<xsl:template name="FieldRef_body.Status" match="FieldRef[@Name='ViewFields/FieldRef[1]/@Name']" mode="body">
<xsl:param name="thisNode" select="."/>
<xsl:choose>
<xsl:when test="$thisNode/@*[name()=current()/@Name] = 'Completed'">
<img src="/_layouts/images/IMNON.png" alt="Status: {$thisNode/@Status}"/>
</xsl:when>
<xsl:when test="$thisNode/@*[name()=current()/@Name] = 'In Progress'">
<img src="/_layouts/images/IMNIDLE.png" alt="Status: {$thisNode/@Status}"/>
</xsl:when>
<xsl:otherwise>
<img src="/_layouts/images/IMNBUSY.png" alt="Status: {$thisNode/@Status}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
I am trying to LOOP through FieldRef*[x]* to get the values one by one, it's not returning anything. I want to assign FieldRef values to @Name variable through loop.
See Question&Answers more detail:os