-->
include xml.e
sequence contents = {}
for r=0 to 3 do
sequence rowcontent = {}
string thtd = iff(r=0?"th":"td")
for c=0 to 3 do
string content = iff(r=0?"XYZ"[max(1,c)..c]:
sprintf("%d",iff(c=0?r:rand(9999))))
sequence col = xml_new_element(thtd,content)
col = xml_set_attribute(col,"style","text-align:right; padding: 5px;")
rowcontent = append(rowcontent,col)
end for
sequence row = xml_new_element("tr",rowcontent)
contents = append(contents,row)
end for
sequence table = xml_new_element("table",contents)
table = xml_set_attribute(table, "border", "2")
sequence doc = xml_new_doc(table,"")
puts(1,xml_sprint(doc))