I have a library with @Author, @status, and @fileleafref (document).
I have the following line in the dvt_1 template in my DVWP
<xsl:variable name="C_Draft" select="count($Rows[normalize-space(@Status)='Draft'])" />
This works, but I want to return only the count for items where @status is draft "and" where @Author = Field value of @Author (thus dynamic). So, for example, do a count where status=draft and author=john smith. How would I do this in a situation where there are a number of authors?
EDIT Here's what I've got based on your GetUsername template (thanks):
<xsl:variable name="AuthoredBy" select="substring-after(substring-before(substring-after(@Author, 'ID='), '<'), '>')"/>
<xsl:variable name="C_Draft" select="count($Rows[normalize-space(@Status)='Draft' and @Author = $AuthoredBy])" />
This returns 0, though it should show 1 for author1. So I tried this, which also returns 0. It does parse and return the correct Username, which I checked.
<xsl:variable name="C_Draft" select="count($Rows[@Author = $AuthoredBy])" />
Then I tried this:
<xsl:variable name="C_Draft" select="count($Rows[normalize-space(@Status)='Draft' and $AuthoredBy = 'Author2Name'])" />
This gave me a value of 1, but it is Author 1 that has 1 item in draft status, not author 2.
Any suggestions?