You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/10/15 16:36:29 UTC

DO NOT REPLY [Bug 23840] New: - char[] in the character gets flooded

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23840>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23840

char[] in the character gets flooded

           Summary: char[] in the character gets flooded
           Product: Xerces-J
           Version: 1.4.4
          Platform: Sun
        OS/Version: Linux
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: ckamalakannan@netscape.net


In the DefaultHandler class , i am using the characters() by overriding it .
It is notified when the characters in the xml . But once the array reaches it 
max size 2048 . it recreates the array .ie.., a new array is created . The data 
in the previuos array is overwritten by the new array .

Ex: 

<sometag>want to display the name </sometag>

once the notification for the above is received with the values as follows

character(char ch[] ,int start ,int length )
1.) assume so far the ch[] is stored with 2042 characters .
2.) for this notification , the ch[] will have only the characters "want t" in 
the ch [].
3.) so in the next notification it will have the other part of the char "o 
display the name ". 
4.) so the previous value "want t" is missed .

One solution is to store the previous value "want t" in a temporary string and 
use them in the next notification .

But there is one issue we may not know when to use the previous value .
Because of 

* <sometag>want to display the name </sometag>
.
.
.
.
+ <sometag>show rollno</sometag>

1.) at * the ch[] may get exactly 2048 characters.
2.) Assume the next notification is at + . 
3.) then we should not use the prev.  value . Since it is esactly at the next 
notification.

So please investigate it and response me at ckamalakannan@netscape.net

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org