[libxml++] Branch status



I have extracted and reapplied the changes that Stefan made that have
now been approved, with some minor code changes, and with code style
changes. A merge of the branches seems possible.

The attached patch shows the current difference between the branches.
This seems to be descibed by the following 3 ChangeLog entries. It also
mentioned a new sub-directory "dom" in the Makefile.am, but this is
unexplained and there is no such directory in cvs.

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>.

I don't know why this change was made.


2002-02-03  Stefan Seefeld <seefeld sympatico ca>

	* libxml++/node.h: add child_iterators for simple C++ style
	iteration (to get eventually rid of NodeList)

This is still being discussed so maybe it should be reverted.


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

This might depend on the previous change, but I suspect that it can be
done without it. If so, then I'd like to see it added to 1.0


-- 
Murray Cumming
murray usa net
www.murrayc.com
diff -up --recursive libxml++/ChangeLog branches/libxml++/ChangeLog
--- libxml++/ChangeLog	2003-02-06 22:39:49.000000000 +0100
+++ branches/libxml++/ChangeLog	2003-02-06 22:39:03.000000000 +0100
@@ -10,34 +10,16 @@
 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>
+2003-02-06  Murray Cumming  <murrayc usa net>
 
-	* libxml++/node.h: add child_iterators for simple C++ style
-	iteration (to get eventually rid of NodeList)
+	* 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-03  Stefan Seefeld <seefeld sympatico ca>
 
@@ -56,8 +38,8 @@
 
 	* acinclude.m4: The AM_LIBXML macro now checks for a libxml2
 	version >= 2.5.1.
-	* libxml++/nodes/node.cc: compare strings, not pointers, in
-	get_attribute()
+	* libxml++/nodes/node.cc: Use xmlStrEqual in
+	get_attribute() instead of std::string::operator==().
 
 2003-01-31  Stefan Seefeld  <seefeld sympatico ca>
 
Only in libxml++: .#ChangeLog.1.62
diff -up --recursive libxml++/configure.in branches/libxml++/configure.in
--- libxml++/configure.in	2003-02-06 22:39:50.000000000 +0100
+++ branches/libxml++/configure.in	2003-02-06 22:39:04.000000000 +0100
@@ -57,7 +57,6 @@ 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 libxml++/CVS/Entries branches/libxml++/CVS/Entries
--- libxml++/CVS/Entries	2003-02-06 22:39:50.000000000 +0100
+++ branches/libxml++/CVS/Entries	2003-02-06 22:39:04.000000000 +0100
@@ -1,16 +1,16 @@
 D/docs////
 D/examples////
 D/libxml++////
-/AUTHORS/1.3/Thu Feb  6 21:39:47 2003//
-/COPYING/1.1.1.1/Thu Feb  6 21:39:48 2003//
-/ChangeLog/1.84/Thu Feb  6 21:39:49 2003//
-/INSTALL/1.1.1.1/Thu Feb  6 21:39:49 2003//
-/Makefile.am/1.5/Thu Feb  6 21:39:49 2003//
-/NEWS/1.6/Thu Feb  6 21:39:50 2003//
-/README/1.7/Thu Feb  6 21:39:50 2003//
-/acinclude.m4/1.3/Thu Feb  6 21:39:50 2003//
-/autogen.sh/1.2/Thu Feb  6 21:39:50 2003//
-/configure.in/1.18/Thu Feb  6 21:39:50 2003//
-/libxml++-1.0.pc.in/1.4/Thu Feb  6 21:39:50 2003//
-/libxml++.m4/1.1.1.1/Thu Feb  6 21:39:50 2003//
-/xml++-config.in/1.2/Thu Feb  6 21:39:50 2003//
+/AUTHORS/1.3/Thu Feb  6 21:39:01 2003//TBRANCH-1_0
+/COPYING/1.1.1.1/Thu Feb  6 21:39:02 2003//TBRANCH-1_0
+/ChangeLog/1.73.2.8/Thu Feb  6 21:39:03 2003//TBRANCH-1_0
+/INSTALL/1.1.1.1/Thu Feb  6 21:39:03 2003//TBRANCH-1_0
+/Makefile.am/1.5/Thu Feb  6 21:39:03 2003//TBRANCH-1_0
+/NEWS/1.6/Thu Feb  6 21:39:03 2003//TBRANCH-1_0
+/README/1.7/Thu Feb  6 21:39:03 2003//TBRANCH-1_0
+/acinclude.m4/1.2.2.1/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
+/autogen.sh/1.2/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
+/configure.in/1.17/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
+/libxml++-1.0.pc.in/1.4/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
+/libxml++.m4/1.1.1.1/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
+/xml++-config.in/1.2/Thu Feb  6 21:39:04 2003//TBRANCH-1_0
diff -up --recursive libxml++/CVS/Root branches/libxml++/CVS/Root
--- libxml++/CVS/Root	2002-11-29 16:30:54.000000000 +0100
+++ branches/libxml++/CVS/Root	2003-02-06 19:04:44.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/CVS: Tag
diff -up --recursive libxml++/docs/CVS/Entries branches/libxml++/docs/CVS/Entries
--- libxml++/docs/CVS/Entries	2003-02-06 22:39:56.000000000 +0100
+++ branches/libxml++/docs/CVS/Entries	2003-02-06 22:39:12.000000000 +0100
@@ -1,4 +1,4 @@
-/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//
+/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
 D/reference////
diff -up --recursive libxml++/docs/CVS/Root branches/libxml++/docs/CVS/Root
--- libxml++/docs/CVS/Root	2003-02-06 22:39:50.000000000 +0100
+++ branches/libxml++/docs/CVS/Root	2003-02-06 22:39:04.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/CVS: Tag
diff -up --recursive libxml++/docs/reference/CVS/Entries branches/libxml++/docs/reference/CVS/Entries
--- libxml++/docs/reference/CVS/Entries	2003-02-06 22:39:56.000000000 +0100
+++ branches/libxml++/docs/reference/CVS/Entries	2003-02-06 22:39:12.000000000 +0100
@@ -1,4 +1,4 @@
-/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//
+/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
 D/html////
diff -up --recursive libxml++/docs/reference/CVS/Root branches/libxml++/docs/reference/CVS/Root
--- libxml++/docs/reference/CVS/Root	2003-02-06 22:39:50.000000000 +0100
+++ branches/libxml++/docs/reference/CVS/Root	2003-02-06 22:39:04.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/reference/CVS: Tag
diff -up --recursive libxml++/docs/reference/html/CVS/Entries branches/libxml++/docs/reference/html/CVS/Entries
--- libxml++/docs/reference/html/CVS/Entries	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/docs/reference/html/CVS/Entries	2003-02-06 22:39:05.000000000 +0100
@@ -1,2 +1,2 @@
-/.cvsignore/1.1/Tue Nov  5 22:54:14 2002//
+/.cvsignore/1.1/Tue Nov  5 22:54:14 2002//TBRANCH-1_0
 D
diff -up --recursive libxml++/docs/reference/html/CVS/Root branches/libxml++/docs/reference/html/CVS/Root
--- libxml++/docs/reference/html/CVS/Root	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/docs/reference/html/CVS/Root	2003-02-06 22:39:05.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/docs/reference/html/CVS: Tag
diff -up --recursive libxml++/examples/CVS/Entries branches/libxml++/examples/CVS/Entries
--- libxml++/examples/CVS/Entries	2003-02-06 22:39:56.000000000 +0100
+++ branches/libxml++/examples/CVS/Entries	2003-02-06 22:39:12.000000000 +0100
@@ -1,7 +1,6 @@
-/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////
+/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
 D/dom_build////
 D/dom_parser////
 D/sax_exception////
diff -up --recursive libxml++/examples/CVS/Root branches/libxml++/examples/CVS/Root
--- libxml++/examples/CVS/Root	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/examples/CVS/Root	2003-02-06 22:39:05.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/CVS: Tag
Only in libxml++/examples: dom
diff -up --recursive libxml++/examples/dom_build/CVS/Entries branches/libxml++/examples/dom_build/CVS/Entries
--- libxml++/examples/dom_build/CVS/Entries	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/examples/dom_build/CVS/Entries	2003-02-06 22:39:06.000000000 +0100
@@ -1,3 +1,3 @@
-/Makefile.am/1.1/Mon Nov 18 14:02:21 2002//
-/main.cc/1.7/Mon Feb  3 18:47:27 2003//
+/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
 D
