• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in Characters() method in SaxParsing

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to parse a big xml using SAXparser. But the problem whats happening is that the content gets truncated at random.

And the problem is happening at the characters method of SAXPArser.
Below is the code that I used in my characters() method:



When I log the the value of 'sTagValue' in the above code,I could see that value is getting truncated at random.

Any help appreciated.

Thanks in advance
Priby
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This looks like the FAQ where the answer is that the parser is allowed to split a text node into pieces and call the characters() method once for each piece. It looks to me as if you have a flag that causes your code to only process the first of these pieces. Remove that and you will see the normal behaviour.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is all covered in the JavaDocs for the characters() method.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic