Beginning Python - From Novice to Professional

Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional

16.01.2014 Views

CHAPTER 22 ■ PROJECT 3: XML FOR ALL OCCASIONS 437 Further Exploration Now you’ve got the basic program. What can you do with it? Here are some suggestions: • Create a new ContentHandler for creating a table of contents or a menu (with links) for the Web site. • Add navigational aids to the Web pages that tell the user where (in which directory) he or she is. • Create a subclass of WebsiteConstructor that overrides writeHeader and writeFooter to provide customized design. • Create another ContentHandler that constructs a single Web page from the XML file. • Create a ContentHandler that summarizes your Web site somehow, for example in RSS (see Chapter 15). • Check out other tools for transforming XML, especially XSLT (see http://www.w3.org/ TR/xslt and http://www.4suite.org). • Create one or more PDF documents based on the XML file, using a tool such as ReportLab’s Platypus (http://reportlab.org). • Make it possible to edit the XML file through a Web interface (see Chapter 25). What Now? After this foray into the world of XML parsing, let’s do some more network programming. In the next chapter, you create a program that can gather news items from various network sources (such as Web pages and Usenet groups) and generate custom news reports for you.

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

Further Exploration<br />

Now you’ve got the basic program. What can you do with it? Here are some suggestions:<br />

• Create a new ContentHandler for creating a table of contents or a menu (with links) for<br />

the Web site.<br />

• Add navigational aids <strong>to</strong> the Web pages that tell the user where (in which direc<strong>to</strong>ry) he or<br />

she is.<br />

• Create a subclass of WebsiteConstruc<strong>to</strong>r that overrides writeHeader and writeFooter <strong>to</strong><br />

provide cus<strong>to</strong>mized design.<br />

• Create another ContentHandler that constructs a single Web page from the XML file.<br />

• Create a ContentHandler that summarizes your Web site somehow, for example in RSS<br />

(see Chapter 15).<br />

• Check out other <strong>to</strong>ols for transforming XML, especially XSLT (see http://www.w3.org/<br />

TR/xslt and http://www.4suite.org).<br />

• Create one or more PDF documents based on the XML file, using a <strong>to</strong>ol such as<br />

ReportLab’s Platypus (http://reportlab.org).<br />

• Make it possible <strong>to</strong> edit the XML file through a Web interface (see Chapter 25).<br />

What Now?<br />

After this foray in<strong>to</strong> the world of XML parsing, let’s do some more network programming. In the<br />

next chapter, you create a program that can gather news items from various network sources<br />

(such as Web pages and Usenet groups) and generate cus<strong>to</strong>m news reports for you.

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

Saved successfully!

Ooh no, something went wrong!