it_bus_pdk/xml_tree_walker.h

00001 //         @Copyright (c) 1993-2003 IONA Technologies INC.
00002 //                    All Rights Reserved
00003 //
00004 // This class does a pre-order walk of a DOM tree, calling a ContentHandler
00005 // interface as it goes. This is a C++ port of the Java TreeWalker class,
00006 // which is part of the Xalan utilities.
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         throw(());
00035     
00036         void 
00037         set_content_handler(
00038             ContentHandler* ch
00039         ) throw(());
00040     
00041         void 
00042         traverse(
00043             DOMNode* pos
00044         ) throw((SAXException));
00045 
00046         void 
00047         traverse(
00048             DOMNode* pos, 
00049             DOMNode* top
00050         ) throw((SAXException));
00051 
00052       private:
00053 
00054         void 
00055         dispatch_chars(
00056             DOMNode* node
00057         ) throw((SAXException));
00058     
00059         void 
00060         start_node(
00061             DOMNode* node
00062         ) throw((SAXException));
00063     
00064         void 
00065         end_node(
00066             DOMNode* node
00067         ) throw((SAXException));  
00068     
00069         Attributes*
00070         extract_attributes(
00071             DOMNamedNodeMap* source
00072         ) throw(());
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 

Generated on Tue Mar 20 15:27:53 2007 for Artix by  doxygen 1.5.1-p1