dcsimg
How to force SAX parser to handle large character array when calling characters?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aggie_Chan
Posted On:   Wednesday, March 27, 2002 12:39 AM

Since I used SAX to parser an XML file, I found one bottle neck in calling characters(char[] buf, int offset, int length). The size of character array always between 78 and 120 when calling characters().
How to increse the size of character array when call the method?
Thanks.

Re: How to force SAX parser to handle large character array when calling characters?

Posted By:   Christopher_Schultz  
Posted On:   Wednesday, March 27, 2002 05:46 AM

The SAX parser will call your characters method whenever it finds strings of contiguous characters. If you have an entity like & in your text, then you'll get three calls to characters: one for the first part of the text, one for the '&' character, and one for the remaining characters.



I don't think you can change the way this occurs.



If you want to use DOM, you won't have to worry about this, but, then again, DOM uses SAX, so there's no performance benefit.



Although XML is sexy and everything, nobody uses it if they think performance is an issue.



-chris
About | Sitemap | Contact