I have a problem. I need to only display information about the first Guardian even though I have two in my xml. How do I do this?
Right now, my out put is displaying information on the two Guardians.
My xml code
Code:
<CaseParty ID="16547822" InternalCasePartyID="1633580827" InternalPartyID="1614450954">
<SendNotice>true</SendNotice>
<Connection Word="GRD" BaseConnection="GD" ID="34640719" InternalCasePartyConnectionID="1635188308">
<Description>Guardian</Description>
</Connection>
<CasePartyName Current="true" ID="9638244" InternalNameID="1615262358">
<NameType>Standard</NameType>
<NameFirst>Tina</NameFirst>
<NameMiddle>Andrea</NameMiddle>
<NameLast>Nice</NameLast>
<FormattedName>Nice, Tina Andrea</FormattedName>
</CasePartyName>
</CaseParty>
<CaseParty ID="16547823" InternalCasePartyID="1633580828" InternalPartyID="1614450955">
<SendNotice>true</SendNotice>
<Connection Word="GRD" BaseConnection="GD" ID="34640720" InternalCasePartyConnectionID="1635188309">
<Description>Guardian</Description>
</Connection>
<CasePartyName Current="true" ID="9638245" InternalNameID="1615262359">
<NameType>Standard</NameType>
<NameFirst>Wako</NameFirst>
<NameMiddle>Douglas</NameMiddle>
<NameLast>Juma</NameLast>
<FormattedName>Juma, Wako Douglas</FormattedName>
</CasePartyName>
</CaseParty>
My xslt code
Code:
<ext:Respondent>
<xsl:for-each select=" //CaseParty">
<xsl:for-each select="//CaseParty[(@InternalPartyID=current()/@InternalPartyID) and (Connection[(@Word='GRD') ])]">
<xsl:for-each select="//Party[@InternalPartyID=current()/@InternalPartyID]">
<xsl:call-template name="Guardian"/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
<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>
<xsl:for-each select="PartyName[@Current='true']">
<ext:PersonName>
<xsl:attribute name="ext:currentIndicator"><xsl:value-of select="@Current"/></xsl:attribute>
<nc:PersonGivenName>
<xsl:value-of select="NameFirst"/>
</nc:PersonGivenName>
<nc:PersonMiddleName>
<xsl:value-of select="NameMiddle"/>
</nc:PersonMiddleName>
<nc:PersonSurName>
<xsl:value-of select="NameLast"/>
</nc:PersonSurName>
<nc:PersonNameSuffixText>
<xsl:value-of select="NameSuffix"/>
</nc:PersonNameSuffixText>
<nc:PersonFullName>
<xsl:value-of select="FormattedName"/>
</nc:PersonFullName>
</ext:PersonName>
</xsl:for-each>
</ext:Respondent>