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

Here should go questions about transforming XML with XSLT and FOP.
Posts: 53

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

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>
    <DateOfBirth Current="true">05/21/1956</DateOfBirth>

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

        <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 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))"/>
Posts: 53

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

Fri Nov 14, 2014 5:37 pm

I was able to resolve this one.

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests