Re: Class WbxmlParser: Not all text reported by nextText()
Stefan Haustein <[email protected]> Mon, 08 Dec 2003 15:02:49 +0100
| Newsgroups | gmane.comp.java.enhydra.kxml |
|---|---|
| Message-ID | <[email protected]> |
Hi Eric, thanks for the fix. I have changed the code accordingly and committed the changes to the sourceforge kxml CVS repository. Best regards, Stefan Eric Vuillermet wrote: > > If you encode the following xml: <xyz>hello&world</xyz> into wbxml > and read the wbxml back using nextText() only "hello" gets returned by > nextText(), not "hello&world" as expected. > > I think I found what the problem is. In wbxmlparser.java, the following > line: > if (save != null) text = text != null ? save : save + text; > > should read instead: > if (save != null) text = text == null ? save : save + text; > > This is because if the variable text is null, you want to assign the > content of save of it, but if the variable text is not null, you want to > prepend the content of save to the variable text. > > Eric > > _________________________________________________________________ > Take advantage of our best MSN Dial-up offer of the year -- six months > @$9.95/month. Sign up now! http://join.msn.com/?page=dept/dialup >