When are the startElement characters StopElement methods called in the DefaultHel开发者_开发百科per class of in android?
The package name of the class is org.xml.sax.helpers.DefaultHandler
<pussy> cat </pussy>
When the xml parser comes across the tag <pussy>
, startElement() is called
and when the parser detects </pussy>
stopElement() is called.
The function characters() is called with the data "cat
"
I figured that even after encountering </pussy> , the method character is called.
The characters()
method is most probably called the second time (after stopElement()
) because there is a whitespace (e.g. newline) character after </pussy>
.
Try putting your test XML all on one line to see if it makes any change.
<element>
This is character. or may be another elements and it's character.
</element>
startElement(..) will be called when any new xml tag get start like and endElement(..) will be called when an element is ended
精彩评论