diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-14 11:09:35 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:50 -0400 |
commit | 687ee1a7c34f7484b715ac6d88b84a980247f6ac (patch) | |
tree | f2e80f612c4250645ac0c4ca5fb7a7da9051401e /src/node.cc | |
parent | 59fc3d1bdb01b7195a0f9745fe9914ac31b8a3a5 (diff) | |
download | ledger-687ee1a7c34f7484b715ac6d88b84a980247f6ac.tar.gz ledger-687ee1a7c34f7484b715ac6d88b84a980247f6ac.tar.bz2 ledger-687ee1a7c34f7484b715ac6d88b84a980247f6ac.zip |
document_builder_t is now working.
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/node.cc b/src/node.cc index 390ef988..f19b5989 100644 --- a/src/node.cc +++ b/src/node.cc @@ -60,17 +60,22 @@ void output_xml_string(std::ostream& out, const string& str) } } -void parent_node_t::print(std::ostream& out) const +void node_t::print_attributes(std::ostream& out) const { - out << '<' << name(); if (attributes) { typedef attributes_t::nth_index<0>::type attributes_by_order; foreach (const attr_pair& attr, attributes->get<0>()) - out << ' ' << document().lookup_name(attr.first) + out << ' ' << *document().lookup_name(attr.first) << "=\"" << attr.second << "\""; } IF_VERIFY() out << " type=\"parent_node_t\""; +} + +void parent_node_t::print(std::ostream& out) const +{ + out << '<' << name(); + print_attributes(out); out << '>'; foreach (node_t * child, *this) @@ -83,13 +88,11 @@ void terminal_node_t::print(std::ostream& out) const { if (data.empty()) { out << '<' << name(); - IF_VERIFY() - out << " type=\"terminal_node_t\""; + print_attributes(out); out << " />"; } else { out << '<' << name(); - IF_VERIFY() - out << " type=\"terminal_node_t\""; + print_attributes(out); out << '>'; output_xml_string(out, text()); out << "</" << name() << '>'; |