| Author |
order of event calling in SAX Parser
|
tushar jayawant
Greenhorn
Joined: Aug 20, 2003
Posts: 19
|
|
Hi to All I'am parsing the following XML file using the SAX parser <A> <B> <D>01243</D> </B> <C> <D>020</D> <E>Tushar1<E> <D>0122</D> <E>Tushar2</E> </C> </A> Q1) Did the SAX specification confirm the order of calling the SAX event i.e it call event in the following order a)startDoc b)startElement c)characters d)endElement e)endDocument Q2) Also did it navigate the XML file sequentially i.e first it call the event for <A> and then for <B> then for <D> and then for <C> and then again for <D> and then for <E>....... Thankx in Advance Tushar
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
Originally posted by tushar jayawant: Q1) Did the SAX specification confirm the order of calling the SAX event i.e it call event in the following order a)startDoc b)startElement c)characters d)endElement e)endDocument
Yes, the order is strictly sequential, although the parser is allowed to split a piece of text into multiple characters() events.
Originally posted by tushar jayawant: Q2) Also did it navigate the XML file sequentially i.e first it call the event for <A> and then for <B> then for <D> and then for <C> and then again for <D> and then for <E>...
Yes.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
 |
|
|
subject: order of event calling in SAX Parser
|
|
|