xsl-list
[Top] [All Lists]

Parameters in localized messages

2004-04-20 02:13:04

I am trying to handle parameters in a localization file.

I have something like this in a file messages.xml:

<message id="msgContant" lang="en">Please contact <param name="name"/> 
for details</message>
<message id="msgContant" lang="nl">Neem contact op met <param 
name="name"/> voor details</message>

I pull the messages into a variable, using the document function, and 
want to replace the <param/> elements with the current value, using an 
xslt stylesheet, similar to:

<xsl:call-template name="getString">
   <with-param name="id" select="msgContact"/>
   <with-param name="name" select="{$name}"/>
</xsl:call-template>

That, is, somehow the parameters in the xml elements should be replaced 
with actual values in the result.

Maybe the call could also be something like:

<xsl:call-template name="getString">
   <with-param name="id" select="msgContact"/>
   <with-param name="params" select="'name={$name}; other={$other}'>
</xsl:call-template>



-- 
Jeroen Hellingman
Aletta Jacobsstraat 5
3404 XD IJsselstein
+31 30 6875444
http://www.bohol.ph


<Prev in Thread] Current Thread [Next in Thread>