: Xerces-J 2.3.0 now available 2003-01-31 - By Joseph Kesselman
> how can i change the characters value while parsing using SAX > <name > nameOne</name> > how would i change it to > <name > nameTwo</name> > without really constructing a string buffer.
If you want to discard the old value without looking at it, you could do that without constructing a buffer.
If you want to find out whether the value was nameOne before changing it to nameTwo, you may need a buffer. As Andy pointed out, you may get the data as two separate events; if the first contains "nam", you don't know whether that will be followed by "eOne"... or "eO" and "ne", for that matter.
You *might* be able to do something based on recording how many characters matched the programmed constant before a mismatch was found, and re-issue them from the constant rather than from the input. This would avoid buffering. It would also yield fairly ugly code, especially if there are several values you're looking for and particularly if some of them start with the same substring. If you've run serious performance tests and know that buffering is a major bottleneck (unlikely!), you could try this approach and see if it helps (also unlikely!).
______________________________________ Joe Kesselman / IBM Research
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|