From a604c8641fb4b2b6a6fb0bee599516d852907481 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 4 Oct 2006 01:58:18 +0200 Subject: [PATCH] Add PHP and Python variants of attribute-empty. --- php/attribute-empty.php | 10 ++++++++++ python/attribute-empty.py | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 php/attribute-empty.php create mode 100644 python/attribute-empty.py 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() -- 2.39.2