I am parsing xml using the SAXParser and want to know if this is the right way to implement the characters method.
Assume there's a class-level String variable named elementValue and it is initialized to "" in the startElement method.
Here is the characters method:
@Override
public void characters(char[] ch, int start, int length)
{
String charsToAppend = new String(ch, start, length);
elementValue = elementValue + charsToAppend;
}
Is it correct that we need to append to the value we have so far and is the append being done correctly?
Also, why does the characters method give the start index? Won't it be zero every time?
Thanks.