# -*- ruby -* # # Expanding a template with attributed text. # require 'xtemplate' THIS = XTemplate::TextNode data = { 'links' => [ {'@href' => 'http://www.foo.com/', THIS => 'foo.com'}, {'@href' => 'http://www.bar.com/', THIS => 'bar.com'}, {'@href' => 'http://www.foo.org/', THIS => 'foo.org'}, ], } text = < EOF t = XTemplate::XMLTemplate.new(text) print(t.expand(data))