in spec, all fail).
--- /dev/null
+#! /usr/bin/perl
+use XML::Template;
+
+my $doc = XML::Template::process_file('../xml/clone.xml', {
+ 'color' => 'blue',
+ '#things' => XML::Template::alternate('li/class', [
+ { 'li' => 'Raindrops on roses' },
+ { 'li' => 'Whiskers on kittens' },
+ undef,
+ { 'li' => 'Bright copper kettles' },
+ { 'li' => 'Warm, woolen mittens'},
+ ], 'odd', 'even')
+});
+print $doc->toString;
--- /dev/null
+<?php
+require('xml-template.php');
+
+$doc = XML_Template_process_file('../xml/clone.xml', array(
+ 'color' => 'blue',
+ '#things' => XML_Template_alternate('li/class', array(
+ array( 'li' => 'Raindrops on roses' ),
+ array( 'li' => 'Whiskers on kittens' ),
+ NULL,
+ array( 'li' => 'Bright copper kettles' ),
+ array( 'li' => 'Warm, woolen mittens' ),
+ ), array('odd', 'even'))
+));
+print $doc->dump_mem();
+?>
--- /dev/null
+#! /usr/bin/python
+import xmltemplate
+
+doc = xmltemplate.process_file("../xml/clone.xml", {
+ "color": "blue",
+ "#things": xmltemplate.alternate("li/class", [
+ { "li": "Raindrops on roses" },
+ { "li": "Whiskers on kittens" },
+ None,
+ { "li": "Bright copper kettles" },
+ { "li": "Warm, woolen mittens"},
+ ], "odd", "even")
+});
+print doc.toxml()
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>Cloning test</title>
+ </head>
+ <body>
+ <p>My favourite color is blue; I like that very much.
+ All my favourite things:</p>
+ <ul>
+ <li class="odd">Raindrops on roses</li>
+ <li class="even">Whiskers on kittens</li>
+ <li class="odd">Bright copper kettles</li>
+ <li class="even">Warm, woolen mittens</li>
+ </ul>
+ </body>
+</html>
#! /bin/sh
if [ -z "$TESTS" ]; then
- TESTS="passthru simple clone include attribute attribute2 attribute-empty"
+ TESTS="passthru simple clone include attribute attribute2 attribute3 attribute-empty"
fi
if [ -z "$LANGUAGES" ]; then
LANGUAGES="perl php python"