Validating SAX parser still reads whitespace/does strange things.

B

badgerduke

I had an operable SAX parser running on WebSphere 4.0 which I
transferred to run on Tomcat 5.x. This broke the parser. It still
validates against a schema ( I am using Xerces with an XMLReader).
Among the strange behavior . . . characters() methods sometimes take in
a char array of length 2048 (2k). The whitespace after the end of each
element is not ignored (it fires characters()). It is not before too
long that a NumberFormatException occurs and my parser stops cold.

I am not allowed to show code here, but I hope somebody relates to this
erratic behavior. I have considered a conflict but haven't found it if
it exists.
 
H

Harish

check the classpath, and make sure that the xerces parser getting picked up
is the correct version.
i guess u r using the xerces that comes with websphere 4.0 or tomact 5.x
if thats the case, then probably the version of Xerces is different in these
two.

Also most of the SAX parsers say characters() can be called multiple times
and
the programmer should store and concatenate these mulitple calls to get the
actual string.

there is a property by which you can set the "ignorewhitespace".
perhaps the version of Xerces in WebSphere4.0 ignores white space by default
but the one in tomcat 5.x doesn't?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top