You are on page 1of 2

<xsl:variable name="Status">

<xsl:for-each select="//ParticipantStatus/Status[EffectiveDate &lt;=


current-date()]">
<xsl:sort select="EffectiveDate" data-type="text" order="descending"/>
<xsl:if test=" ">
<xsl:value-of select="Value"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$Status" />

<xsl:template name="GetParticipantCurrentStatus">
<xsl:param name="PartStatus"/>
<xsl:param name="CreateDate"/>
<xsl:param name="PartUniqueId"/>
<xsl:attribute name="ParticipantStatus">
<xsl:value-of select="string-length($PartStatus)" />
<!--xsl:for-each
select="//LH1DemographicExport/Participant/ParticipantDetails[@LH1ParticipantUniqu
eId=$PartUniqueId]/EmploymentDetails/ParticipantStatus/Status[@EffectiveDate &lt;=
$CreateDate]"-->
<xsl:for-each select="ParticipantStatus/Status[@EffectiveDate &lt;=
$CreateDate]">
<xsl:sort select="@EffectiveDate" data-type="text"
order="descending"/>
<xsl:if test="position() = 1" >
<xsl:value-of select="@Value"/>
</xsl:if>
</xsl:for-each>
</xsl:attribute>
</xsl:template>

<xsl:template name="MyXsltConcatTemplate" >


<xsl:param name="PartId" />
<xsl:param name="param1" />
<xsl:variable name="PartStatus"
select="/LH1DemographicExport/Participant[ParticipantDetails/@LH1ParticipantUnique
Id=$PartId]/EmploymentDetails/ParticipantStatus" />
<xsl:attribute name="ParticipantStatus">
<xsl:value-of select="count($PartStatus/Status[@EffectiveDate &lt;= $param1])" />

<xsl:for-each select="$PartStatus/Status[@EffectiveDate &lt;= $param1]" >


<xsl:sort select="@EffectiveDate" data-type="text" order="descending" />
<xsl:if test="position() = 1">
<xsl:value-of select="@Value" />
</xsl:if>
</xsl:for-each>
</xsl:attribute>
</xsl:template>

=============
<xsl:variable name="CreateDate">
<xsl:choose>
<xsl:when test="../@CreatedDatetime">
<xsl:value-of
select="userCSharp:StringLeft(string(../@CreatedDatetime),10)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="userCSharp:DateCurrentDate()" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

-----------
<xsl:variable name="CreateDate">
<xsl:choose>
<xsl:when test="../@CreatedDatetime">
<xsl:value-of
select="userCSharp:StringLeft(string(../@CreatedDatetime),10)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="userCSharp:DateCurrentDate()" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="ParticipantStatus">
<xsl:if test="EmploymentDetails/ParticipantStatus/Status">
<xsl:for-each
select="EmploymentDetails/ParticipantStatus/Status[userCSharp:LogicalLte(@Effectiv
eDate, $CreateDate)]" >
<xsl:sort select="@EffectiveDate" data-type="text"
order="descending" />
<xsl:if test="position() = 1" >
<xsl:value-of select="@Value" />
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:attribute>

You might also like