Next / Previous / Contents / TCC Help System / NM Tech homepage

14. xml4create.py: The source code

Now we move on to the design of the xml4create.py module. Design goals include:

To solve the factory method access problem, the module uses these links between objects so that any node in the tree can get to the factory functions it needs:

14.1. Prologue to xml4create.py

Now, on to the actual source code of the xml4create.py module. First is a prologue that gives the module's documentation string:

xml4create.py
"""xml4create.py:  For creating XML files from scratch.

For full documentation, see:
    http://www.nmt.edu/tcc/help/pubs/pyxml4/
"""

Next, the imports. We need the sys module so we can access the standard output stream, sys.stdout. Then we'll need the domlette to handle the XML functions.

xml4create.py
#================================================================
# Imports
#----------------------------------------------------------------

import sys
import Ft.Xml.Domlette as domlette