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

Here should go questions about transforming XML with XSLT and FOP.
winkimjr2
Posts: 55
Joined: Thu Jun 26, 2014 9:00 pm

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

Post by winkimjr2 » Thu Nov 13, 2014 8:57 pm

How do I change my xslt code so that the 3 date of birth I have in my xml document are show in the output like this:

I want my output to look like this

Code: Select all


<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>
My xml document

Code: Select all


<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. I need help to change or add to this code in order to get the output I want shown here above.

Code: Select all


<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>

winkimjr2
Posts: 55
Joined: Thu Jun 26, 2014 9:00 pm

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

Post by winkimjr2 » Fri Nov 14, 2014 5:37 pm

I was able to resolve this one.

Post Reply