10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note that next() just returns an integer constant corresponding to underlying<br />

event where the parser is positioned. <strong>The</strong> application needs to call the relevant function to get<br />

more information related to the underlying event.<br />

You can imagine this approach as a virtual cursor moving across the XML input stream. <strong>The</strong>re<br />

are various accessor methods which can be called when that virtual cursor is at a particular<br />

event.<br />

Stepping through Events<br />

In this example, the client application pulls the next event in the XML stream by calling the next<br />

method on the parser; for example:<br />

try {<br />

for(inti=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!