help='Display version information, then exit.') args0 = parser.parse_args() return args0 ########################################################################### # args = processOptions() warn(0, "Patching extensions onto xml.dom.minidom.Node...") Node.__getitem__ = PyNode.__getitem__ Node._getChildNodesByName_ = PyNode._getChildNodesByName_ Node._getListItemsByName_ = PyNode._getListItemsByName_ theDocEl = Document() theDocEl.nodeName = "book" print("Document nodeName is '%s'." % (theDocEl.nodeName)) body = theDocEl.createElement("body") theDocEl.appendChild(body) print("body element nodeName is '%s'." % (body.nodeName)) nParas = 10 for i in range(nParas): e = theDocEl.createElement("p") e.setAttribute("id", "myId_%2d" % (i)) e.appendChild(theDocEl.createTextNode("This is a some text.")) body.appendChild(e) print("Sample document created.") for i in range(0, nParas, 2):