File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes SAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX" Watch "SAX" New topic
Author

SAX

Singh Harmeet
Ranch Hand

Joined: Aug 05, 2011
Posts: 115



in this how charachters function work? what type of value in function argument???


With Regards :-
Harmeet Singh
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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.
Singh Harmeet
Ranch Hand

Joined: Aug 05, 2011
Posts: 115

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.......
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAX