A Slide-Show Presentation
Many programs let you build presentations, the biggest and best-known of which is Microsoft’s Powerpoint. In this section we develop a program that transforms an XML file describing a slide-show presentation (slides, bullet items, etc.) into an SVG file that is the presentation.
The input file consists of a collection of any of the following six tags:
<slideshow>The top-level tag
<slide>A new slide in the sequence
<block>A block can be either a line of text or a bullet list
<bulletlist>A group of
<bullet>elements<bullet>An indented line of text with a bullet prepended
<image>An image to place in the upper left corner of the slide
A complete slide show file written in this format looks like Example 6-1.
<slideshow subdir="./slideshow1/"> <slide title="Perl for Graphics"> <image>http://shawn.apocabilly.org/PFG/examples/shawn.png </image> <block type="textline">Section I: File Formats</block> <block type="bulletlist"> <bullet>1. Raster Graphics Formats</bullet> <bullet>2. Efficient Multimedia with SWF</bullet> <bullet>3. The SVG format</bullet> <bullet>4. Printing with PostScript and PDF</bullet> </block> <block type="textline">Section II: Tools</block> ... </slide> <slide title="Chapter 1"> <image>http://shawn.apocabilly.org/PFG/examples/shawn.png </image> <block type="textline">Web Graphics Basics</block> <block type="bulletlist"> <bullet>Fields and Streams</bullet> <bullet>Color tables</bullet> <bullet>Transparency and alpha</bullet> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access