I have a node with two elements for date of birth. I only want to display the element with <DateOfBirth Current ="true">.
The problem is that my xslt is displaying the first element even if it does not have Current="true".
How can I change my xslt to display the correct dateofbirth with the current =true?
My XML code
Code:
<Party ID="16547750" InternalPartyID="1614450882">
<DateOfBirth>08/31/1979</DateOfBirth>
<DateOfBirth Current="true">08/31/1980</DateOfBirth>
</Party>
My XSLT code. How can I change it to display correct dateofbirth?
Code:
<ext:PersonBirthDate>
<xsl:choose>
<xsl:when test="DateOfBirth">
<xsl:attribute name="ext:approximateDateIndicator">false</xsl:attribute>
<xsl:attribute name="ext:currentIndicator">true</xsl:attribute>
<xsl:value-of select="mscef:formatDate(string(DateOfBirth))"/>
</xsl:when>
<xsl:when test="ApproximateDOB">
<xsl:attribute name="ext:approximateDateIndicator">true</xsl:attribute>
<xsl:attribute name="ext:currentIndicator">true</xsl:attribute>
<xsl:value-of select="mscef:formatDate(string(ApproximateDOB))"/>
</xsl:when>
</xsl:choose>
</ext:PersonBirthDate>
The out put display by this code is wrong
Code:
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">1979-08-31</ext:PersonBirthDate>
The correct out put should be
Code:
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">1980-08-31</ext:PersonBirthDate>