i've seen this behavior even without the entities within strings (characters() being called multiple times with separate parts of a string). it will happen if your strings are very long as well (say 256+ chars - ball park figure) so my question to the SAX/Xerces experts out there is - is it always possible for characters() to be called multiple times with different parts of the same string?
i assume the subsequent calls in your case, Andrew, is that you have an Entity between two Text parts, but i'm wondering if characters() will be called when, say, the current parsing buffer fills as well such that if a string is broken between two buffer loads characters() will be called twice - once for the first half and once for the second half of the string which would be loaded with the next chunk of the XML file. is this true? (i know the question is a rather rambling one, but it's the best i could do). ...............ron. -----Original Message----- From: Andrew McConnell [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 17, 2001 1:48 PM To: [EMAIL PROTECTED] Subject: SAX problem parsing ampersands, lts,gts,etc I'm sure that this has been asked a million times on the list, but I can't seem to get to the archive: I am using JDK 1.3 on Linux/Xerces 1.4.3 I am reading in a document that contains & characters and the like inside an element. eg: <tag>Dog & Cat</tag> The SAX parser is splitting up the contents, so that I get "Dog" in one call to characters(), and "&" in the next. I want characters() to give "Dog & Cat" to me in the same call. Is there a feature or a property of some sort that I need to set in the XMLReader. It seems like there ought to be a simple way to do this - but I'm stumped unless I've rewrite this piece of my application to be alot smarter than I think it needs to be! Thanks. -- Andrew McConnell Socketware, Inc. [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
