From 382a33ce4b19ccc9b6f89268a0de17eeac63f559 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Tue, 6 Jul 2010 12:23:48 +0000 Subject: docs: Added contents-based traversal documentation, minor spelling fix git-svn-id: http://pugixml.googlecode.com/svn/trunk@562 99668b35-9821-0410-8761-19e4c4f06640 --- docs/samples/traverse_base.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'docs/samples') diff --git a/docs/samples/traverse_base.cpp b/docs/samples/traverse_base.cpp index 6f82caa..7559859 100644 --- a/docs/samples/traverse_base.cpp +++ b/docs/samples/traverse_base.cpp @@ -39,16 +39,11 @@ int main() std::cout << std::endl; //[code_traverse_base_contents + std::cout << "Tool for *.dae generation: " << tools.find_child_by_attribute("Tool", "OutputFileMasks", "*.dae").attribute("Filename").value() << "\n"; + for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool")) { - std::cout << "Tool " << tool.attribute("Filename").value() << ":"; - - for (pugi::xml_attribute attr = tool.first_attribute(); attr; attr = attr.next_attribute()) - { - if (strcmp(attr.name(), "Filename") != 0) std::cout << " " << attr.name() << "=" << attr.value(); - } - - std::cout << std::endl; + std::cout << "Tool " << tool.attribute("Filename").value() << "\n"; } //] } -- cgit v1.2.3