# -*- ruby -*-
#
# Adding a sub-template
#

require 'xtemplate'

data ={
  'names' => ["name1", "name2", "name3"]
}

text1 = <<EOF
<?xml version="1.0"?>
<html xmlns:xt="#{XTemplate::BIND_URI}">
<body>
<xt:template name="itemize" />
</body>
</html>
EOF

text2 = <<EOF
<?xml version="1.0"?>
<xt:template name="itemize" xmlns:xt="#{XTemplate::BIND_URI}">
<ol>
  <li xt:id="names" />
</ol>
</xt:template>
EOF

t1 = XTemplate::XMLTemplate.new(text1)
t2 = XTemplate::XMLTemplate.new(text2)
t1['itemize'] << t2['itemize'].dup
print(t1.expand(data),"\n")
