On Jan 26, 2008 5:11 PM, Stanimir Stamenkov <[EMAIL PROTECTED]> wrote:
> You example is obviously wrong.  You need to honor the 'start' and
> 'length' parameters passed to the 'characters' callback when
> constructing a String out of the given 'ch':

Thank you very much for correcting my mistake.

> Where do you see character callbacks in between the start and end
> element callbacks for the "pqr" and "uvw" elements?

With the XML document:
<root>
  <abc>hello</abc>
  <pqr/>
  <uvw/>
</root>

The program I posted (with your fix, new String(ch,start,length)),
produces the output:
-----start element-----
##
##
#root#
!-----start element-----!
------characters------


!------characters------!
-----start element-----
##
##
#abc#
!-----start element-----!
------characters------
hello
!------characters------!
------end element------
##
##
#abc#
!------end element------!
------characters------


!------characters------!
-----start element-----
##
##
#pqr#
!-----start element-----!
------end element------
##
##
#pqr#
!------end element------!
------characters------


!------characters------!
-----start element-----
##
##
#uvw#
!-----start element-----!
------end element------
##
##
#uvw#
!------end element------!
------characters------


!------characters------!
------end element------
##
##
#root#
!------end element------!

This looks perfectly ok to me.

(you wrote correctly that System.out.println(...) adds an extra newline).


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to