• 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

Java SAX XML parser suppresses the specific element value (number datatype)

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

We are using SAX XML parser Handler (org.xml.sax.XMLReader) for read the xml file.

But some times it suppresses the specific element value (number datatype 10 digit column) as below (not all the times).


Actaul Value --> Supress value while parsing
---------------------- ----------------------
1234567890 --> 67890 (last 5 giti)

1234567890 --> 0

We have tried to find the problem, where it is exactly occurred. But we couldnot.

Please send your comments for this? It is very urgent and important.


Details: Server --> AIX
JDK--> 1.4
Jar name -->dom4j-full.jar



Thanks & Regards
Muthu
 
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
The parser is not "suppressing" anything - you are using it wrong.

Your symptoms are exactly what you get when you assume that the characters() method ALWAYS gets the full text content. Wrong!

Due to the way the parser works, using only the current buffer of XML text, characters() may get any number of characters. You must accumulate characters until the endElement event, and only then attempt to interpret the collected characters.

Bill

 
reply
    Bookmark Topic Watch Topic
  • New Topic