i am calling countries from within an xsl file and depending on the number of countries to which a product is available to, the number of countries that gets displayed varies.
what i am trying to do is have a comma and space in between each country that shows up on the html output pages, e.g. Japan, United Kingdom, Spain
is there a way i can code the logic so that the last country doesn't have a comma at the end?
the code i have setup below is limited and the comma shows up for each country, even the last. i imagine there is a way to do this but i'm not sure how.
any help greatly appreciated.
~AJ
<xsl:if test="contains(xmen:TargetedCountries,'AU')">Australia, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'CA')">Canada, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'CN')">China, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'FR')">France, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'DE')">Germany, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'IN')">India, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'IT')">Italy, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'JP')">Japan, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'KR')">Korea, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'GB')">United Kingdom, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'US')">United States, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'ES')">Spain, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'TW')">Taiwan, </xsl:if>
what i am trying to do is have a comma and space in between each country that shows up on the html output pages, e.g. Japan, United Kingdom, Spain
is there a way i can code the logic so that the last country doesn't have a comma at the end?
the code i have setup below is limited and the comma shows up for each country, even the last. i imagine there is a way to do this but i'm not sure how.
any help greatly appreciated.
~AJ
<xsl:if test="contains(xmen:TargetedCountries,'AU')">Australia, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'CA')">Canada, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'CN')">China, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'FR')">France, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'DE')">Germany, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'IN')">India, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'IT')">Italy, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'JP')">Japan, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'KR')">Korea, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'GB')">United Kingdom, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'US')">United States, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'ES')">Spain, </xsl:if>
<xsl:if test="contains(xmen:TargetedCountries,'TW')">Taiwan, </xsl:if>