- Main Page
- Related Pages
- Modules
- Classes
- Files

# SaxHandler.h

Go to the documentation of this file.

    00001 #ifndef FDO_XML_SAXHANDLER_H
    00002 #define FDO_XML_SAXHANDLER_H
    00003 //
    00004
    00005 //
    00006 // Copyright (C) 2004-2006  Autodesk, Inc.
    00007 //
    00008 // This library is free software; you can redistribute it and/or
    00009 // modify it under the terms of version 2.1 of the GNU Lesser
    00010 // General Public License as published by the Free Software Foundation.
    00011 //
    00012 // This library is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015 // Lesser General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Lesser General Public
    00018 // License along with this library; if not, write to the Free Software
    00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    00020 //
    00021
    00022 #include <FdoCommon.h>
    00023
    00024 /// \brief
    00025 /// FdoXmlSaxHandler defines the FDO SAX Handler callback interface.
    00026 /// It is not an interface in the strict sense, since each function has a
    00027 /// default implementation that does nothing. Implementors can override these
    00028 /// callbacks to customize the handling of XML fragments parsed by FdoXmlReader.
    00029 class FdoXmlSaxHandler
    00030 {
    00031 public:
    00032
    00033     /// \brief
    00034     /// Default Sax callback that is called when the FdoXmlReader
    00035     /// starts reading an XML document. Does nothing.
    00036     ///
    00037     /// \param saxContext
    00038     /// Input caller specified contextual information
    00039     ///
    00040     /// \return
    00041     /// Returns the SAX Handler for the document's root element. If NULL then
    00042     /// this SAX handler will handle the root element
    00043     ///
    00044     FDO_API_COMMON virtual FdoXmlSaxHandler* XmlStartDocument(FdoXmlSaxContext* saxContext);
    00045
    00046     /// \brief
    00047     /// Default Sax callback that is called when the FdoXmlReader
    00048     /// finishes reading an XML document. Does nothing
    00049     ///
    00050     /// \param saxContext
    00051     /// Input caller specified contextual information
    00052     ///
    00053     FDO_API_COMMON virtual void XmlEndDocument(FdoXmlSaxContext* saxContext);
    00054
    00055     /// \brief
    00056     /// Default Sax callback that is called when the FdoXmlReader
    00057     /// reads the start tag for an XML element in the document. Does nothing.
    00058     ///
    00059     /// \param saxContext
    00060     /// Input caller specified contextual information
    00061     /// \param uri
    00062     /// Input the element's Universal Resource Indicator
    00063     /// \param name
    00064     /// Input the unqualified element name (doesn't include namespace)
    00065     /// \param qname
    00066     /// Input the qualified element name (includes namespace)
    00067     /// \param atts
    00068     /// Input the attributes for the element.
    00069     ///
    00070     /// \return
    00071     /// Returns the SAX Handler for the element's sub-elements. If NULL then
    00072     /// this SAX handler will handle the sub-elements
    00073     ///
    00074     FDO_API_COMMON virtual FdoXmlSaxHandler* XmlStartElement(FdoXmlSaxContext* saxContext, FdoString* uri, FdoString* name, FdoString* qname, FdoXmlAttributeCollection* atts);
    00075
    00076     /// \brief
    00077     /// Default Sax callback that is called when the FdoXmlReader
    00078     /// reads the end tag for an XML element in the document. Does nothing.
    00079     ///
    00080     /// \param saxContext
    00081     /// Input caller specified contextual information
    00082     /// \param uri
    00083     /// Input the element's Universal Resource Indicator
    00084     /// \param name
    00085     /// Input the unqualified element name (doesn't include namespace)
    00086     /// \param qname
    00087     /// Input the qualified element name (includes namespace)
    00088     ///
    00089     /// \return
    00090     /// Returning true causes the current parse to stop. Returning false
    00091     /// cause the parse to continue. Return value is ignored if the current parse
    00092     /// is not an incremental parse ( see FdoXmlReader::Parse())
    00093     ///
    00094     FDO_API_COMMON virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* saxContext, FdoString* uri, FdoString* name, FdoString* qname);
    00095
    00096     /// \brief
    00097     /// Default Sax callback that is called when the FdoXmlReader
    00098     /// reads a chunk of simple content for the current element. Does nothing by default.
    00099     /// This function may be called multiple times for the same element, if the
    00100     /// the content is long. Applications must not make any assumptions about the
    00101     /// chunk size or number of chunks for each element
    00102     ///
    00103     /// \param saxContext
    00104     /// Input caller specified contextual information
    00105     /// \param chars
    00106     /// Input the next chunk of simple content
    00107     ///
    00108     FDO_API_COMMON virtual void XmlCharacters(FdoXmlSaxContext* saxContext, FdoString* chars);
    00109 };
    00110
    00111 #endif
    00112
    00113

Please send us your comment about this page