• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Firing of Character method of Defualt Handler

 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic