Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAX

 
Singh Harmeet
Ranch Hand
Posts: 115
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


in this how charachters function work? what type of value in function argument???
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 115
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic