]> git.sesse.net Git - xml-template/commitdiff
Add a skeleton python version.
authorsgunderson@bigfoot.com <>
Wed, 6 Sep 2006 14:42:36 +0000 (16:42 +0200)
committersgunderson@bigfoot.com <>
Wed, 6 Sep 2006 14:42:36 +0000 (16:42 +0200)
python/simple.py [new file with mode: 0644]
python/xmltemplate.py [new file with mode: 0644]

diff --git a/python/simple.py b/python/simple.py
new file mode 100644 (file)
index 0000000..7c78ed0
--- /dev/null
@@ -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 (file)
index 0000000..e22d0f8
--- /dev/null
@@ -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