35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/slaw/grammars/tables_nodes.rb', line 35
def to_xml(b, idprefix)
tag = text_value[0] == '!' ? 'th' : 'td'
attrs = {}
if not attribs.empty?
for item in attribs.attribs.elements
attrs[item.name.text_value.strip] = item.value.text_value[1..-2]
end
end
b.send(tag.to_sym, attrs) { |b|
b.p { |b|
lines = [content.line] + content.elements.last.elements.map(&:line)
lines.each_with_index do |line, i|
line.to_xml(b, i, i == lines.length-1)
end
}
}
end
|