#!/usr/bin/env python #================================================================ # crens: Namespace output testing for pyxml4.py. # For documentation, see: # http://www.nmt.edu/tcc/help/pubs/pyxml4/ #---------------------------------------------------------------- import xml4create as xc nsMap = { None: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", "xsl": "http://www.w3.org/1999/XSL/Transform", "exsl": "http://exslt.org/common" } doc = xc.Document ( "xsl:stylesheet", nsMap=nsMap ) doc.root['version'] = '1.0' template = xc.Element ( doc.root, 'xsl:template', match='foo' ) subdoc = xc.Element ( template, 'exsl:document', href='outer.html' ) hr = xc.Element ( subdoc, 'hr' ) hr['exsl:class'] = 'silly' doc.write()