From: Steinar H. Gunderson Date: Tue, 3 Oct 2006 23:58:18 +0000 (+0200) Subject: Add PHP and Python variants of attribute-empty. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a604c8641fb4b2b6a6fb0bee599516d852907481;p=xml-template Add PHP and Python variants of attribute-empty. --- diff --git a/php/attribute-empty.php b/php/attribute-empty.php new file mode 100644 index 0000000..f778eda --- /dev/null +++ b/php/attribute-empty.php @@ -0,0 +1,10 @@ + '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 index 0000000..210bc0e --- /dev/null +++ b/python/attribute-empty.py @@ -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()