]> git.sesse.net Git - xml-template/commitdiff
Add PHP and Python variants of attribute-empty.
authorSteinar H. Gunderson <sesse@debian.org>
Tue, 3 Oct 2006 23:58:18 +0000 (01:58 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Tue, 3 Oct 2006 23:58:18 +0000 (01:58 +0200)
php/attribute-empty.php [new file with mode: 0644]
python/attribute-empty.py [new file with mode: 0644]

diff --git a/php/attribute-empty.php b/php/attribute-empty.php
new file mode 100644 (file)
index 0000000..f778eda
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+require('xml-template.php');
+
+$doc = XML_Template_process_file('../xml/clone.xml', array(
+       'color' => 'blue',
+       '#things' => XML_Template_alternate('li/class', array(
+       ), array('odd', 'even'))
+));
+print $doc->dump_mem();
+?>
diff --git a/python/attribute-empty.py b/python/attribute-empty.py
new file mode 100644 (file)
index 0000000..210bc0e
--- /dev/null
@@ -0,0 +1,9 @@
+#! /usr/bin/python
+import xmltemplate
+
+doc = xmltemplate.process_file("../xml/clone.xml", {
+       "color": "blue",
+       "#things": xmltemplate.alternate("li/class", [
+       ], "odd", "even")
+});
+print doc.toxml()