<xsl:template name="FieldRef_body.Status"
match="FieldRef[@Name=/ViewFields/FieldRef[1]]" mode="body">
There are two things to note here:
The match attribute contains an XPath expression that, when applied on the provided XML document, selects no node at all. It is supposed to select an element named FieldRef the string value of whose Name attribute is equal to the string value of the first FieldRef child of the ViewFields top element. However, none of the FieldRef elements in the XML document have any (non-empty) string value. On the other side, the string values of all Name attributes are non-empty. My guess is that you wanted: match="FieldRef[@Name=/ViewFields/FieldRef[1]/@Name]"
Any template in a (non-anonymous) mode isn't considered by the XSLT processor for selection if its mode is different from the current mode.
As the initial mode in XSLT 1.0 (and in XSLT 2.0) is the empty (anonymous) mode, the only way to make a template in a non-anonymous mode considered for selection is to explicitly specify the mode on an <xsl:apply-templates> instruction.
This transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates select="*/*" mode="body"/>
</xsl:template>
<xsl:template match="FieldRef[@Name=/ViewFields/FieldRef[1]/@Name]"
mode="body">
<xsl:value-of select="@Name"/>
</xsl:template>
</xsl:stylesheet>
produces this result, showing that the template is selected for processing:
Planing Status
FieldRefelements are empty so@Name=/ViewFields/FieldRef[1]does not select anything as noNameattribute is empty as well. Otherwise I can't help as your question is not very clear. You might want to post a sample of the result you want to generate with XSLT for the input sample you posted, then we can suggest appropriate XSLT code. With XSLT/XPath@Nameis not a selecting a variable, rather it selects an attribute of the nameName.