This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Event calling for characters method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Event calling for characters method" Watch "Event calling for characters method" New topic
Author

Event calling for characters method

tushar jayawant
Greenhorn

Joined: Aug 20, 2003
Posts: 19
Hi to all

Thankx a lot for the prev mail reply . i have one more doubt

The SAX specifiction say that


public void characters(char[] ch, int start, int length)

method does not send all the characters between a start and end tag will be sent in one go. The spec doesn't constrain SAX parsers to this

now suppose i have on element like

<A> abcxyz</A>

so if in the first call of the characters method if it send only "abc" then whether the next event again call the characters method and this time
it send the remaining character "xyz"


Thankx in advance
Tushar
Sathya Sankar
Ranch Hand

Joined: Sep 16, 2000
Posts: 67
Tushar,
Yes you are correct. The parser will read a chunk of data and invoke the characters(char[], int, int) method. It'd then continue reading from where it left off, read one more chunk and call the same method. This goes on till it reads the complete data.

The chunk of data read varies from parser to parser. Xerces reads 8KB of character data for each method call.

Ciao,
GSS


SCJP, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
tushar jayawant
Greenhorn

Joined: Aug 20, 2003
Posts: 19
Hi
Sathya Sankar ,thankx a lot for the reply .........

Tushar Kandlagaonkar

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Event calling for characters method
 
Similar Threads
order of event calling in SAX Parser
loading 2D array
sax parsing problem
SAX parser issue,character call back method being called twice
SAX parser's characters[] method