Ignore:
Timestamp:
2012-08-09T11:08:41+12:00 (12 years ago)
Author:
kjdon
Message:

due to the way we call formatting functions from xslt, I have made them all have the same arguments, string and lang.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r25858 r26086  
    121121    }
    122122
    123     /* some preprocessing functions */
    124     public static String toLower(String orig)
    125     {
    126         return orig.toLowerCase();
    127     }
    128 
    129     public static String toUpper(String orig)
    130     {
    131         return orig.toUpperCase();
    132     }
    133 
    134     public static byte[] toUTF8(String orig)
    135     {
    136         try
    137         {
    138             byte[] utf8 = orig.getBytes("UTF-8");
    139             return utf8;
    140         }
    141         catch (Exception e)
    142         {
    143             logger.error("unsupported encoding");
    144             return orig.getBytes();
    145         }
    146     }
    147123
    148124    public static String replace(String orig, String match, String replacement)
     
    325301    }
    326302
     303  // formatting /preprocessing functions
     304  // some require a language, so we'll have a language param for all
     305  public static String toLower(String orig, String lang)
     306    {
     307        return orig.toLowerCase();
     308    }
     309
     310    public static String toUpper(String orig, String lang)
     311    {
     312        return orig.toUpperCase();
     313    }
     314
     315    public static byte[] toUTF8(String orig, String lang)
     316    {
     317        try
     318        {
     319            byte[] utf8 = orig.getBytes("UTF-8");
     320            return utf8;
     321        }
     322        catch (Exception e)
     323        {
     324            logger.error("unsupported encoding");
     325            return orig.getBytes();
     326        }
     327    }
     328
    327329    public static String formatDate(String date, String lang)
    328330    {
     
    364366    }
    365367
    366     public static String formatBigNumber(String num)
     368    public static String formatBigNumber(String num, String lang)
    367369    {
    368370
Note: See TracChangeset for help on using the changeset viewer.