27 #ifndef SCRIBO_IO_XML_SAVE_HH
28 # define SCRIBO_IO_XML_SAVE_HH
40 # include <scribo/core/document.hh>
43 # include <scribo/io/xml/internal/full_xml_visitor.hh>
46 # include <scribo/io/xml/internal/extended_page_xml_visitor.hh>
47 # include <scribo/io/xml/internal/page_xml_visitor.hh>
86 save(
const document<L>& doc,
const std::string& output_name,
90 # ifndef MLN_INCLUDE_ONLY
97 void save_page(
const document<L>& doc, std::ofstream& output)
103 template <
typename L>
104 void save_page_extended(
const document<L>& doc, std::ofstream& output)
111 template <
typename L>
112 void save_full(
const document<L>& doc, std::ofstream& output)
125 template <
typename L>
127 save(
const document<L>& doc,
128 const std::string& output_name,
131 mln_trace(
"scribo::io::xml::save");
133 mln_precondition(doc.is_open());
136 std::ofstream output(output_name.c_str());
139 std::cerr <<
"scribo::io::xml::save - ERROR: cannot open file '"
140 << doc.filename() <<
"'!";
148 internal::save_page(doc, output);
152 internal::save_page_extended(doc, output);
157 internal::save_full(doc, output);
162 mln_trace_warning(
"scribo::io::xml::save - "
163 "Invalid XML format! Skip saving...");
170 # endif // ! MLN_INCLUDE_ONLY
179 #endif // ! SCRIBO_IO_XML_SAVE_HH