One character is divided to two and show 2 words instead of 1

"Ranjith Kodikara" <[email protected]> Mon, 21 Apr 2003 15:30:46 +0600
Newsgroups gmane.text.xml.sax.general
Message-ID <[email protected]>


This attached java class is written extending the DefaultHandler class. ( I am parsing XML with SAX 2.0 )

 public void characters (char[] ch, int start, int length) throws SAXException{
  //System.out.print(""+ new String(ch, start,length) +"");
  String elementContentObj = new String(ch, start,length);
  eleContent = elementContentObj.toString();
  System.out.print(""+ eleContent +"");
  if (eleContent.trim().compareTo("")!=0){

   if (firstColumnFlag2==0){
    sqlQuery2 = sqlQuery2 + " '"+ eleContent + "'";
   }else{
    sqlQuery2 = sqlQuery2 + ", '"+ eleContent + "'";
   }
   firstColumnFlag2 = 1;// If this is zero, that is the first column...
  }
 }

This is the characters method. 

The problem I am having is:

I am creating a SQL query by parsing an xml file. While I am parsing that file, I am concatenating data in the XML file like this; " ' " + 004+ "' , ' " +OLIYAMULLA +" ' " etc.
Everything is ok except an one thing in one tag. In the following xml file, in <loc_addres2>OLIYAMULLA</loc_addres2>  tag, OLIYAMULLA is parsed as two words. Like OLIYA as one word and MULLA as the other word. But it should extract as OLIYAMULLA. But There are so many locations tags and this problem occurs only in one occurrence of this locations tag. 

<locations loccode="004"> 
    <loccode>004</loccode>
    <loc_name>OLIYAMULLA</loc_name>    
    <loc_addres1>50 NEGAMBO ROAD</loc_addres1> 
    <loc_addres2>OLIYAMULLA</loc_addres2> 
    <loc_addres3>null</loc_addres3> 
    <loc_status>A</loc_status>  
    <loc_phone>933480</loc_phone>   
    <loc_type>S</loc_type>    
    <loc_crtdate>12-jul-1999</loc_crtdate> 
    <loc_crtuser>FMA</loc_crtuser> 
    <loc_moddate>28-jan-2000</loc_moddate> 
    <loc_moduser>CIC</loc_moduser> 
    <loc_modified>N</loc_modified>
    <loc_price_difference>0</loc_price_difference>
 </locations>

Any help to this problem is greatly appreciated. I have attached the java class I am using.

[email protected]
OurHandler.java (application/octet-stream, 4.6 KB) - not displayed