Back to index

python3.2  3.2.2
Functions | Variables
minidom-example Namespace Reference

Functions

def getText
def handleSlideshow
def handleSlides
def handleSlide
def handleSlideshowTitle
def handleSlideTitle
def handlePoints
def handlePoint
def handleToc

Variables

string document
tuple dom = xml.dom.minidom.parseString(document)

Function Documentation

def minidom-example.getText (   nodelist)

Definition at line 21 of file minidom-example.py.

00021 
00022 def getText(nodelist):
00023     rc = []
00024     for node in nodelist:
00025         if node.nodeType == node.TEXT_NODE:
00026             rc.append(node.data)
00027     return ''.join(rc)

Here is the caller graph for this function:

def minidom-example.handlePoint (   point)

Definition at line 56 of file minidom-example.py.

00056 
00057 def handlePoint(point):
00058     print("<li>%s</li>" % getText(point.childNodes))

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handlePoints (   points)

Definition at line 50 of file minidom-example.py.

00050 
00051 def handlePoints(points):
00052     print("<ul>")
00053     for point in points:
00054         handlePoint(point)
00055     print("</ul>")

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleSlide (   slide)

Definition at line 40 of file minidom-example.py.

00040 
00041 def handleSlide(slide):
00042     handleSlideTitle(slide.getElementsByTagName("title")[0])
00043     handlePoints(slide.getElementsByTagName("point"))

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleSlides (   slides)

Definition at line 36 of file minidom-example.py.

00036 
00037 def handleSlides(slides):
00038     for slide in slides:
00039         handleSlide(slide)

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleSlideshow (   slideshow)

Definition at line 28 of file minidom-example.py.

00028 
00029 def handleSlideshow(slideshow):
00030     print("<html>")
00031     handleSlideshowTitle(slideshow.getElementsByTagName("title")[0])
00032     slides = slideshow.getElementsByTagName("slide")
00033     handleToc(slides)
00034     handleSlides(slides)
00035     print("</html>")

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleSlideshowTitle (   title)

Definition at line 44 of file minidom-example.py.

00044 
00045 def handleSlideshowTitle(title):
00046     print("<title>%s</title>" % getText(title.childNodes))

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleSlideTitle (   title)

Definition at line 47 of file minidom-example.py.

00047 
00048 def handleSlideTitle(title):
00049     print("<h2>%s</h2>" % getText(title.childNodes))

Here is the call graph for this function:

Here is the caller graph for this function:

def minidom-example.handleToc (   slides)

Definition at line 59 of file minidom-example.py.

00059 
00060 def handleToc(slides):
00061     for slide in slides:
00062         title = slide.getElementsByTagName("title")[0]
00063         print("<p>%s</p>" % getText(title.childNodes))
00064 
00065 handleSlideshow(dom)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

string minidom-example.document
Initial value:
00001 """\
00002 <slideshow>
00003 <title>Demo slideshow</title>
00004 <slide><title>Slide title</title>
00005 <point>This is a demo</point>
00006 <point>Of a program for processing slides</point>
00007 </slide>
00008 
00009 <slide><title>Another demo slide</title>
00010 <point>It is important</point>
00011 <point>To have more than</point>
00012 <point>one slide</point>
00013 </slide>
00014 </slideshow>
00015 """

Definition at line 3 of file minidom-example.py.

tuple minidom-example.dom = xml.dom.minidom.parseString(document)

Definition at line 19 of file minidom-example.py.