diff -up --recursive libxml++/examples/dom_build/CVS/Root branches/libxml++/examples/dom_build/CVS/Root
--- libxml++/examples/dom_build/CVS/Root	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/examples/dom_build/CVS/Root	2003-02-06 22:39:05.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/dom_build/CVS: Tag
diff -up --recursive libxml++/examples/dom_parser/CVS/Entries branches/libxml++/examples/dom_parser/CVS/Entries
--- libxml++/examples/dom_parser/CVS/Entries	2003-02-06 22:39:52.000000000 +0100
+++ branches/libxml++/examples/dom_parser/CVS/Entries	2003-02-06 22:39:06.000000000 +0100
@@ -1,4 +1,4 @@
-/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.16/Fri Jan 31 22:54:12 2003//
+/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/Fri Jan 31 22:54:12 2003//TBRANCH-1_0
 D
diff -up --recursive libxml++/examples/dom_parser/CVS/Root branches/libxml++/examples/dom_parser/CVS/Root
--- libxml++/examples/dom_parser/CVS/Root	2003-02-06 22:39:51.000000000 +0100
+++ branches/libxml++/examples/dom_parser/CVS/Root	2003-02-06 22:39:06.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/dom_parser/CVS: Tag
diff -up --recursive libxml++/examples/Makefile.am branches/libxml++/examples/Makefile.am
--- libxml++/examples/Makefile.am	2003-02-04 06:46:40.000000000 +0100
+++ branches/libxml++/examples/Makefile.am	2002-12-02 19:35:37.000000000 +0100
@@ -1,3 +1,3 @@
-SUBDIRS = dom_build dom_parser dom sax_parser sax_exception
+SUBDIRS = dom_build dom_parser sax_parser sax_exception
 
 EXTRA_DIST = README Makefile.am_fragment
diff -up --recursive libxml++/examples/sax_exception/CVS/Entries branches/libxml++/examples/sax_exception/CVS/Entries
--- libxml++/examples/sax_exception/CVS/Entries	2003-02-06 22:39:52.000000000 +0100
+++ branches/libxml++/examples/sax_exception/CVS/Entries	2003-02-06 22:39:07.000000000 +0100
@@ -1,6 +1,6 @@
-/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//
+/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/Thu Dec 19 12:37:49 2002//TBRANCH-1_0
+/myparser.h/1.2/Tue Dec 17 18:10:38 2002//TBRANCH-1_0
 D
diff -up --recursive libxml++/examples/sax_exception/CVS/Root branches/libxml++/examples/sax_exception/CVS/Root
--- libxml++/examples/sax_exception/CVS/Root	2003-02-06 22:39:52.000000000 +0100
+++ branches/libxml++/examples/sax_exception/CVS/Root	2003-02-06 22:39:06.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/sax_exception/CVS: Tag
diff -up --recursive libxml++/examples/sax_exception/myparser.cc branches/libxml++/examples/sax_exception/myparser.cc
--- libxml++/examples/sax_exception/myparser.cc	2003-02-03 23:06:14.000000000 +0100
+++ branches/libxml++/examples/sax_exception/myparser.cc	2002-12-19 13:37:49.000000000 +0100
@@ -68,17 +68,14 @@ void MySaxParser::on_end_document()
   std::cout << "on_end_document()" << std::endl;
 }
 
