I am trying to make a page in different languages ββusing xml / xsl. I want to have only one xml and one xsl. On my Url page I have a pLanguage parameter that I think I can use to see if I have selected English or Dutch.
I tried with this code, but I don't know how I put it together:
First, I make variables of all the words that need to be translated as follows:
<xsl:variable name="lang.pageTitle" select="'This is the title in English'"/>
To get pageTitle in a template, I can now use
<xsl:value-of select="$lang.pageTitle"/>
I decided to replace the first line of code above using the if-else statement to check if my selected EN or NL language is as follows:
<xsl:choose> <xsl:when test="$choosenLanguage = 'NL'"> <xsl:variable name="lang.pageTitle" select="Titel in het nederlands'"/> </xsl:when> <xsl:otherwise> <xsl:variable name="lang.pageTitle" select="'This is the title in English'"/> </xsl:otherwise> </xsl:choose>
But I get the error: java.lang.IllegalArgumentException: cannot parse the argument number $ lang.opdracht
source share