views:

838

answers:

1

Hey Gang,

I've got a simple DataFormWebPart where I'm using XSLT to render out the contents of list. I want to compare the @Author field each list item to the current user, however the following won't evaluate to true:

in the header of the XSL:

<xsl:param name="UserID" />

and within the template that evaluates the rows:

<xsl:value-of select="@Author" /> 
<xsl:if test="@AuthorID = $UserID">(you)</xsl:if>

I have values for both @Author and $UserID:

  • @Author renders as a hyperlink to their user-profile
  • $UserID renders as the same text, but without the hyperlink.

What expression can I use to get the non-hyperlink value of the user-profile?

+1  A: 

Found a quick win:

<xsl:value-of select="contains(@Author,concat('&gt;',$UserID,'&lt;'))" />
bryanbcook
If the format really is how you describe, this is as close as it gets. +1
Tomalak