-void MySaxParser::on_start_element(const std::string& name,
-                                   const AttributeMap& attributes)
+void MySaxParser::on_start_element(const std::string& name, const xmlpp::Element::AttributeMap& attributes)
 {
   std::cout << "node name=" << name << std::endl;
 
   // Print attributes:
-  for(AttributeMap::const_iterator iter = attributes.begin();
-      iter != attributes.end();
-      ++iter)
+  for(xmlpp::Element::AttributeMap::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter)
   {
-    std::cout << "  Attribute " << iter->first << " = " << iter->second << std::endl;
+    std::cout << "  Attribute " << iter->first << " = " << iter->second->get_value() << std::endl;
   }
 
   throw MyException();
diff -up --recursive libxml++/examples/sax_exception/myparser.h branches/libxml++/examples/sax_exception/myparser.h
--- libxml++/examples/sax_exception/myparser.h	2003-02-03 23:06:14.000000000 +0100
+++ branches/libxml++/examples/sax_exception/myparser.h	2002-12-17 19:10:38.000000000 +0100
@@ -43,8 +43,7 @@ class MySaxParser : public xmlpp::SaxPar
     //overrides:
     virtual void on_start_document();
     virtual void on_end_document();
-    virtual void on_start_element(const std::string& name,
-                                  const AttributeMap &properties);
+    virtual void on_start_element(const std::string& name, const xmlpp::Element::AttributeMap &properties);
     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);
diff -up --recursive libxml++/examples/sax_parser/CVS/Entries branches/libxml++/examples/sax_parser/CVS/Entries
--- libxml++/examples/sax_parser/CVS/Entries	2003-02-06 22:39:53.000000000 +0100
+++ branches/libxml++/examples/sax_parser/CVS/Entries	2003-02-06 22:39:08.000000000 +0100
@@ -1,6 +1,6 @@
-/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//
+/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/Thu Dec 19 12:37:49 2002//TBRANCH-1_0
+/myparser.h/1.4/Tue Dec 17 18:10:39 2002//TBRANCH-1_0
 D
diff -up --recursive libxml++/examples/sax_parser/CVS/Root branches/libxml++/examples/sax_parser/CVS/Root
--- libxml++/examples/sax_parser/CVS/Root	2003-02-06 22:39:52.000000000 +0100
+++ branches/libxml++/examples/sax_parser/CVS/Root	2003-02-06 22:39:07.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/examples/sax_parser/CVS: Tag
diff -up --recursive libxml++/examples/sax_parser/myparser.cc branches/libxml++/examples/sax_parser/myparser.cc
--- libxml++/examples/sax_parser/myparser.cc	2003-02-03 23:06:15.000000000 +0100
+++ branches/libxml++/examples/sax_parser/myparser.cc	2002-12-19 13:37:49.000000000 +0100
@@ -41,17 +41,14 @@ void MySaxParser::on_end_document()
   std::cout << "on_end_document()" << std::endl;
 }
 
-void MySaxParser::on_start_element(const std::string& name,
-                                   const AttributeMap& attributes)
+void MySaxParser::on_start_element(const std::string& name, const xmlpp::Element::AttributeMap& attributes)
 {
   std::cout << "node name=" << name << std::endl;
 
   // Print attributes:
-  for(AttributeMap::const_iterator iter = attributes.begin();
-      iter != attributes.end();
-      ++iter)
+  for(xmlpp::Element::AttributeMap::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter)
   {
-    std::cout << "  Attribute " << iter->first << " = " << iter->second << std::endl;
+    std::cout << "  Attribute " << iter->first << " = " << iter->second->get_value() << std::endl;
   }
 }
 
diff -up --recursive libxml++/examples/sax_parser/myparser.h branches/libxml++/examples/sax_parser/myparser.h
--- libxml++/examples/sax_parser/myparser.h	2003-02-03 23:06:15.000000000 +0100
+++ branches/libxml++/examples/sax_parser/myparser.h	2002-12-17 19:10:39.000000000 +0100
@@ -34,8 +34,7 @@ protected:
   //overrides:
   virtual void on_start_document();
   virtual void on_end_document();
-  virtual void on_start_element(const std::string& name,
-                                const AttributeMap& properties);
+  virtual void on_start_element(const std::string& name, const xmlpp::Element::AttributeMap& properties);
   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);
