Beginning Python - From Novice to Professional
Beginning Python - From Novice to Professional Beginning Python - From Novice to Professional
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.
- Page 418 and 419: CHAPTER 19 ■ PLAYFUL PROGRAMMING
- Page 420: CHAPTER 19 ■ PLAYFUL PROGRAMMING
- Page 423 and 424: 392 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 425 and 426: 394 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 427 and 428: 396 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 429 and 430: 398 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 431 and 432: 400 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 433 and 434: 402 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 435 and 436: 404 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 437 and 438: 406 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 439 and 440: 408 CHAPTER 20 ■ PROJECT 1: INSTA
- Page 442 and 443: CHAPTER 21 ■ ■ ■ Project 2: P
- Page 444 and 445: CHAPTER 21 ■ PROJECT 2: PAINTING
- Page 446 and 447: CHAPTER 21 ■ PROJECT 2: PAINTING
- Page 448 and 449: CHAPTER 21 ■ PROJECT 2: PAINTING
- Page 450 and 451: CHAPTER 21 ■ PROJECT 2: PAINTING
- Page 452 and 453: CHAPTER 22 ■ ■ ■ Project 3: X
- Page 454 and 455: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 456 and 457: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 458 and 459: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 460 and 461: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 462 and 463: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 464 and 465: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 466 and 467: CHAPTER 22 ■ PROJECT 3: XML FOR A
- Page 470 and 471: CHAPTER 23 ■ ■ ■ Project 4: I
- Page 472 and 473: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 474 and 475: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 476 and 477: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 478 and 479: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 480 and 481: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 482 and 483: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 484: CHAPTER 23 ■ PROJECT 4: IN THE NE
- Page 487 and 488: 456 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 489 and 490: 458 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 491 and 492: 460 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 493 and 494: 462 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 495 and 496: 464 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 497 and 498: 466 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 499 and 500: 468 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 501 and 502: 470 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 503 and 504: 472 CHAPTER 24 ■ PROJECT 5: A VIR
- Page 505 and 506: 474 CHAPTER 25 ■ PROJECT 6: REMOT
- Page 507 and 508: 476 CHAPTER 25 ■ PROJECT 6: REMOT
- Page 509 and 510: 478 CHAPTER 25 ■ PROJECT 6: REMOT
- Page 511 and 512: 480 CHAPTER 25 ■ PROJECT 6: REMOT
- Page 514 and 515: CHAPTER 26 ■ ■ ■ Project 7: Y
- Page 516 and 517: CHAPTER 26 ■ PROJECT 7: YOUR OWN
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.