XML documents are always text - ie Strings. The SAX parser gives you events for the various components of your XML documents in terms of characters.
It makes no assumption about what int or double is.
IF you have text that represents numbers inside Nodes of type TEXT, the parser may call the characters() method once or multiple times - it is up to the programmer to collect the chunks of characters and decide what they represent when the entire element content has been collected.
It is a common error to take the results of one characters() call and assume you have the entire contents of the element.
Fred Victa wrote:The startXMLElement() method parses this tag to get the attribute. Can the parser call the startXMLElement() method more than once for that tag?
The SAX parser doesn't have any such method. However if you meant to ask about the startElement() method... well, I will let the API documentation for the method answer your question:
The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty).
The startXMLElement() method parses this tag to get the attribute.
No, it is important to keep this straight.
The SAX parser calls the startElement() method AFTER it has parsed the Element tag and all of the attiributes. As far as the parser is concerned, it is DONE at that point - after your custom startElement method returns, the parser continues.
Harold's free online book Processing XML with Java is loaded with examples.