the function handler is called several times when it parses the character data. It doesn't return the entire string as it suggests. There are special exceptions that will always force the parser to stop scanning and call the character data handler. This is when:
- The parser runs into an Entity Declaration, such as & (&) or ' (?)
- The parser finishes parsing an entity
- The parser runs into the new-line character (\n)
- The parser runs into a series of tab characters (\t)
And perhaps others.
For instance, if we have this xml content:
<mytag name=?Ken Egervari? title=?Chief Technology Officer?>
Ken has been Positive Edge's Chief Technology Officer for 2 years.
</mytag>
The parser will call the character data handler 6 times. This is what will happen:
1 \n
2 \t
3 Ken has been Positive Edge
4 ?
5 s Chief Technology Officer for 2 years.
6 \n
I hope that helps people out.