diff -up --recursive libxml++/libxml++/attribute.cc branches/libxml++/libxml++/attribute.cc
--- libxml++/libxml++/attribute.cc	2003-02-06 22:03:54.000000000 +0100
+++ branches/libxml++/libxml++/attribute.cc	2003-02-06 22:23:22.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 libxml++/libxml++/CVS/Entries branches/libxml++/libxml++/CVS/Entries
--- libxml++/libxml++/CVS/Entries	2003-02-06 22:39:56.000000000 +0100
+++ branches/libxml++/libxml++/CVS/Entries	2003-02-06 22:39:12.000000000 +0100
@@ -1,12 +1,12 @@
-/.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.4/Thu Feb  6 21:39:33 2003//
-/document.h/1.2/Thu Feb  6 20:20:47 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//
+/.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.4/Thu Feb  6 21:43:05 2003//TBRANCH-1_0
+/document.h/1.1.2.2/Thu Feb  6 20:11:37 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
 D/exceptions////
 D/nodes////
 D/parsers////
diff -up --recursive libxml++/libxml++/CVS/Root branches/libxml++/libxml++/CVS/Root
--- libxml++/libxml++/CVS/Root	2003-02-06 22:39:53.000000000 +0100
+++ branches/libxml++/libxml++/CVS/Root	2003-02-06 22:39:08.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/CVS: Tag
diff -up --recursive libxml++/libxml++/document.cc branches/libxml++/libxml++/document.cc
--- libxml++/libxml++/document.cc	2003-02-06 22:39:33.000000000 +0100
+++ branches/libxml++/libxml++/document.cc	2003-02-06 22:43:05.000000000 +0100
@@ -116,7 +116,7 @@ void destruct(xmlNode* node)
    else if (node->type == XML_DOCUMENT_NODE)
       // do nothing. See construct for an explanation
       ;
-   else
+   else //Nodes (including Attributes):
       delete static_cast<xmlpp::Node*>(node->_private);
 }
 
diff -up --recursive libxml++/libxml++/exceptions/CVS/Entries branches/libxml++/libxml++/exceptions/CVS/Entries
--- libxml++/libxml++/exceptions/CVS/Entries	2003-02-06 22:39:54.000000000 +0100
+++ branches/libxml++/libxml++/exceptions/CVS/Entries	2003-02-06 22:39:09.000000000 +0100
@@ -1,8 +1,8 @@
-/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//
+/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
 D
diff -up --recursive libxml++/libxml++/exceptions/CVS/Root branches/libxml++/libxml++/exceptions/CVS/Root
--- libxml++/libxml++/exceptions/CVS/Root	2003-02-06 22:39:53.000000000 +0100
+++ branches/libxml++/libxml++/exceptions/CVS/Root	2003-02-06 22:39:09.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/exceptions/CVS: Tag
diff -up --recursive libxml++/libxml++/nodes/CVS/Entries branches/libxml++/libxml++/nodes/CVS/Entries
--- libxml++/libxml++/nodes/CVS/Entries	2003-02-06 22:39:55.000000000 +0100
+++ branches/libxml++/libxml++/nodes/CVS/Entries	2003-02-06 22:39:10.000000000 +0100
@@ -1,11 +1,11 @@
-/.cvsignore/1.1/Wed Dec 18 16:01:26 2002//
-/Makefile.am/1.1/Wed Dec 18 16:01:26 2002//
-/commentnode.cc/1.3/Mon Feb  3 14:38:34 2003//
-/commentnode.h/1.3/Mon Feb  3 14:38:35 2003//
-/element.cc/1.6/Thu Feb  6 20:33:05 2003//
-/element.h/1.4/Mon Feb  3 14:38:35 2003//
-/node.cc/1.14/Thu Feb  6 21:39:37 2003//
-/node.h/1.13/Thu Feb  6 21:03:54 2003//
-/textnode.cc/1.4/Mon Feb  3 14:38:36 2003//
-/textnode.h/1.4/Mon Feb  3 14:38:36 2003//
+/.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.1/Thu Feb  6 18:20:13 2003//TBRANCH-1_0
+/commentnode.h/1.2.2.1/Thu Feb  6 18:20:14 2003//TBRANCH-1_0
+/element.cc/1.4.2.2/Thu Feb  6 20:36:40 2003//TBRANCH-1_0
+/element.h/1.3.2.1/Thu Feb  6 18:20:15 2003//TBRANCH-1_0
+/node.cc/1.6.2.6/Thu Feb  6 20:49:24 2003//TBRANCH-1_0
+/node.h/1.5.2.4/Thu Feb  6 20:49:25 2003//TBRANCH-1_0
+/textnode.cc/1.3.2.1/Thu Feb  6 18:20:16 2003//TBRANCH-1_0
+/textnode.h/1.3.2.1/Thu Feb  6 18:20:17 2003//TBRANCH-1_0
 D
