Changeset 20944


Ignore:
Timestamp:
2009-11-16T13:09:40+13:00 (12 years ago)
Author:
mdewsnip
Message:

Changed the "a_doc" variable to be a StringBuffer instead of a String, to speed things up considerably in some cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/build-src/src/java/org/nzdl/gsdl/ApplyXSLT.java

    r20882 r20944  
    5858   
    5959      int system_status = BEFORE_READING;
    60       String a_doc = new String();
     60      StringBuffer a_doc = new StringBuffer();
    6161      String output_file = new String();
    6262
     
    6969        output_file = br.readLine(); // read the next line as the output file name
    7070        system_status = IS_READING;
    71         a_doc = "";
     71        a_doc = new StringBuffer();
    7272      }
    7373      else if(this_line.compareTo(INPUT_END) == 0){
     
    8484        boolean result = false;
    8585        if (mapping_file !=null && !mapping_file.equals("")){
    86           result = translateXMLWithMapping(a_doc,output_file);             
     86        result = translateXMLWithMapping(a_doc.toString(), output_file);
    8787        }
    8888        else{
    89           result = translateXML(a_doc,output_file);
     89        result = translateXML(a_doc.toString(), output_file);
    9090        }
    9191           
     
    9999      }
    100100      else{
    101         a_doc = a_doc + this_line + "\n";
    102            
     101          a_doc.append(this_line + "\n");
    103102      }
    104103    }
Note: See TracChangeset for help on using the changeset viewer.