]> git.sesse.net Git - xml-template/blobdiff - ruby/attribute.rb
Hand-merge from borked repository. Main changes are a Ruby version (with
[xml-template] / ruby / attribute.rb
diff --git a/ruby/attribute.rb b/ruby/attribute.rb
new file mode 100644 (file)
index 0000000..d636555
--- /dev/null
@@ -0,0 +1,13 @@
+#! /usr/bin/ruby
+require "xmltemplate"
+
+doc = XMLTemplate.process_file("../xml/clone.xml", {
+       'color' => 'red',
+       '#things' => [
+               { 'li' => 'Raindrops on roses',    'li/class' => 'odd' },
+               { 'li' => 'Whiskers on kittens',   'li/class' => 'even' },
+               { 'li' => 'Bright copper kettles', 'li/class' => 'odd' },
+               { 'li' => 'Warm, woolen mittens',  'li/class' => 'even' }
+       ]
+});
+print doc.to_s