04.08.2014 Views

o_18ufhmfmq19t513t3lgmn5l1qa8a.pdf

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

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

424 CHAPTER 22 ■ PROJECT 3: XML FOR ALL OCCASIONS<br />

Listing 22-1. A Simple Web Site Represented As an XML File (website.xml)<br />

<br />

<br />

Welcome to My Home Page<br />

Hi, there. My name is Mr. Gumby, and this is my home page. Here<br />

are some of my interests:<br />

<br />

Shouting<br />

Sleeping<br />

Eating<br />

<br />

<br />

<br />

<br />

Mr. Gumby's Shouting Page<br />

...<br />

<br />

<br />

Mr. Gumby's Sleeping Page<br />

...<br />

<br />

<br />

Mr. Gumby's Eating Page<br />

...<br />

<br />

<br />

<br />

First Implementation<br />

At this point, we haven’t yet looked at how XML parsing works. The approach we are using here<br />

(called SAX) consists of writing a set of event handlers (just like in GUI programming) and then<br />

letting an existing XML parser call these handlers as it reads the XML document.

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

Saved successfully!

Ooh no, something went wrong!