35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/odf/text.rb', line 35
def xml
b = Builder::XmlMarkup.new
b.instruct! :xml, :version => '1.0', :encoding => 'UTF-8'
b.tag! 'office:document-content', 'xmlns:office' => "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
'xmlns:table' => "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
'xmlns:text' => "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
'xmlns:oooc' => "http://openoffice.org/2004/calc",
'xmlns:style' => "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
'xmlns:fo' => "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
'xmlns:xlink' => "http://www.w3.org/1999/xlink" do
|xml|
xml.tag! 'office:styles' do
xml << default_styles_xml
end unless default_styles.empty?
xml.tag! 'office:automatic-styles' do
xml << styles_xml
xml << page_layouts_xml
end unless styles.empty? && page_layouts.empty?
xml.tag! 'office:master-styles' do
xml << master_pages_xml
end unless master_pages.empty?
xml.office:body do
xml.office:text do
xml << paragraphs_xml
end
end
end
end
|