• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with SAXParser

 
Balaji Natarajan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using Saxparser with weblogic 8.1 and JDK 1.4 .
One of the tags is getting parsed twice and the value in the field gets split into 2 separate values.
Whereas with weblogic7.0 , the same works fine.
Are there any known issues related to compatility with weblogic 8 and jdk 1.4?

Thanks in advance,
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
value in the field gets split into 2 separate values.

I hope you have considered the case where the characters method could be invoked multiple times.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think such kind of version-related questions about WebLogic is suitable for the WebLogic Forum. It is more likely that u will get the best solution for your question related to WebLogic Version there in that forum... All the best..
 
Balaji Natarajan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Pradeep.. the characters() method is called twice for the same tag.
I wd try to post this in the weblogic forum too.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balaji, there is absolutely no guarantee that a SAX parser will invoke the characters() method only once for any text "field". You should simply be prepared for receiving multiple invocations of characters(), appending to a StringBuffer etc.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For characters method, from the API
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Balaji Natarajan:
I wd try to post this in the weblogic forum too.

I suggest if you post in the WebLogic forum, that you post a link to this question in that post. We discourage duplicate posts here at JavaRanch. It can become very confusing very quickly.
[ February 26, 2004: Message edited by: Marilyn de Queiroz ]
 
Balaji Natarajan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all your inputs. Now i have changed the characters of method to check for multiple parses and is working fine..
Sorry i by mistake have posted the same query in weblogic forum !! Will avoid that in my future posts ...
Thanks a lot again..
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yesterday night, I found a good example of the characters( ) implementation in this article. Explains why and how to implement it.
Although, your issue is solved thought this would help anyone else who is curious....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic