[libxml++] Branch status - iterator API



So that we have it stored somewhere, this is the currrent difference
between the branches - it's basically just the unfinished iterator API.
That is the only reason for maintaining 2 branches at the moment.
Applying everything twice is kind of annoying just for this.

-- 
Murray Cumming
murray usa net
www.murrayc.com
diff -up --recursive branches/libxml++/ChangeLog libxml++/ChangeLog
--- branches/libxml++/ChangeLog	2003-02-07 11:39:12.000000000 +0100
+++ libxml++/ChangeLog	2003-02-07 11:39:49.000000000 +0100
@@ -1,24 +1,10 @@
 2003-02-07  Murray Cumming  <murrayc usa net>
 
-	* Moved method implementations such as get_attributes() into derived 
-	classes instead of using "using methodname();". That seems clearer. 
-	However it shows that we should probably create a shared base class for
-	Content and Comment, as in the DOM.
-
-2002-02-07  Stefan Seefeld <seefeld sympatico ca>
-
-	* libxml++/node.[h,cc]: add get_path and find methods for xpath lookup
-  
-2002-02-07  Stefan Seefeld <seefeld sympatico ca>
+ 	* Moved method implementations such as get_attributes() into derived
+ 	classes instead of using "using methodname();". That seems clearer.
+ 	However it shows that we should probably create a shared base class for
+ 	Content and Comment, as in the DOM.
 
-	* libxml++/node.h, libxml++/parsers/saxparser.[h,cc],
-	examples/sax_parser/*.[h,cc], examples/sax_exception/*.[h,cc]:
-	SaxParser::AttributeMap is now a map<string, string>.
-  Additional comment from Murray: We did this because a) Attribute is part
-  of DOM, not part of SAX, and b) we were actually creating temporary
-  xmlAttr instances just to do this, so we were not even wrapping the C
-  API directly.
-  
 2003-02-06  Murray Cumming  <murrayc usa net>
 
 	* libxml++/parsers/saxparser.[h|cc]: Corrected some coding style.
@@ -31,16 +17,34 @@
 2003-02-06  Murray Cumming  <murrayc usa net>
 
 	* libxml++/nodes/node.*: Corrected code style. 
-	
+
 2003-02-06  Murray Cumming  <murrayc usa net>
+ 
+ 	* libxml++/nodes/node.[h|cc], libxml++/attribute.[h|cc]: Made c_obj()
+ 	accessors public so people can use them. Provided const and non-const 
+ 	versions of them. Put implementation in .cc file.
+ 	* Reverted some of Stefan's coding style changes and corrected the 
+ 	coding style in libxml++/nodes/document.[h|cc].
+ 	* libxml++/document.h: Made the destructor virtual, because there are
+ 	virtual methods.
+	
+2002-02-04  Stefan Seefeld <seefeld sympatico ca>
+
+	* libxml++/node.[h,cc]: add new insert_child and append_child methods
+	(using new iterators), add get_path and find methods for xpath lookup
+
+	* examples/dom: new example code to illustrate the new features
+	
+2002-02-03  Stefan Seefeld <seefeld sympatico ca>
+
+	* libxml++/node.h, libxml++/parsers/saxparser.[h,cc],
+	examples/sax_parser/*.[h,cc], examples/sax_exception/*.[h,cc]:
+	SaxParser::AttributeMap is now a map<string, string>.
+
+2002-02-03  Stefan Seefeld <seefeld sympatico ca>
 
-	* libxml++/nodes/node.[h|cc], libxml++/attribute.[h|cc]: Made c_obj()
-	accessors public so people can use them. Provided const and non-const 
-	versions of them. Put implementation in .cc file.
-	* Reverted some of Stefan's coding style changes and corrected the 
-	coding style in libxml++/nodes/document.[h|cc].
-	* libxml++/document.h: Made the destructor virtual, because there are
-	virtual methods.
+	* libxml++/node.h: add child_iterators for simple C++ style
+	iteration (to get eventually rid of NodeList)
 
 2002-02-03  Stefan Seefeld <seefeld sympatico ca>
 
@@ -59,8 +63,8 @@
 
 	* acinclude.m4: The AM_LIBXML macro now checks for a libxml2
 	version >= 2.5.1.
-	* libxml++/nodes/node.cc: Use xmlStrEqual in
-	get_attribute() instead of std::string::operator==().
+	* libxml++/nodes/node.cc: compare strings, not pointers, in
+	get_attribute()
 
 2003-01-31  Stefan Seefeld  <seefeld sympatico ca>
 
Only in libxml++: .#ChangeLog.1.62
diff -up --recursive branches/libxml++/configure.in libxml++/configure.in
--- branches/libxml++/configure.in	2003-02-07 11:39:13.000000000 +0100
+++ libxml++/configure.in	2003-02-07 11:39:49.000000000 +0100
@@ -57,6 +57,7 @@ AC_OUTPUT(
   examples/Makefile
     examples/dom_build/Makefile
     examples/dom_parser/Makefile
+    examples/dom/Makefile
     examples/sax_parser/Makefile
     examples/sax_exception/Makefile
 
diff -up --recursive branches/libxml++/CVS/Entries libxml++/CVS/Entries
--- branches/libxml++/CVS/Entries	2003-02-07 11:39:13.000000000 +0100
+++ libxml++/CVS/Entries	2003-02-07 11:39:49.000000000 +0100
@@ -1,16 +1,16 @@
 D/docs////
 D/examples////
 D/libxml++////
-/AUTHORS/1.3/Fri Feb  7 10:39:09 2003//TBRANCH-1_0
-/COPYING/1.1.1.1/Fri Feb  7 10:39:11 2003//TBRANCH-1_0
-/ChangeLog/1.73.2.11/Fri Feb  7 10:39:12 2003//TBRANCH-1_0
-/INSTALL/1.1.1.1/Fri Feb  7 10:39:12 2003//TBRANCH-1_0
-/Makefile.am/1.5/Fri Feb  7 10:39:12 2003//TBRANCH-1_0
-/NEWS/1.6.2.1/Fri Feb  7 10:39:12 2003//TBRANCH-1_0
-/README/1.7/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/acinclude.m4/1.2.2.1/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/autogen.sh/1.2/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/configure.in/1.17.2.1/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/libxml++-1.0.pc.in/1.4/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/libxml++.m4/1.1.1.1/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
-/xml++-config.in/1.2/Fri Feb  7 10:39:13 2003//TBRANCH-1_0
+/AUTHORS/1.3/Fri Feb  7 10:39:46 2003//
+/COPYING/1.1.1.1/Fri Feb  7 10:39:47 2003//
+/ChangeLog/1.85/Fri Feb  7 10:39:49 2003//
+/INSTALL/1.1.1.1/Fri Feb  7 10:39:49 2003//
+/Makefile.am/1.5/Fri Feb  7 10:39:49 2003//
+/NEWS/1.7/Fri Feb  7 10:39:49 2003//
+/README/1.7/Fri Feb  7 10:39:49 2003//
+/acinclude.m4/1.3/Fri Feb  7 10:39:49 2003//
+/autogen.sh/1.2/Fri Feb  7 10:39:49 2003//
+/configure.in/1.19/Fri Feb  7 10:39:49 2003//
+/libxml++-1.0.pc.in/1.4/Fri Feb  7 10:39:49 2003//
+/libxml++.m4/1.1.1.1/Fri Feb  7 10:39:49 2003//
+/xml++-config.in/1.2/Fri Feb  7 10:39:49 2003//
diff -up --recursive branches/libxml++/CVS/Root libxml++/CVS/Root
--- branches/libxml++/CVS/Root	2003-02-06 19:04:44.000000000 +0100
+++ libxml++/CVS/Root	2002-11-29 16:30:54.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/CVS: Tag
diff -up --recursive branches/libxml++/docs/CVS/Entries libxml++/docs/CVS/Entries
--- branches/libxml++/docs/CVS/Entries	2003-02-07 11:39:19.000000000 +0100
+++ libxml++/docs/CVS/Entries	2003-02-07 11:39:56.000000000 +0100
@@ -1,4 +1,4 @@
-/Makefile.am/1.3/Tue Nov 19 11:52:29 2002//TBRANCH-1_0
-/Makefile_web.am_fragment/1.2/Tue Nov 19 01:48:04 2002//TBRANCH-1_0
-/index.html/1.4/Thu Nov 21 09:23:38 2002//TBRANCH-1_0
+/Makefile.am/1.3/Tue Nov 19 11:52:29 2002//
+/Makefile_web.am_fragment/1.2/Tue Nov 19 01:48:04 2002//
+/index.html/1.4/Thu Nov 21 09:23:38 2002//
 D/reference////
diff -up --recursive branches/libxml++/docs/CVS/Root libxml++/docs/CVS/Root
--- branches/libxml++/docs/CVS/Root	2003-02-07 11:39:13.000000000 +0100
+++ libxml++/docs/CVS/Root	2003-02-07 11:39:49.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/CVS: Tag
diff -up --recursive branches/libxml++/docs/reference/CVS/Entries libxml++/docs/reference/CVS/Entries
--- branches/libxml++/docs/reference/CVS/Entries	2003-02-07 11:39:19.000000000 +0100
+++ libxml++/docs/reference/CVS/Entries	2003-02-07 11:39:56.000000000 +0100
@@ -1,4 +1,4 @@
-/Doxyfile/1.2/Sat Nov 16 16:19:21 2002//TBRANCH-1_0
-/Makefile.am/1.1/Thu Nov  7 22:04:26 2002//TBRANCH-1_0
-/README/1.1/Tue Nov  5 22:54:14 2002//TBRANCH-1_0
+/Doxyfile/1.2/Sat Nov 16 16:19:21 2002//
+/Makefile.am/1.1/Thu Nov  7 22:04:26 2002//
+/README/1.1/Tue Nov  5 22:54:14 2002//
 D/html////
diff -up --recursive branches/libxml++/docs/reference/CVS/Root libxml++/docs/reference/CVS/Root
--- branches/libxml++/docs/reference/CVS/Root	2003-02-07 11:39:13.000000000 +0100
+++ libxml++/docs/reference/CVS/Root	2003-02-07 11:39:50.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/reference/CVS: Tag
diff -up --recursive branches/libxml++/docs/reference/html/CVS/Entries libxml++/docs/reference/html/CVS/Entries
--- branches/libxml++/docs/reference/html/CVS/Entries	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/docs/reference/html/CVS/Entries	2003-02-07 11:39:50.000000000 +0100
@@ -1,2 +1,2 @@
-/.cvsignore/1.1/Tue Nov  5 22:54:14 2002//TBRANCH-1_0
+/.cvsignore/1.1/Tue Nov  5 22:54:14 2002//
 D
diff -up --recursive branches/libxml++/docs/reference/html/CVS/Root libxml++/docs/reference/html/CVS/Root
--- branches/libxml++/docs/reference/html/CVS/Root	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/docs/reference/html/CVS/Root	2003-02-07 11:39:50.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/reference/html/CVS: Tag
diff -up --recursive branches/libxml++/examples/CVS/Entries libxml++/examples/CVS/Entries
--- branches/libxml++/examples/CVS/Entries	2003-02-07 11:39:19.000000000 +0100
+++ libxml++/examples/CVS/Entries	2003-02-07 11:39:56.000000000 +0100
@@ -1,6 +1,7 @@
-/Makefile.am/1.4/Mon Dec  2 18:35:37 2002//TBRANCH-1_0
-/Makefile.am_fragment/1.1/Tue Nov 12 13:00:59 2002//TBRANCH-1_0
-/README/1.1/Tue Nov 12 13:00:59 2002//TBRANCH-1_0
+/Makefile.am/1.5/Tue Feb  4 05:46:40 2003//
+/Makefile.am_fragment/1.1/Tue Nov 12 13:00:59 2002//
+/README/1.1/Tue Nov 12 13:00:59 2002//
+D/dom////
 D/dom_build////
 D/dom_parser////
 D/sax_exception////
diff -up --recursive branches/libxml++/examples/CVS/Root libxml++/examples/CVS/Root
--- branches/libxml++/examples/CVS/Root	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/examples/CVS/Root	2003-02-07 11:39:50.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/CVS: Tag
Only in libxml++/examples: dom
diff -up --recursive branches/libxml++/examples/dom_build/CVS/Entries libxml++/examples/dom_build/CVS/Entries
--- branches/libxml++/examples/dom_build/CVS/Entries	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/examples/dom_build/CVS/Entries	2003-02-07 11:39:51.000000000 +0100
@@ -1,3 +1,3 @@
-/Makefile.am/1.1/Mon Nov 18 14:02:21 2002//TBRANCH-1_0
-/main.cc/1.6.2.1/Thu Feb  6 19:37:03 2003//TBRANCH-1_0
+/Makefile.am/1.1/Mon Nov 18 14:02:21 2002//
+/main.cc/1.7/Mon Feb  3 18:47:27 2003//
 D
diff -up --recursive branches/libxml++/examples/dom_build/CVS/Root libxml++/examples/dom_build/CVS/Root
--- branches/libxml++/examples/dom_build/CVS/Root	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/examples/dom_build/CVS/Root	2003-02-07 11:39:51.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/dom_build/CVS: Tag
diff -up --recursive branches/libxml++/examples/dom_parser/CVS/Entries libxml++/examples/dom_parser/CVS/Entries
--- branches/libxml++/examples/dom_parser/CVS/Entries	2003-02-07 11:39:15.000000000 +0100
+++ libxml++/examples/dom_parser/CVS/Entries	2003-02-07 11:39:51.000000000 +0100
@@ -1,4 +1,4 @@
-/Makefile.am/1.1/Tue Nov 12 13:00:59 2002//TBRANCH-1_0
-/example.xml/1.2/Wed Dec 18 16:02:47 2002//TBRANCH-1_0
-/main.cc/1.16.2.1/Fri Feb  7 10:37:41 2003//TBRANCH-1_0
+/Makefile.am/1.1/Tue Nov 12 13:00:59 2002//
+/example.xml/1.2/Wed Dec 18 16:02:47 2002//
+/main.cc/1.17/Fri Feb  7 10:41:25 2003//
 D
diff -up --recursive branches/libxml++/examples/dom_parser/CVS/Root libxml++/examples/dom_parser/CVS/Root
--- branches/libxml++/examples/dom_parser/CVS/Root	2003-02-07 11:39:14.000000000 +0100
+++ libxml++/examples/dom_parser/CVS/Root	2003-02-07 11:39:51.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/dom_parser/CVS: Tag
diff -up --recursive branches/libxml++/examples/Makefile.am libxml++/examples/Makefile.am
--- branches/libxml++/examples/Makefile.am	2002-12-02 19:35:37.000000000 +0100
+++ libxml++/examples/Makefile.am	2003-02-04 06:46:40.000000000 +0100
@@ -1,3 +1,3 @@
-SUBDIRS = dom_build dom_parser sax_parser sax_exception
+SUBDIRS = dom_build dom_parser dom sax_parser sax_exception
 
 EXTRA_DIST = README Makefile.am_fragment
diff -up --recursive branches/libxml++/examples/sax_exception/CVS/Entries libxml++/examples/sax_exception/CVS/Entries
--- branches/libxml++/examples/sax_exception/CVS/Entries	2003-02-07 11:39:15.000000000 +0100
+++ libxml++/examples/sax_exception/CVS/Entries	2003-02-07 11:39:52.000000000 +0100
@@ -1,6 +1,6 @@
-/Makefile.am/1.1/Mon Dec  2 18:35:37 2002//TBRANCH-1_0
-/example.xml/1.1/Mon Dec  2 18:35:37 2002//TBRANCH-1_0
-/main.cc/1.1/Mon Dec  2 18:35:38 2002//TBRANCH-1_0
-/myparser.cc/1.3.2.1/Fri Feb  7 10:03:16 2003//TBRANCH-1_0
-/myparser.h/1.2.2.1/Fri Feb  7 10:03:16 2003//TBRANCH-1_0
+/Makefile.am/1.1/Mon Dec  2 18:35:37 2002//
+/example.xml/1.1/Mon Dec  2 18:35:37 2002//
+/main.cc/1.1/Mon Dec  2 18:35:38 2002//
+/myparser.cc/1.4/Mon Feb  3 22:06:14 2003//
+/myparser.h/1.3/Mon Feb  3 22:06:14 2003//
 D
diff -up --recursive branches/libxml++/examples/sax_exception/CVS/Root libxml++/examples/sax_exception/CVS/Root
--- branches/libxml++/examples/sax_exception/CVS/Root	2003-02-07 11:39:15.000000000 +0100
+++ libxml++/examples/sax_exception/CVS/Root	2003-02-07 11:39:51.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/sax_exception/CVS: Tag
diff -up --recursive branches/libxml++/examples/sax_parser/CVS/Entries libxml++/examples/sax_parser/CVS/Entries
--- branches/libxml++/examples/sax_parser/CVS/Entries	2003-02-07 11:39:16.000000000 +0100
+++ libxml++/examples/sax_parser/CVS/Entries	2003-02-07 11:39:52.000000000 +0100
@@ -1,6 +1,6 @@
-/Makefile.am/1.1/Fri Nov 15 13:33:08 2002//TBRANCH-1_0
-/example.xml/1.1/Fri Nov 15 13:33:08 2002//TBRANCH-1_0
-/main.cc/1.2/Sat Nov 16 15:25:54 2002//TBRANCH-1_0
-/myparser.cc/1.8.2.1/Fri Feb  7 10:03:16 2003//TBRANCH-1_0
-/myparser.h/1.4.2.1/Fri Feb  7 10:03:16 2003//TBRANCH-1_0
+/Makefile.am/1.1/Fri Nov 15 13:33:08 2002//
+/example.xml/1.1/Fri Nov 15 13:33:08 2002//
+/main.cc/1.2/Sat Nov 16 15:25:54 2002//
+/myparser.cc/1.9/Mon Feb  3 22:06:15 2003//
+/myparser.h/1.5/Mon Feb  3 22:06:15 2003//
 D
diff -up --recursive branches/libxml++/examples/sax_parser/CVS/Root libxml++/examples/sax_parser/CVS/Root
--- branches/libxml++/examples/sax_parser/CVS/Root	2003-02-07 11:39:15.000000000 +0100
+++ libxml++/examples/sax_parser/CVS/Root	2003-02-07 11:39:52.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/sax_parser/CVS: Tag
diff -up --recursive branches/libxml++/libxml++/attribute.cc libxml++/libxml++/attribute.cc
--- branches/libxml++/libxml++/attribute.cc	2003-02-06 22:23:22.000000000 +0100
+++ libxml++/libxml++/attribute.cc	2003-02-06 22:03:54.000000000 +0100
@@ -25,8 +25,8 @@ std::string Attribute::get_name() const
 
 std::string Attribute::get_value() const
 {
-  xmlChar* value = xmlGetProp(cobj()->parent, cobj()->name);
-  std::string retn = value ? (char*)value : "";
+  xmlChar *value = xmlGetProp(cobj()->parent, cobj()->name);
+  std::string retn = value ? (char *)value : "";
   xmlFree(value);
   return retn;
 }
diff -up --recursive branches/libxml++/libxml++/CVS/Entries libxml++/libxml++/CVS/Entries
--- branches/libxml++/libxml++/CVS/Entries	2003-02-07 11:39:19.000000000 +0100
+++ libxml++/libxml++/CVS/Entries	2003-02-07 11:39:56.000000000 +0100
@@ -1,12 +1,12 @@
-/.cvsignore/1.1/Tue Nov  5 18:00:58 2002//TBRANCH-1_0
-/Makefile.am/1.11.2.1/Thu Feb  6 19:37:07 2003//TBRANCH-1_0
-/attribute.cc/1.6.2.5/Thu Feb  6 21:23:22 2003//TBRANCH-1_0
-/attribute.h/1.7.2.4/Thu Feb  6 20:49:23 2003//TBRANCH-1_0
-/document.cc/1.2.2.5/Fri Feb  7 10:46:55 2003//TBRANCH-1_0
-/document.h/1.1.2.3/Fri Feb  7 10:46:55 2003//TBRANCH-1_0
-/dtd.cc/1.1.2.1/Thu Feb  6 18:20:12 2003//TBRANCH-1_0
-/dtd.h/1.1.2.1/Thu Feb  6 18:20:13 2003//TBRANCH-1_0
-/libxml++.h/1.10.2.1/Thu Feb  6 19:37:10 2003//TBRANCH-1_0
+/.cvsignore/1.1/Tue Nov  5 18:00:58 2002//
+/Makefile.am/1.12/Mon Feb  3 18:47:27 2003//
+/attribute.cc/1.10/Thu Feb  6 21:03:54 2003//
+/attribute.h/1.11/Thu Feb  6 21:03:54 2003//
+/document.cc/1.5/Fri Feb  7 10:45:20 2003//
+/document.h/1.3/Fri Feb  7 10:45:20 2003//
+/dtd.cc/1.2/Mon Feb  3 14:38:34 2003//
+/dtd.h/1.2/Mon Feb  3 14:38:34 2003//
+/libxml++.h/1.11/Mon Feb  3 18:47:27 2003//
 D/exceptions////
 D/nodes////
 D/parsers////
diff -up --recursive branches/libxml++/libxml++/CVS/Root libxml++/libxml++/CVS/Root
--- branches/libxml++/libxml++/CVS/Root	2003-02-07 11:39:16.000000000 +0100
+++ libxml++/libxml++/CVS/Root	2003-02-07 11:39:52.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/CVS: Tag
diff -up --recursive branches/libxml++/libxml++/document.cc libxml++/libxml++/document.cc
--- branches/libxml++/libxml++/document.cc	2003-02-07 11:46:55.000000000 +0100
+++ libxml++/libxml++/document.cc	2003-02-07 11:45:20.000000000 +0100
@@ -120,7 +120,7 @@ void destruct(xmlNode* node)
    else if (node->type == XML_DOCUMENT_NODE)
       // do nothing. See construct for an explanation
       ;
-   else //Nodes (including Attributes):
+   else
       delete static_cast<xmlpp::Node*>(node->_private);
 }
 
diff -up --recursive branches/libxml++/libxml++/exceptions/CVS/Entries libxml++/libxml++/exceptions/CVS/Entries
--- branches/libxml++/libxml++/exceptions/CVS/Entries	2003-02-07 11:39:17.000000000 +0100
+++ libxml++/libxml++/exceptions/CVS/Entries	2003-02-07 11:39:54.000000000 +0100
@@ -1,8 +1,8 @@
-/Makefile.am/1.1/Mon Nov 18 11:35:58 2002//TBRANCH-1_0
-/exception.cc/1.4/Mon Dec  2 18:35:55 2002//TBRANCH-1_0
-/exception.h/1.4/Mon Dec  2 18:35:56 2002//TBRANCH-1_0
-/internal_error.cc/1.3/Mon Dec  2 18:35:56 2002//TBRANCH-1_0
-/internal_error.h/1.3/Mon Dec  2 18:35:56 2002//TBRANCH-1_0
-/parse_error.cc/1.3/Mon Dec  2 18:35:56 2002//TBRANCH-1_0
-/parse_error.h/1.3/Mon Dec  2 18:35:56 2002//TBRANCH-1_0
+/Makefile.am/1.1/Mon Nov 18 11:35:58 2002//
+/exception.cc/1.4/Mon Dec  2 18:35:55 2002//
+/exception.h/1.4/Mon Dec  2 18:35:56 2002//
+/internal_error.cc/1.3/Mon Dec  2 18:35:56 2002//
+/internal_error.h/1.3/Mon Dec  2 18:35:56 2002//
+/parse_error.cc/1.3/Mon Dec  2 18:35:56 2002//
+/parse_error.h/1.3/Mon Dec  2 18:35:56 2002//
 D
diff -up --recursive branches/libxml++/libxml++/exceptions/CVS/Root libxml++/libxml++/exceptions/CVS/Root
--- branches/libxml++/libxml++/exceptions/CVS/Root	2003-02-07 11:39:16.000000000 +0100
+++ libxml++/libxml++/exceptions/CVS/Root	2003-02-07 11:39:53.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/exceptions/CVS: Tag
diff -up --recursive branches/libxml++/libxml++/nodes/CVS/Entries libxml++/libxml++/nodes/CVS/Entries
--- branches/libxml++/libxml++/nodes/CVS/Entries	2003-02-07 11:39:18.000000000 +0100
+++ libxml++/libxml++/nodes/CVS/Entries	2003-02-07 11:39:55.000000000 +0100
@@ -1,11 +1,11 @@
-/.cvsignore/1.1/Wed Dec 18 16:01:26 2002//TBRANCH-1_0
-/Makefile.am/1.1/Wed Dec 18 16:01:26 2002//TBRANCH-1_0
-/commentnode.cc/1.2.2.2/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/commentnode.h/1.2.2.2/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/element.cc/1.4.2.3/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/element.h/1.3.2.2/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/node.cc/1.6.2.8/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/node.h/1.5.2.7/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/textnode.cc/1.3.2.2/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
-/textnode.h/1.3.2.2/Fri Feb  7 10:37:42 2003//TBRANCH-1_0
+/.cvsignore/1.1/Wed Dec 18 16:01:26 2002//
+/Makefile.am/1.1/Wed Dec 18 16:01:26 2002//
+/commentnode.cc/1.4/Fri Feb  7 10:41:25 2003//
+/commentnode.h/1.4/Fri Feb  7 10:41:25 2003//
+/element.cc/1.7/Fri Feb  7 10:41:25 2003//
+/element.h/1.5/Fri Feb  7 10:41:25 2003//
+/node.cc/1.15/Fri Feb  7 10:41:25 2003//
+/node.h/1.14/Fri Feb  7 10:41:25 2003//
+/textnode.cc/1.5/Fri Feb  7 10:41:25 2003//
+/textnode.h/1.5/Fri Feb  7 10:41:25 2003//
 D
diff -up --recursive branches/libxml++/libxml++/nodes/CVS/Root libxml++/libxml++/nodes/CVS/Root
--- branches/libxml++/libxml++/nodes/CVS/Root	2003-02-07 11:39:17.000000000 +0100
+++ libxml++/libxml++/nodes/CVS/Root	2003-02-07 11:39:54.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/nodes/CVS: Tag
diff -up --recursive branches/libxml++/libxml++/nodes/node.cc libxml++/libxml++/nodes/node.cc
--- branches/libxml++/libxml++/nodes/node.cc	2003-02-07 11:37:42.000000000 +0100
+++ libxml++/libxml++/nodes/node.cc	2003-02-07 11:41:25.000000000 +0100
@@ -18,7 +18,7 @@ namespace xmlpp
 {
 
 Node::Node(xmlNode* node)
-: _impl(node)
+  : _impl(node)
 {
    _impl->_private = this;
 }
@@ -48,13 +48,40 @@ const Node::NodeList Node::get_children(
   return const_cast<Node*>(this)->get_children(name);
 }
 
-Element *Node::add_child(const std::string& name)
+Element* Node::append_child(const std::string& name)
 {
-   if(_impl->type != XML_ELEMENT_NODE)
-      throw internal_error("you can only add child nodes to element nodes");
+  if(_impl->type != XML_ELEMENT_NODE)
+    throw internal_error("you can only add child nodes to element nodes");
       
-   xmlNode* node = xmlAddChild(_impl, xmlNewNode(0, (xmlChar*)name.c_str()));
-   return static_cast<Element*>(node->_private);
+  xmlNode* node = xmlAddChild(_impl, xmlNewNode(0, (xmlChar*)name.c_str()));
+  return static_cast<Element*>(node->_private);
+}
+
+Element* Node::insert_child(child_iterator i, const std::string& name)
+{
+  if(_impl->type != XML_ELEMENT_NODE)
+    throw internal_error("you can only add child nodes to element nodes");
+
+  xmlNode* node = 0;
+  if (i._current)
+    node = xmlAddPrevSibling(i._current, xmlNewNode(0, (xmlChar*)name.c_str()));
+  else
+    node = xmlAddChild(_impl, xmlNewNode(0, (xmlChar*)name.c_str()));
+  return static_cast<Element*>(node->_private);
+}
+
+Node* Node::insert_child(child_iterator i, Node* child)
+{
+  if(_impl->type != XML_ELEMENT_NODE)
+    throw internal_error("you can only add child nodes to element nodes");
+
+  xmlUnlinkNode(child->_impl);
+  xmlNode* node;
+  if (i._current)
+    node = xmlAddPrevSibling(i._current, child->_impl);
+  else
+    node = xmlAddChild(_impl, child->_impl);
+  return static_cast<Element* >(node->_private);
 }
 
 TextNode* Node::add_content(const std::string& content)
diff -up --recursive branches/libxml++/libxml++/nodes/node.h libxml++/libxml++/nodes/node.h
--- branches/libxml++/libxml++/nodes/node.h	2003-02-07 11:37:42.000000000 +0100
+++ libxml++/libxml++/nodes/node.h	2003-02-07 11:41:25.000000000 +0100
@@ -16,11 +16,10 @@
 
 namespace xmlpp {
 
+class Node;
 class TextNode;
 class Element;
 class Attribute;
-
-class Node;
 typedef std::vector<Node*> NodeSet;
 
 /** Represents XML Nodes.
@@ -29,12 +28,20 @@ typedef std::vector<Node*> NodeSet;
 class Node
 {
 public:
+  class child_iterator;
+  class const_child_iterator;
   typedef std::list<Node*> NodeList;
   typedef std::list<Attribute*> AttributeList;
 
-  explicit Node(xmlNodePtr node);
+  explicit Node(xmlNode* node);
   virtual ~Node();
 
+  child_iterator begin_children();
+  child_iterator end_children();
+
+  const_child_iterator begin_const_children() const;
+  const_child_iterator end_const_children() const;
+
   std::string get_name() const;
   int get_line() const;
 
@@ -59,11 +66,11 @@ public:
   NodeList get_children(const std::string& name = std::string());
   const NodeList get_children(const std::string& name = std::string()) const;
 
-  Element* add_child(const std::string& name);
-  // FIXME: how should this work in general (depending on the exact types
-  // of parent and child node)
-  //   Node* add_child(Node* node);
-
+  Element* append_child(const std::string& name);
+  // for backward compatibility
+  Element* add_child(const std::string& name) { append_child(name);}
+  Element* insert_child(child_iterator, const std::string& name);
+  Node* insert_child(child_iterator, Node *node);
 
   /** Remove the child node.
    * @param node The child node to remove. This Node will be deleted and therefore unusable after calling this method.
@@ -80,9 +87,77 @@ public:
   const xmlNode* cobj() const;
 
 private:
-   xmlNode* _impl;
+  xmlNode* _impl;
+};
+
+class Node::child_iterator
+{
+  friend class Node;
+public:
+  typedef child_iterator self;
+  typedef Node* value_type;
+  typedef value_type& reference;
+  typedef value_type* pointer;
+  child_iterator() : _current(0) {};
+  bool operator == (self i) { return _current == i._current;}
+  bool operator != (self i) { return !operator==(i);}
+  reference operator *() { return reinterpret_cast<Node*>(_current->_private);}
+  pointer operator ->() { return &(operator *());}
+  self operator ++(int) { increment(); return *this;}
+  self operator ++() { child_iterator tmp = *this; increment(); return tmp;}
+  self operator --(int) { decrement(); return *this;}
+  self operator --() { child_iterator tmp = *this; decrement(); return tmp;}
+private:
+  void increment() { _current = _current->next;}
+  void decrement() { _current = _current->prev;}
+  child_iterator(xmlNode* current) : _current(current) {}
+  xmlNode* _current;
+};
+
+class Node::const_child_iterator
+{
+  friend class Node;
+public:
+  typedef const_child_iterator self;
+  typedef Node* value_type;
+  typedef const value_type& const_reference;
+  typedef const value_type* const_pointer;
+  const_child_iterator() : _current(0) {};
+  bool operator == (self i) { return _current == i._current;}
+  bool operator != (self i) { return !operator==(i);}
+  const_reference operator *() { return reinterpret_cast<Node*>(_current->_private);}
+  const_pointer operator ->() { return &(operator *());}
+  self operator ++(int) { increment(); return *this;}
+  self operator ++() { const_child_iterator tmp = *this; increment(); return tmp;}
+  self operator --(int) { decrement(); return *this;}
+  self operator --() { const_child_iterator tmp = *this; decrement(); return tmp;}
+private:
+  void increment() { _current = _current->next;}
+  void decrement() { _current = _current->prev;}
+  const_child_iterator(xmlNode *current) : _current(current) {}
+  xmlNode* _current;
 };
 
+inline Node::child_iterator Node::begin_children()
+{
+  return child_iterator(_impl->children);
+}
+
+inline Node::child_iterator Node::end_children()
+{
+  return child_iterator(0);
+}
+
+inline Node::const_child_iterator Node::begin_const_children() const
+{
+  return const_child_iterator(_impl->children);
+}
+
+inline Node::const_child_iterator Node::end_const_children() const
+{
+  return const_child_iterator(0);
+}
+
 } // namespace xmlpp
 
 #endif //__LIBXMLPP_NODES_NODE_H
diff -up --recursive branches/libxml++/libxml++/parsers/CVS/Entries libxml++/libxml++/parsers/CVS/Entries
--- branches/libxml++/libxml++/parsers/CVS/Entries	2003-02-07 11:39:19.000000000 +0100
+++ libxml++/libxml++/parsers/CVS/Entries	2003-02-07 11:39:56.000000000 +0100
@@ -1,8 +1,8 @@
-/Makefile.am/1.1/Tue Nov 12 13:00:59 2002//TBRANCH-1_0
-/domparser.cc/1.20.2.2/Thu Feb  6 19:37:12 2003//TBRANCH-1_0
-/domparser.h/1.13.2.2/Thu Feb  6 19:37:13 2003//TBRANCH-1_0
-/parser.cc/1.1/Tue Nov 12 13:00:59 2002//TBRANCH-1_0
-/parser.h/1.12/Fri Jan  3 01:44:39 2003//TBRANCH-1_0
-/saxparser.cc/1.20.2.4/Fri Feb  7 10:03:17 2003//TBRANCH-1_0
-/saxparser.h/1.16.2.2/Fri Feb  7 10:03:18 2003//TBRANCH-1_0
+/Makefile.am/1.1/Tue Nov 12 13:00:59 2002//
+/domparser.cc/1.22/Mon Feb  3 18:47:28 2003//
+/domparser.h/1.15/Mon Feb  3 18:47:28 2003//
+/parser.cc/1.1/Tue Nov 12 13:00:59 2002//
+/parser.h/1.12/Fri Jan  3 01:44:39 2003//
+/saxparser.cc/1.24/Thu Feb  6 21:39:38 2003//
+/saxparser.h/1.19/Thu Feb  6 21:39:38 2003//
 D
diff -up --recursive branches/libxml++/libxml++/parsers/CVS/Root libxml++/libxml++/parsers/CVS/Root
--- branches/libxml++/libxml++/parsers/CVS/Root	2003-02-07 11:39:18.000000000 +0100
+++ libxml++/libxml++/parsers/CVS/Root	2003-02-07 11:39:55.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/parsers/CVS: Tag
diff -up --recursive branches/libxml++/libxml++/parsers/saxparser.cc libxml++/libxml++/parsers/saxparser.cc
--- branches/libxml++/libxml++/parsers/saxparser.cc	2003-02-07 11:03:17.000000000 +0100
+++ libxml++/libxml++/parsers/saxparser.cc	2003-02-06 22:39:38.000000000 +0100
@@ -70,8 +70,7 @@ void SaxParser::on_end_document()
 {
 }
 
-void SaxParser::on_start_element(const std::string& nameame,
-                                 const AttributeMap& attributes)
+void SaxParser::on_start_element(const std::string& name, const AttributeMap& attributes)
 {
 }
 
@@ -234,7 +233,9 @@ void SaxParser::_callback_end_document(v
   }
 }
 
-void SaxParser::_callback_start_element(void* _parser, const xmlChar* name, const xmlChar** p)
+void SaxParser::_callback_start_element(void* _parser,
+                                        const xmlChar* name,
+                                        const xmlChar** p)
 {
   SaxParser* parser = (SaxParser*) _parser;
   AttributeMap attributes;
@@ -242,7 +243,7 @@ void SaxParser::_callback_start_element(
   if(p)
     for(const xmlChar** cur = p; cur && *cur; cur += 2)
       attributes[(char*)*cur] = (char*)*(cur + 1);
-
+   
   try
   {
     parser->on_start_element(std::string((const char*) name), attributes);
diff -up --recursive branches/libxml++/libxml++/parsers/saxparser.h libxml++/libxml++/parsers/saxparser.h
--- branches/libxml++/libxml++/parsers/saxparser.h	2003-02-07 11:03:18.000000000 +0100
+++ libxml++/libxml++/parsers/saxparser.h	2003-02-06 22:39:38.000000000 +0100
@@ -33,8 +33,7 @@ protected:
   virtual xmlEntityPtr on_get_entity(const xmlChar* name);
   virtual void on_start_document();
   virtual void on_end_document();
-  virtual void on_start_element(const std::string& name,
-                                const AttributeMap& attributes);
+  virtual void on_start_element(const std::string& name, const AttributeMap& attributes);
   virtual void on_end_element(const std::string& name);
   virtual void on_characters(const std::string& characters);
   virtual void on_comment(const std::string& text);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]