Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

XercesHandler.h

00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00017 /*
00018  *    @author sanjaya singharage (sanjayas@opensource.lk)
00019  */
00020 
00021 #include    <xercesc/sax/HandlerBase.hpp>
00022 #include    <xercesc/sax2/DefaultHandler.hpp>
00023 #include <axis/server/AnyElement.h>
00024 #include <stdlib.h>
00025 #include <map>
00026 #include <string>
00027 #include "../../include/axis/server/GDefine.h"
00028 
00029 XERCES_CPP_NAMESPACE_USE
00030 
00031 using namespace std;
00032 
00033 class XercesHandler : public XERCES_CPP_NAMESPACE::DefaultHandler
00034 {
00035 public :
00036     void freeElement();
00037     int GetStatus(){return m_nStatus;};
00038     /* -----------------------------------------------------------------------
00039      *  Constructors
00040      * -----------------------------------------------------------------------
00041      */
00042     XercesHandler();
00043     ~XercesHandler();
00044 
00045 
00046 
00047     const XML_Ch* XercesHandler::NS4Prefix(const XML_Ch* prefix);
00048 
00049     AnyElement* getAnyElement()
00050     {
00051         return m_pCurrElement;
00052     }
00053 
00054 private:
00055     /* -----------------------------------------------------------------------
00056      *  Handlers for the SAX DocumentHandler interface
00057      * -----------------------------------------------------------------------
00058      */
00059     void startElement(const XMLCh *const uri,const XMLCh *const localname,
00060         const XMLCh *const qname,const Attributes &attrs);
00061     void endElement (const XMLCh *const uri,const XMLCh *const localname,
00062         const XMLCh *const qname);
00063     void characters(const XMLCh* const chars, const unsigned int length);
00064     void startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri);
00065     void endPrefixMapping(const XMLCh* const prefix);
00066     void ignorableWhitespace(const XMLCh* const chars, 
00067         const unsigned int length);
00068     void resetDocument();
00069 
00070 
00071     /* -----------------------------------------------------------------------
00072      *  Implementations of the SAX ErrorHandler interface
00073      * -----------------------------------------------------------------------
00074      */
00075     void warning(const SAXParseException& exception);
00076     void error(const SAXParseException& exception);
00077     void fatalError(const SAXParseException& exception);
00078 
00079     int m_nStatus;
00080     AnyElement * Nelement;
00081     AnyElement * m_pCurrElement;
00082 
00083     map<AxisXMLString, AxisXMLString> m_NsStack;
00084     void initAnyElement()
00085     {
00086         Nelement->m_pchNameOrValue = NULL;
00087         Nelement->m_pchNamespace = NULL;
00088     }
00089 
00090 };

Generated on Fri Apr 9 12:21:29 2004 for axiscpp by doxygen1.2.18