• 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

Firing of Character method of Defualt Handler

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written SAX parser to parse XML document.
Which has been working on my local machine having Windows platform.

When I moved the same code to our Unix box it behaves different.

For document like this --

<?xml version="1.0" encoding="UTF-8"?>
<root>
<EMP>
<EMP_ID>201188</EMP_ID>
<CREATED_DT>2005-04-14T07:05:09.257</CREATED_DT>
<LAST_MOD_DT>2005-04-14T07:05:09.257</LAST_MOD_DT>
</EMP>
</root>

public void characters( ... )
method is fired for <EMP>
in windows.
Where as on Unix this method is not fired.

Why this inconsustency?
Work around other than changing the code?

Thanks
Gemini
 
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
Presumably the parser on Unix is "ignoring" whitespace - namely the crlf right after the EMP element.
Bill
 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your are right. But can I know why is it ignoring it in Unix and not in Windows.

This is needing me to change my code significantly!!

Your inputs are appreciated.

Thanks!
Gemini
 
William Brogden
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
I would guess that the parser is reading some default settings - possibly environment values, and that these are not the same in the two systems? Since you don't say anything about the Java version or where the SAX parser is coming from, thats about all I can say.
Bill
 
No thanks. We have all the government we need. This tiny ad would like you to leave now:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic