You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by kavitha ramesh <ka...@rediffmail.com> on 2002/07/17 12:26:54 UTC
SUMMARY(using i18n tags in xsl)
Question:How to use the i18n tags in an xsl file instead of using
it in an xml file?
Answer: Run the i18n transformer after xslt in the sitemap and
declare the i18n namespace in your stylesheet.
Example:
file.xml
<title>
</title>
file.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
<html>
.....
.....
</html>
<xsl:template match="title">
<i18n:text>welcometext</i18n:text>
</xsl:template>
</xsl:stylesheet>
messages_de.xml
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
<message key="welcometext">Guten Tag!</message>
</catalogue>
messages_en.xml
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
<message key="welcometext">GoodDay!</message>
</catalogue>
sitemap.xmap
<map:match pattern="xml/*">
<map:generate src="{1}.xml"/>
<map:transform src="file.xsl"/>
<map:transform type="i18n"/>
<map:serialize type="html"/>
</map:match>
Kavitha Ramesh
_________________________________________________________
Click below to experience Aishwarya Rai's beauty secrets. New
International Lux Skincare - It's not just soap, It's skincare.
http://www.luxskincare.com
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>