cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: mixing xml and xsl with i18n
Date Thu, 18 Jul 2002 13:46:05 GMT
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:i18n="http://apache.org/cocoon/i18n/2.0">

   <xsl:template match="gender">
     <i18n:text><xsl:value-of select="@sex"/></i18n:text>
     <xsl:text/> <xsl:value-of select="name"/>
   </xsl:template>

</xsl:stylesheet>

in catalogue_en.xml:

<message key="Male">Mr.</message>
<message key="Female">Mrs.</message>

in catalogue_de.xml:

<message key="Male">Frau</message>
<message key="Female">Herr</message>

Regards,

Joerg


kavitha ramesh wrote:
> Hi,
> 
> I have an xml file which is as follows:
> 
> simple.xml
> ----------
> <menu>
> <person>
> <gender sex="Male">
> <name>Ramesh</name>
> </gender>
> </person>
> <person>
> <gender sex="Female">
> <name>Kavitha</name>
> </gender>
> </person>
> <person>
> </menu>
> 
> and my xsl file is as follows:
> 
> simple.xsl
> ----------
> 
> <i18n:text>text1</i18n:text>
> <i18n:text>text2</i18n:text>
> 
> 
> and my messages for i18n are as follows:
> 
> messages_en
> -----------
> <message key="text1">Mr</message>
> <message key="text2">Mrs</message>
> 
> messages_de
> -----------
> <message key="text1">Herrn</message>
> <message key="text2">Frau</message>
> 
> If the sex is male, the browser should display
> 
> Mr.Ramesh(English)
> Herrn.Ramesh(German)
> 
> If the sex is female then the browser should display
> 
> Mrs.Kavitha(English)
> Frau.Kavitha(German)
> 
> How do I do this?Please help me,,,
> 
> Kavitha.


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message