#!/usr/bin/env python #================================================================ # crefrag: Fragment output testing for pyxml4.py. # For documentation, see: # http://www.nmt.edu/tcc/help/pubs/pyxml4/ #---------------------------------------------------------------- import xml4create as xc frag = xc.DocumentFragment() head = xc.Element ( frag, 'head' ) title = xc.Element ( head, 'title' ) xc.Text ( title, 'No title' ) body = xc.Element ( frag, 'body' ) h1 = xc.Element ( body, 'h1' ) xc.Text ( h1, 'No body either' ) frag.write()