00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _XML_TREE_WALKER_H_
00009 #define _XML_TREE_WALKER_H_
00010
00011 #include <xercesc/dom/DOM.hpp>
00012 #include <xercesc/sax/SAXException.hpp>
00013 #include <xercesc/sax2/ContentHandler.hpp>
00014 #include <xercesc/sax2/Attributes.hpp>
00015
00016 #include <it_bus/types.h>
00017
00018 XERCES_CPP_NAMESPACE_USE
00019
00020 namespace IT_Bus
00021 {
00022 class IT_BUS_XML_API TreeWalker
00023 {
00024 public:
00025
00026 TreeWalker(
00027 ContentHandler* content_handler
00028 );
00029
00030 ~TreeWalker();
00031
00032 const ContentHandler *
00033 get_content_handler()
00034 IT_THROW_DECL(());
00035
00036 void
00037 set_content_handler(
00038 ContentHandler* ch
00039 ) IT_THROW_DECL(());
00040
00041 void
00042 traverse(
00043 DOMNode* pos
00044 ) IT_THROW_DECL((SAXException));
00045
00046 void
00047 traverse(
00048 DOMNode* pos,
00049 DOMNode* top
00050 ) IT_THROW_DECL((SAXException));
00051
00052 private:
00053
00054 void
00055 dispatch_chars(
00056 DOMNode* node
00057 ) IT_THROW_DECL((SAXException));
00058
00059 void
00060 start_node(
00061 DOMNode* node
00062 ) IT_THROW_DECL((SAXException));
00063
00064 void
00065 end_node(
00066 DOMNode* node
00067 ) IT_THROW_DECL((SAXException));
00068
00069 Attributes*
00070 extract_attributes(
00071 DOMNamedNodeMap* source
00072 ) IT_THROW_DECL(());
00073
00074 ContentHandler* m_content_handler;
00075 bool m_next_is_raw;
00076
00077 XMLCh* m_xmlns_with_colon;
00078 XMLCh* m_xmlns_without_colon;
00079 XMLCh* m_next_is_raw_str;
00080 XMLCh* m_enable_output;
00081 XMLCh* m_disable_output;
00082 };
00083 }
00084
00085 #endif