Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am not sure whether i am posting the topic in correct section.
Here is my situation. i have a property in the document which is of type number and the content is allowed to enter the Value. This value holds the information of the distance.Based on the Location(for ex; USA/India) the value should be displayed on the Webpage as Miles/KiloMeters.
Ex: I specify 450 for the property value and select the location as India and on the webpage i need to display as 450 KM. If i select the Location as USA it should display as 450 Miles
Any help would be appreciated.
Won't you also want to do a conversion between miles and kilometers? 450 km is ~280 miles, and 450 miles is ~724 km...
Is the Location set via a dropdown control or something similar? In that case, you could do something like this:
<xsl:template match="Distance"> <xsl:variable name="unit"> <xsl:choose> <xsl:when test="location = 'USA'">miles</xsl:when> <xsl:otherwise>kilometers</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat(measure, ' ', $unit)"/></xsl:template>
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted