From f3ef88386c3d82e3cbc51e0b7c11958d09a43ea1 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 11 Oct 2009 08:40:11 +0000 Subject: traverse now sets depth to -1 for both begin() and end() git-svn-id: http://pugixml.googlecode.com/svn/trunk@146 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index d214307..3a01c27 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -2588,7 +2588,7 @@ namespace pugi bool xml_node::traverse(xml_tree_walker& walker) { - walker._depth = 0; + walker._depth = -1; if (!walker.begin(*this)) return false; @@ -2596,6 +2596,8 @@ namespace pugi if (cur) { + ++walker._depth; + do { if (!walker.for_each(cur)) -- cgit v1.2.3