> XML
[...]
> <data1 a="v">some data & one attribute</data1>
[...]
> Output
[...]
> startElement:
> attribute: ="v"
> characters: some data
> characters: &
> characters: one attribute
> endElement
[...]
> what i dont understand here is , in above why the characters are
>
[quoted text clipped - 5 lines]
>
> why there are 3 lines for it ?
Because it is easier for the parser.
> how do i know under which character , the characters will be broken and
> will make 3 lines as above ?
You can't know. :-(
The parsers are free to do it as they like. That means the parser may do
it in a way that is easiest for *him*, but not easiest for *you*.
The justification is in the API docs of ContentHandler.chars() at
<http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html#characte
rs(char[],%20int,%20int)>
<QUOTE>
SAX parsers may return all contiguous character data in a single chunk,
or they may split it into several chunks;
</QUOTE>
So you have to cope with possibly multiple chunks of characters (i.e.
reassemble them somehow).

Signature
Thomas
gk - 21 Nov 2006 04:10 GMT
> > XML
> [...]
[quoted text clipped - 39 lines]
> --
> Thomas
nicely spoken.
but the parser is running some algo ...right ? or it is really randomly
breaking chars !
the parser might be abiding some rules or algo to do this taks ....is
not it ?
may be parser has this algo ...
If parser finds "amp' the break chars
if parser finds ";" the break chars
some sort of like this ....
or it is a whimsical parser !
Ian Wilson - 21 Nov 2006 11:27 GMT
>>> XML
>>
[quoted text clipped - 50 lines]
>
> or it is a whimsical parser !
Code as if it is whimsical and capricious and all will be well.