xercesxmlnode.h

00001 #ifndef XERCESFIELDNODE_H_PROTECTOR
00002 #define XERCESFIELDNODE_H_PROTECTOR
00003 
00004 #include "xmlnode.h"
00005 
00006 #include <map>
00007 
00008 #include <xercesc/util/PlatformUtils.hpp>
00009 #include <xercesc/dom/DOM.hpp>
00010 #include <xercesc/dom/DOMImplementation.hpp>
00011 #include <xercesc/dom/DOMImplementationLS.hpp>
00012 #include <xercesc/dom/DOMErrorHandler.hpp>
00013 #include <xercesc/framework/StdOutFormatTarget.hpp>
00014 #include <xercesc/framework/LocalFileFormatTarget.hpp>
00015 #include <xercesc/parsers/XercesDOMParser.hpp>
00016 #include <xercesc/util/XMLUni.hpp>
00017 
00018 using namespace xercesc;
00019 
00020 namespace afl
00021 {
00022     class XercesParser;
00023 
00027     class XercesXMLNode : public XMLNode
00028     {
00029         public:
00035             XercesXMLNode(XMLParser* parser, DOMNode* node);
00036 
00041             virtual ~XercesXMLNode();
00042 
00046             virtual XMLNode* getFirstChild() const;
00047 
00052             virtual XMLNode* getNextSibling() const;
00053 
00061             virtual std::string getNamedAttribute(const std::string& name) const;
00062 
00066             virtual std::string getName() const;
00067 
00072             virtual std::string getText() const;
00073 
00078             virtual std::string toString() const;
00079             
00080         private:
00081             DOMNode* nextIfComment(DOMNode* n) const;
00082 
00083         private:
00084             DOMNode* _parent; // the Xerces node correspinding to this one.
00085             DOMNamedNodeMap* _attributes; // the attributes of this node.
00086             mutable std::map<DOMNode*,XMLNode*> _children; // the wrappers immediately accessible from this node, fist child or next sibling only actually because I don't need bidirercional operations or up. It's mutable because I'm using lazy creation in stead of preemtive.
00087     };
00088 
00089 }
00090 
00091 #endif
00092 

Generated on Fri Dec 22 07:17:50 2006 for afl by  doxygen 1.4.6