How do I display all the date of birth from a node?



I have xml document with 3 dates of birth, current, approximate and just date. I want to display the 3 dates as output.


My xml code



<Party ID="76" InternalPartyID="18">
<Gender Word="F ">Female</Gender>
<ApproximateDOB>03/4/1956</ApproximateDOB>
<DateOfBirth Current="true">05/21/1956</DateOfBirth>
<DateOfBirth>04/21/1956</DateOfBirth>
</Party>


My XSLT code



<ext:PersonBirthDate>
<xsl:choose>
<xsl:when test="DateOfBirth[@Current='true']">
<xsl:attribute name="ext:approximateDateIndicator">false</xsl:attribute>
<xsl:attribute name="ext:currentIndicator">true</xsl:attribute>
<xsl:value-of select="mscef:formatDate(string(DateOfBirth[@Current='true']))"/>
</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>


How do I change my xslt code so that the output looks like the one below. Right now I my xslt returns only current date of birth:



<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="true">1956-05-21</ext:PersonBirthDate>
<ext:PersonBirthDate ext:approximateDateIndicator="true" ext:currentIndicator="false">1956-03-04</ext:PersonBirthDate>
<ext:PersonBirthDate ext:approximateDateIndicator="false" ext:currentIndicator="false">1956-04-21</ext:PersonBirthDate>

No comments:

Post a Comment