I've created a custom field according to the following walkthrough:
http://msdn.microsoft.com/en-us/library/ff606773.aspx
My field XML is as follows:
<FieldType>
<Field Name="TypeName">ReviewStatus</Field>
<Field Name="ParentType">Choice</Field>
<Field Name="TypeDisplayName">Review Status</Field>
<Field Name="TypeShortDescription">Review Status</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="FieldTypeClass">MyFields.MyReviewStatusField, $SharePoint.Project.AssemblyFullName$</Field>
</FieldType>
and my XSL is as follows:
<xsl:template match="FieldRef[@Name='ReviewStatus']" mode="body">
<xsl:param name="thisNode" select="." />
<span style="background-color:lightgreen;font-weight:bold">
<!-- <xsl:apply-templates select="$thisNode/@*"/> -->
<xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>
</span>
</xsl:template >
Now my issue is this, if I deploy my custom field to the server, and add a column of this type to a list, SharePoint gives me the opportunity to give it a "Name" so perhaps I name it simply "Status". After some debugging I found the problem with this is that my XSL does not match because the "Name" is "Status" and not the TypeName "ReviewStatus" as I have programmed into my XML and my transform.
What is the proper way to ensure that my transform matches and give users the ability to change the field "Name"? Do I override SPField InternalName? What is the best way?
EDIT: I found an attribute @FieldType that I can use instead of @Name, it appears to behave as I want (so the match looks like this):
<xsl:template match="FieldRef[@FieldType='ReviewStatus']" mode="body">
How can I see all of the attributes on the FieldRef? I've tried the following but saw neither Name or FieldType in the result (I assume I need to tweak this slightly):
<xsl:template match="FieldRef[@FieldType='ReviewStatus']" mode="body">
<xsl:param name="thisNode" select="." />
<span style="background-color:lightgreen;font-weight:bold">
<xsl:apply-templates select="$thisNode/@*"/>
</span>
</xsl:template >
<xsl:template match="@*">
<xsl:value-of select="name()"/>=<xsl:value-of select="."/><br/>
</xsl:template>