SAX Parser does not read after a new line

I use the SAX parser to parse preformed text, as shown below:

<content><![CDATA[(a) Definitions. 
   (i) term - Definition of term
   (ii) term 2 - Definition of term 2
   (iii) term 3 - Definition of term 3]]>
</content>

My handler

public void characters(char ch[], int start, int length){
    if (content) {
        contentText = new String(ch, start, length));
    }   
}     

However, I only get the first line of "(a) Definitions" in my character buffer. Other lines are not copied. How can I access the missing lines?

Thank.

+3
source share
2 answers

According to the specification of the SAX parser, you can receive several callbacks for characters, representing pieces of the same character block. You must combine consecutive in one line.

[ characters], . SAX , ; , .

+5

, characters() . .

+1

All Articles