The startElement, endElement and characters methods are call-back methods. They are called by the XML parser as it is reading the document. The parser calls the characters method when it is reading the text content of each element.
thanks for this jimmy clark, but query is that , how charachter function work? what values are arguments have? for this i also read javadoc, but the functionality is not clear... so plzz help.......
Joined: Apr 16, 2008
The parser calls the characters method when it is reading the text content of each element.
A SAX-based parser sends the content to the application as an array. The arguments contain the content and information that may be used to process the content. The parser determines how the content is sent, this is not something the application developer has any control over. I suggest playing around with your code to see different ways to manipulate the content. In time you should develop a good understanding.
Aside, in SAX-based applications, processing logic typically is in the startElement and endElement methods. Attempting to intercept and process content prior to an element's end-tag is not recommended for beginners and usually not required.