Parsing error occurs when special characters are encountered.. in SAX

"Ranjith Kodikara" <[email protected]>
Newsgroups gmane.text.xml.general
Message-ID <[email protected]>
I have written a xml parser java program to parse xml files and display. I am using SAX and my java class extends DefaultHandler. In characters() method I get the content of the tag as new String(ch, start, length). 

The xml files I get to parse with this program includes special characters. They are replaced by appropriated notations ( ie: it replaces &amp; for &) in the server which generates xml files. 

This is my output:

Kandy was the last capital of the Sri Lankan kings which is a World Heritage Site. The name
"
Kandy
"
 conjures visions of splendour and magnificence. Many of the legends, traditions and folklore are s
till lovingly kept alive. Drive around the Kandy Lake built by the last Sinhala king, Sri Wickrama
Rajasinghe in 1798. Visit the Kandy town and Bazaar, the arts
&
 crafts centre, a gem museum and a lapidary. Also visit the Temple of the Tooth Relic in Kandy. The
reafter witness a Cultural show.

Please see there are two carriage return (line break) before and after a special character. How do I overcome this issue?

Any help will be greatly appreciated.
Best regards,
Ranjith


                        
                  
                        Ranjith Kodikara
                        Systems Engineer  DMS Software Technologies
                        165, Dharmapala Mawatha,
                        Colombo 00700  
                        [email protected]  tel: 
                              tel2: +94-11-2673973
                              +94-11-2696648  
                       
                 
            
     
            Add me to your address book... Want a signature like this?
dms.jpg (image/jpeg, 15.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.