From 6cdb79e2a611d99fa6e13dd224a92dc8badaf2ac Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 9 Nov 2009 03:42:06 -0500 Subject: XML reporting now works via the "xml" command --- src/xml.cc | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to 'src/xml.cc') diff --git a/src/xml.cc b/src/xml.cc index 02fa7137..9cff980a 100644 --- a/src/xml.cc +++ b/src/xml.cc @@ -72,39 +72,12 @@ namespace { } void xml_transaction(std::ostream& out, const xact_t * xact) { - out << "\n"; - out << "" << xact->payee << "\n"; + to_xml(out, *xact); - foreach (const post_t * post, xact->posts) { + foreach (const post_t * post, xact->posts) if (post->has_xdata() && - post->xdata().has_flags(POST_EXT_VISITED)) { - out << "\n"; - out << "(post->account); - out << "\">" << post->account->fullname() << "\n"; - - out << "\n"; - to_xml(out, post->amount); - out << "\n"; - - out << "\n"; - if (post->cost) - to_xml(out, *post->cost); - else - to_xml(out, post->amount); - out << "\n"; - - if (post->assigned_amount) { - out << "\n"; - to_xml(out, *post->assigned_amount); - out << "\n"; - } - - out << "\n"; - } - } + post->xdata().has_flags(POST_EXT_VISITED)) + to_xml(out, *post); out << "\n"; } @@ -114,11 +87,12 @@ void format_xml::flush() { std::ostream& out(report.output_stream); - out << "\n\n\n"; + out << "\n"; + out << "\n"; out << "\n"; foreach (const commodities_pair& pair, commodities) { - to_xml(out, *pair.second); + to_xml(out, *pair.second, true); out << '\n'; } out << "\n"; @@ -132,7 +106,7 @@ void format_xml::flush() xml_transaction(out, xact); out << "\n"; - out << "\n\n"; + out << "\n"; out.flush(); } -- cgit v1.2.3