diff -up --recursive libxml++/libxml++/nodes/CVS/Root branches/libxml++/libxml++/nodes/CVS/Root
--- libxml++/libxml++/nodes/CVS/Root	2003-02-06 22:39:54.000000000 +0100
+++ branches/libxml++/libxml++/nodes/CVS/Root	2003-02-06 22:39:09.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/nodes/CVS: Tag
diff -up --recursive libxml++/libxml++/nodes/node.cc branches/libxml++/libxml++/nodes/node.cc
--- libxml++/libxml++/nodes/node.cc	2003-02-06 22:39:37.000000000 +0100
+++ branches/libxml++/libxml++/nodes/node.cc	2003-02-06 21:49:24.000000000 +0100
@@ -18,7 +18,7 @@ namespace xmlpp
 {
 
 Node::Node(xmlNode* node)
-  : _impl(node)
+: _impl(node)
 {
    _impl->_private = this;
 }
@@ -48,40 +48,13 @@ const Node::NodeList Node::get_children(
   return const_cast<Node*>(this)->get_children(name);
 }
 
-Element* Node::append_child(const std::string& name)
+Element *Node::add_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);
-}
-
-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);
+   xmlNode* node = xmlAddChild(_impl, xmlNewNode(0, (xmlChar*)name.c_str()));
+   return static_cast<Element*>(node->_private);
 }
 
 TextNode* Node::add_content(const std::string& content)
@@ -220,38 +193,6 @@ const xmlNode* Node::cobj() const
   return _impl;
 }
 
-std::string Node::get_path() const
-{
-  xmlChar* path = xmlGetNodePath(_impl);
-  std::string retn = path ? (char*)path : "";
-  xmlFree(path);
-  return retn;
-}
-
-NodeSet Node::find(const std::string& xpath) const
-{
-  xmlXPathContext* ctxt = xmlXPathNewContext(_impl->doc);
-  ctxt->node = _impl;
-  xmlXPathObject* result = xmlXPathEval((xmlChar*)xpath.c_str(), ctxt);
-
-  if (result->type != XPATH_NODESET)
-  {
-    xmlXPathFreeObject(result);
-    xmlXPathFreeContext(ctxt);
-    throw internal_error("sorry, only nodeset result types supported for now.");
-  }
-
-  xmlNodeSet* nodeset = result->nodesetval;
-  NodeSet nodes;
-  for (int i = 0; i != nodeset->nodeNr; ++i)
-    nodes.push_back(static_cast<Node*>(nodeset->nodeTab[i]->_private));
-
-  xmlXPathFreeObject(result);
-  xmlXPathFreeContext(ctxt);
-
-  return nodes;
-}
-
 } //namespace xmlpp
 
 
diff -up --recursive libxml++/libxml++/nodes/node.h branches/libxml++/libxml++/nodes/node.h
--- libxml++/libxml++/nodes/node.h	2003-02-06 22:03:54.000000000 +0100
+++ branches/libxml++/libxml++/nodes/node.h	2003-02-06 21:49:25.000000000 +0100
@@ -10,17 +10,14 @@
 #include <string>
 #include <list>
 #include <map>
-#include <vector>
 
 #include <libxml/tree.h>
 
 namespace xmlpp {
 
-class Node;
 class TextNode;
 class Element;
 class Attribute;
-typedef std::vector<Node*> NodeSet;
 
 /** Represents XML Nodes.
  * You should never new or delete Nodes. The Parser will create and manage them for you.
@@ -28,20 +25,13 @@ 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;
+  typedef std::map<std::string, Attribute*> AttributeMap;
 
-  explicit Node(xmlNode* node);
+  explicit Node(xmlNodePtr 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;
 
@@ -66,20 +56,17 @@ public:
   NodeList get_children(const std::string& name = std::string());
   const NodeList get_children(const std::string& name = std::string()) const;
 
-  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);
+  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);
+
 
   /** Remove the child node.
    * @param node The child node to remove. This Node will be deleted and therefore unusable after calling this method.
    */
   void remove_child(Node* node);
 
-  std::string get_path() const;
-  NodeSet find(const std::string& xpath) const;
-
   ///Access the underlying libxml implementation.
   xmlNode* cobj();
 
@@ -98,78 +85,11 @@ protected:
   std::string get_content() const;
   void set_content(const std::string& content);
 
+   
 private:
-  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;
+   xmlNode* _impl;
 };
 
