00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00031 #ifndef SP_GXML_XMLNODESET_HPP
00032 #define SP_GXML_XMLNODESET_HPP
00033 
00034 
00035 #include <libxslt/xsltInternals.h>
00036 #include <libxml/xpath.h>
00037 #include <libxml/tree.h>
00038 
00039 
00040 #include <sp-gxmlcpp/XMLNode.hpp>
00041 #include <sp-gxmlcpp/XMLException.hpp>
00042 
00043 namespace SP
00044 {
00045 namespace GXML
00046 {
00047 
00048 
00049 class XMLTree;
00050 
00051 class XMLNodeSet
00052 {
00053 public:
00054         XMLNodeSet( const std::string& xpath, const XMLTree* tree );
00055         ~XMLNodeSet();
00056 
00057         class Iterator
00058         {
00059         public:
00060                 Iterator();
00061                 Iterator( const xmlNodeSetPtr set );
00062                 ~Iterator();
00063                 Iterator operator ++();
00064                 bool operator !=( const Iterator& iter);
00065                 XMLNode operator *();
00066                 int getPosition();
00067 
00068         private:
00069                 int pos_;
00070                 xmlNodeSetPtr set_;
00071         };
00072 
00073         int size();
00074         Iterator begin();
00075         Iterator end();
00076         
00077         
00078 
00079 private:
00080         xmlXPathObjectPtr xPathObj_;
00081 };
00082 
00083 }}
00084 #endif