You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2003/05/01 16:38:00 UTC
cvs commit: cocoon-2.1/src/documentation/xdocs/howto howto-i18n-xmlform.xml
stephan 2003/05/01 07:38:00
Modified: src/documentation/xdocs/howto howto-i18n-xmlform.xml
Log:
Update i18n-xmlform howto, see
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13114
Revision Changes Path
1.2 +38 -21 cocoon-2.1/src/documentation/xdocs/howto/howto-i18n-xmlform.xml
Index: howto-i18n-xmlform.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/howto/howto-i18n-xmlform.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- howto-i18n-xmlform.xml 9 Mar 2003 00:07:59 -0000 1.1
+++ howto-i18n-xmlform.xml 1 May 2003 14:38:00 -0000 1.2
@@ -156,30 +156,47 @@
<source><![CDATA[
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002"
- xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
-<xsl:template match="document">
- <document>
- <xsl:apply-templates/>
- </document>
-</xsl:template>
+ <xsl:template match="document">
+ <document>
+ <xsl:apply-templates/>
+ </document>
+ </xsl:template>
-<xsl:template match="xf:violation">
- <xf:violation>
- <i18n:text>
- <xsl:value-of select="."/>
- </i18n:text>
- </xf:violation>
-</xsl:template>
+ <xsl:template match="xf:violation">
+ <xf:violation>
+ <i18n:text>
+ <xsl:value-of select="."/>
+ </i18n:text>
+ </xf:violation>
+ </xsl:template>
-<xsl:template match="node()" priority="-1">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
+ <xsl:template match="xf:output[@type='number']">
+ <xsl:variable name="value"><xsl:value-of select="xf:value"/></xsl:variable>
+ <xsl:variable name="caption"><xsl:value-of select="xf:caption"/></xsl:variable>
+ <xsl:variable name="ref"><xsl:value-of select="@ref"/></xsl:variable>
+
+ <xf:output ref="{$ref}">
+ <xf:caption><i18n:text><xsl:value-of select="$caption"/></i18n:text></xf:caption>
+ <xf:violations class="error"/>
+ <xf:value>
+ <xsl:element name="i18n:number">
+ <xsl:attribute name="src-locale">en</xsl:attribute>
+ <xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
+ </xsl:element>
+ </xf:value>
+ </xf:output>
+ </xsl:template>
+
+ <xsl:template match="node()" priority="-1">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
</xsl:stylesheet>
]]></source>
<note>