I am using the SAX parser to parse preformed text as listed 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 am only getting the first line “(a) Definitions. ” in my character buffer. The other lines are not being copied. How can I access the missing lines?
Thank You.
According to SAX parser specification, you may be getting multiple callbacks for
characters, representing chunks of the same character block. You should combine consecutive ones into a single string.