How do I remove the colon if there is only one name and if there is only one address?
I have the following Xslt result which includes a ; at the end. The purpose for the colon is only to separate the names or address. If there is only one name, there is no need for the colon. If there is only one address there is no need for the colon.
XSLT Code/Results
Code:
<ext:ProtectionOrderCondition>
<ext:ConditionText>Stay away from the residence of the Protected Person(s). Jane, Doe; Mellon, Joking; 793 Funny RD, St Jeanne, DC, 77894; 700 Market ST, St Jeanne, DC, 77894; </ext:ConditionText>
</ext:ProtectionOrderCondition>
<ext:ProtectionOrderFinding>
<ext:FindingText>Respondent has health insurance available for: Jane, Doe; </ext:FindingText>
</ext:ProtectionOrderFinding>
<ext:ProtectionOrderFinding>
<ext:FindingText>These parties need order for protection": Joking, Mellon; Doe, Jane; </ext:FindingText>
<ext:ProtectionOrderFinding>
XML Code for both Finding and Condition
Code:
<xsl:for-each select="ancestor::ProtectionOrder/ProtectionOrderParties/ProtectionOrderParty[@InternalPartyID=current()/@InternalPartyID]">
<xsl:value-of select="ProtectionOrderPartyNames/ProtectionOrderPartyName[@Current='true']/@FormattedName"/>
<xsl:text>; </xsl:text>
</xsl:for-each>
<xsl:for-each select="ancestor::ProtectionOrder/ProtectionOrderParties/ProtectionOrderParty[@InternalPartyID=current()/@InternalPartyID]">
<xsl:value-of select="ProtectionOrderPartyNames/ProtectionOrderPartyName[@Current='true']/@FormattedName"/>
<xsl:text>; </xsl:text>
</xsl:for-each>
The desired xslt output should look like this with no colon at the end:
Code:
<ext:ConditionText>Stay away from the residence of the Protected Person(s). Jane, Doe; Mellon, Joking; 793 Funny RD, St Jeanne, DC, 77894; 700 Market ST, St Jeanne, DC, 77894</ext:ConditionText>
Code:
<ext:FindingText>Respondent has health insurance available for: Jane, Doe</ext:FindingText>
Code:
<ext:FindingText>These parties need order for protection": Joking, Mellon; Doe, Jane</ext:FindingText>