From: sgunderson@bigfoot.com <> Date: Wed, 6 Sep 2006 14:42:36 +0000 (+0200) Subject: Add a skeleton python version. X-Git-Url: https://git.sesse.net/?p=xml-template;a=commitdiff_plain;h=0c6a8f8212f9ecca08848956f5a493ccb4311054 Add a skeleton python version. --- diff --git a/python/simple.py b/python/simple.py new file mode 100644 index 0000000..7c78ed0 --- /dev/null +++ b/python/simple.py @@ -0,0 +1,8 @@ +#! /usr/bin/python +import xmltemplate + +doc = xmltemplate.process_file("../xml/simple.xml", { + 'title': 'A very basic example', + '#hello': 'Hello world!' +}) +print doc.toxml() diff --git a/python/xmltemplate.py b/python/xmltemplate.py new file mode 100644 index 0000000..e22d0f8 --- /dev/null +++ b/python/xmltemplate.py @@ -0,0 +1,10 @@ +#! /usr/bin/python +import xml.dom.minidom + +def process_file(filename, obj, clean = False): + doc = xml.dom.minidom.parse("../xml/simple.xml") + process(doc, obj, clean) + return doc + +def process(node, obj, clean): + pass