<title>Demo slideshow</title>
<slide><title>Slide title</title>
<point>This is a demo</point>
<point>Of a program for processing slides</point>
<slide><title>Another demo slide</title>
<point>It is important</point>
<point>To have more than</point>
dom = xml.dom.minidom.parseString(document)
if node.nodeType == node.TEXT_NODE:
def handleSlideshow(slideshow):
handleSlideshowTitle(slideshow.getElementsByTagName("title")[0])
slides = slideshow.getElementsByTagName("slide")
def handleSlides(slides):
handleSlideTitle(slide.getElementsByTagName("title")[0])
handlePoints(slide.getElementsByTagName("point"))
def handleSlideshowTitle(title):
print "<title>%s</title>" % getText(title.childNodes)
def handleSlideTitle(title):
print "<h2>%s</h2>" % getText(title.childNodes)
def handlePoints(points):
print "<li>%s</li>" % getText(point.childNodes)
title = slide.getElementsByTagName("title")[0]
print "<p>%s</p>" % getText(title.childNodes)