Feb  7 13:20:39 cvs[18320]: dante/client v1.1.10 running
Feb  7 13:20:39 cvs[18320]: socketoptdup(): setsockopt(0, 32): Invalid argument (errno = 22)
Feb  7 13:20:39 cvs[18320]: socketoptdup(): setsockopt(0, 33): Invalid argument (errno = 22)
Index: I18nTransformer.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v
retrieving revision 1.10
diff -u -u -r1.10 I18nTransformer.java
--- I18nTransformer.java	7 Feb 2002 07:41:24 -0000	1.10
+++ I18nTransformer.java	7 Feb 2002 12:21:00 -0000
@@ -588,6 +588,9 @@
 
     // Date pattern types map: short, medium, long, full
     private static final Map datePatterns;
+	
+    // String buffer 
+    private StringBuffer strBuffer;
 
     static {
         // initialize date types set
@@ -899,6 +902,8 @@
         throws SAXException {
 
         debug("Start i18n element: " + name);
+	   //initialize the string buffer
+	   strBuffer = new StringBuffer();
 
         if (I18N_TEXT_ELEMENT.equals(name)) {
             if (current_state != STATE_OUTSIDE
@@ -1028,40 +1033,11 @@
 
     private void endI18NElement(String name) throws SAXException {
         debug("End i18n element: " + name);
-        switch (current_state) {
-        case STATE_INSIDE_TEXT:
-            endTextElement();
-            break;
-
-        case STATE_INSIDE_TRANSLATE:
-            endTranslateElement();
-            break;
-
-        case STATE_INSIDE_PARAM:
-            endParamElement();
-            break;
-
-        case STATE_INSIDE_DATE:
-        case STATE_INSIDE_DATE_TIME:
-        case STATE_INSIDE_TIME:
-            endDate_TimeElement();
-            break;
-
-        case STATE_INSIDE_NUMBER:
-            endNumberElement();
-            break;
-        }
-    }
-
-    private void i18nCharacters(char[] ch, int start, int len)
-        throws SAXException {
-
-        String textValue = new String(ch, start, len).trim();
-        if (textValue == null || textValue.length() == 0) {
+        
+	   if (strBuffer.length() == 0) {
             return;
         }
-
-        debug( "i18n message text = '" + textValue + "'" );
+        debug( "i18n message text = '" + strBuffer.toString() + "'" );
 
         switch (current_state) {
         case STATE_INSIDE_TEXT:
@@ -1070,39 +1046,46 @@
 
                 // If no translation found and untranslated param is null
                 if (translated_text == null) {
-                    translated_text = textValue;  // use the key
+                    translated_text = strBuffer.toString();  // use the key
                 }
 
                 // reset the key holding variable
                 current_key = null;
             } else {    // use text value as dictionary key
-                translated_text = getString(textValue, (untranslated == null) ? textValue : untranslated);
+                translated_text = getString(strBuffer.toString(), 
+		  	 (untranslated == null) ? strBuffer.toString(): untranslated);
             }
+            endTextElement();
             break;
 
         case STATE_INSIDE_TRANSLATE:
             // Store text for param substitution (do not translate)
             if (substitute_text == null) {
-                substitute_text = textValue;
+                substitute_text = strBuffer.toString();
             }
+            endTranslateElement();
             break;
 
         case STATE_INSIDE_PARAM:
             // Store translation for param substitution
             if (param_value == null) {
-                param_value = textValue;
+                param_value = strBuffer.toString();
             }
+            endParamElement();
             break;
 
         case STATE_INSIDE_DATE:
         case STATE_INSIDE_DATE_TIME:
         case STATE_INSIDE_TIME:
+            endDate_TimeElement();
+            break;
         case STATE_INSIDE_NUMBER:
             if (formattingParams.get(I18N_VALUE_ATTRIBUTE) == null) {
-                formattingParams.put(I18N_VALUE_ATTRIBUTE, textValue);
+                formattingParams.put(I18N_VALUE_ATTRIBUTE, strBuffer.toString());
             } else {
                 ; // ignore the text inside of date element
             }
+            endNumberElement();
             break;
 
         default:
@@ -1112,6 +1095,12 @@
         }
     }
 
+    private void i18nCharacters(char[] ch, int start, int len)
+        throws SAXException {
+       
+       strBuffer.append(new String(ch, start, len).trim());
+    }
+
     // Translate all attributes that are listed in i18n:attr attribute
     private Attributes translateAttributes(String name, Attributes attr)
         throws SAXException {
@@ -1519,6 +1508,7 @@
 
         factory.release(dictionary);
         dictionary = null;
+        strBuffer = null;
     }
 
     public void dispose() {