-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 libxml++/libxml++/parsers/CVS/Entries branches/libxml++/libxml++/parsers/CVS/Entries
--- libxml++/libxml++/parsers/CVS/Entries	2003-02-06 22:39:56.000000000 +0100
+++ branches/libxml++/libxml++/parsers/CVS/Entries	2003-02-06 22:39:12.000000000 +0100
@@ -1,8 +1,8 @@
-/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//
+/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.3/Thu Feb  6 21:43:08 2003//TBRANCH-1_0
+/saxparser.h/1.16.2.1/Thu Feb  6 21:23:26 2003//TBRANCH-1_0
 D
diff -up --recursive libxml++/libxml++/parsers/CVS/Root branches/libxml++/libxml++/parsers/CVS/Root
--- libxml++/libxml++/parsers/CVS/Root	2003-02-06 22:39:55.000000000 +0100
+++ branches/libxml++/libxml++/parsers/CVS/Root	2003-02-06 22:39:10.000000000 +0100
@@ -1 +1 @@
-:ext:murrayc cvs libxmlplusplus sourceforge net:/cvsroot/libxmlplusplus
+:ext:murrayc cvs sourceforge net:/cvsroot/libxmlplusplus
Only in branches/libxml++/libxml++/parsers/CVS: Tag
diff -up --recursive libxml++/libxml++/parsers/saxparser.cc branches/libxml++/libxml++/parsers/saxparser.cc
--- libxml++/libxml++/parsers/saxparser.cc	2003-02-06 22:39:38.000000000 +0100
+++ branches/libxml++/libxml++/parsers/saxparser.cc	2003-02-06 22:43:08.000000000 +0100
@@ -70,7 +70,7 @@ void SaxParser::on_end_document()
 {
 }
 
-void SaxParser::on_start_element(const std::string& name, const AttributeMap& attributes)
+void SaxParser::on_start_element(const std::string& nameame, const Element::AttributeMap& attributes)
 {
 }
 
@@ -233,24 +233,36 @@ 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;
+  Element::AttributeMap attributes;
 
   if(p)
-    for(const xmlChar** cur = p; cur && *cur; cur += 2)
-      attributes[(char*)*cur] = (char*)*(cur + 1);
+  {
+    for(const xmlChar* *cur = p; cur && *cur; cur += 2)
+    {
+      // FIXME: xmlpp::Attribute is the wrong type for this,
+      // as it is meant to be used in the DOM programming model
+      // we should really be using string/string pairs here...
+      // -stefan
+      xmlAttr* attr = xmlNewProp(0, *cur, *(cur + 1));
+      attributes[(char*)*cur] = static_cast<Attribute*>(attr->_private);
+    }
+  }
    
   try
   {
     parser->on_start_element(std::string((const char*) name), attributes);
+  } catch (const exception& e) {
+    parser->handleException(e);
   }
-  catch (const exception& e)
+
+  for(Element::AttributeMap::iterator i = attributes.begin();
+      i != attributes.end();
+      ++i)
   {
-    parser->handleException(e);
+    delete i->second;
   }
 }
 
diff -up --recursive libxml++/libxml++/parsers/saxparser.h branches/libxml++/libxml++/parsers/saxparser.h
--- libxml++/libxml++/parsers/saxparser.h	2003-02-06 22:39:38.000000000 +0100
+++ branches/libxml++/libxml++/parsers/saxparser.h	2003-02-06 22:23:26.000000000 +0100
@@ -21,7 +21,6 @@ namespace xmlpp {
 class SaxParser : public Parser
 {
 public:
-  typedef std::map<std::string, std::string> AttributeMap;
   SaxParser();
   virtual ~SaxParser();
 
@@ -33,7 +32,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 Element::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]