saxparser.hpp

来自「IBM的解析xml的工具Xerces的源代码」· HPP 代码 · 共 1,708 行 · 第 1/5 页

HPP
1,708
字号
      * the parser.      *      * @param handler A pointer to the error handler to be called      *                when the parser comes across 'error' events      *                as per the SAX specification.      *      * @see Parser#setErrorHandler      */    virtual void setErrorHandler(ErrorHandler* const handler);    /**      * This method installs the user specified PSVI handler on      * the parser.      *      * @param handler A pointer to the PSVI handler to be called      *                when the parser comes across 'PSVI' events      *                as per the schema specification.      *      * @see Parser#setPSVIHandler      */    virtual void setPSVIHandler(PSVIHandler* const handler);    /**      * This method installs the user specified entity resolver on the      * parser. It allows applications to trap and redirect calls to      * external entities.      *      * <i>Any previously set entity resolver is merely dropped, since the parser      * does not own them.  If both setEntityResolver and setXMLEntityResolver      * are called, then the last one is used.</i>      *      * @param resolver A pointer to the entity resolver to be called      *                 when the parser comes across references to      *                 entities in the XML file.      *      * @see Parser#setEntityResolver      */    virtual void setEntityResolver(EntityResolver* const resolver);    /**      * This method installs the user specified entity resolver on the      * parser. It allows applications to trap and redirect calls to      * external entities.      *      * <i>Any previously set entity resolver is merely dropped, since the parser      * does not own them.  If both setEntityResolver and setXMLEntityResolver      * are called, then the last one is used.</i>      *      * @param resolver A pointer to the entity resolver to be called      *                 when the parser comes across references to      *                 entities in the XML file.      *      * @see Parser#setXMLEntityResolver      */    virtual void setXMLEntityResolver(XMLEntityResolver* const resolver);    //@}    // -----------------------------------------------------------------------    //  Implementation of the XMLDocumentHandler interface    // -----------------------------------------------------------------------    /** @name Implementation of the XMLDocumentHandler Interface. */    //@{    /**      * This method is used to report all the characters scanned      * by the parser. The driver will invoke the 'characters'      * method of the user installed SAX Document Handler.      *      * <p>If any advanced callback handlers are installed, the      * corresponding 'docCharacters' method will also be invoked.</p>      *      * @param chars   A const pointer to a Unicode string representing the      *                character data.      * @param length  The length of the Unicode string returned in 'chars'.      * @param cdataSection  A flag indicating if the characters represent      *                      content from the CDATA section.      * @see DocumentHandler#characters      */    virtual void docCharacters    (        const   XMLCh* const    chars        , const unsigned int    length        , const bool            cdataSection    );    /**      * This method is used to report any comments scanned by the parser.      * This method is a no-op unless, unless an advanced callback handler      * is installed, in which case the corresponding 'docComment' method      * is invoked.      *      * @param comment A const pointer to a null terminated Unicode      *                string representing the comment text.      */    virtual void docComment    (        const   XMLCh* const    comment    );    /**      * This method is used to report any PI scanned by the parser.      *      * <p>Any PI's occurring before any 'content' are not reported      * to any SAX handler as per the specification. However, all      * PI's within content are reported via the SAX Document Handler's      * 'processingInstruction' method.      *      * <p>If any advanced callback handlers are installed, the      * corresponding 'docPI' method will be invoked.</p>      *      * @param target A const pointer to a Unicode string representing the      *               target of the PI declaration.      * @param data   A const pointer to a Unicode string representing the      *               data of the PI declaration. See the PI production rule      *               in the XML specification for details.      *      * @see DocumentHandler#processingInstruction      */    virtual void docPI    (        const   XMLCh* const    target        , const XMLCh* const    data    );    /**      * This method is used to indicate the end of root element      * was just scanned by the parser. Corresponding 'endDocument'      * method of the user installed SAX Document Handler will also      * be invoked.      *      * <p>In addition, if any advanced callback handlers are installed,      * the corresponding 'endDocument' method is invoked.</p>      *      * @see DocumentHandler#endDocument      */    virtual void endDocument();    /**      * This method is used to indicate the end tag of an element.      * The driver will invoke the corresponding 'endElement' method of      * the SAX Document Handler interface.      *      * <p>If any advanced callback handlers are installed, the      * corresponding 'endElement' method is also invoked.</p>      *      * @param elemDecl A const reference to the object containing element      *                 declaration information.      * @param urlId    An id referring to the namespace prefix, if      *                 namespaces setting is switched on.      * @param isRoot   A flag indicating whether this element was the      *                 root element.      * @param elemPrefix A const pointer to a Unicode string containing      *                   the namespace prefix for this element. Applicable      *                   only when namespace processing is enabled.      * @see DocumentHandler#endElement      */    virtual void endElement    (        const   XMLElementDecl& elemDecl        , const unsigned int    urlId        , const bool            isRoot        , const XMLCh* const    elemPrefix    );    /**      * This method is used to indicate that an end of an entity reference      * was just scanned.      *      * <p>If any advanced callback handlers are installed, the      * corresponding 'endEnityReference' method is invoked.</p>      *      * @param entDecl A const reference to the object containing the      *                entity declaration information.      */    virtual void endEntityReference    (        const   XMLEntityDecl&  entDecl    );    /**      * This method is used to report all the whitespace characters,      * which are determined to be 'ignorable'. This distinction      * between characters is only made, if validation is enabled.      * Corresponding 'ignorableWhitespace' method of the user installed      * SAX Document Handler interface is called.      *      * <p>Any whitespace before content is not reported to the SAX      * Document Handler method, as per the SAX specification.      * However, if any advanced callback handlers are installed, the      * corresponding 'ignorableWhitespace' method is invoked.</p>      *      * @param chars   A const pointer to a Unicode string representing the      *                ignorable whitespace character data.      * @param length  The length of the Unicode string 'chars'.      * @param cdataSection  A flag indicating if the characters represent      *                      content from the CDATA section.      * @see DocumentHandler#ignorableWhitespace      */    virtual void ignorableWhitespace    (        const   XMLCh* const    chars        , const unsigned int    length        , const bool            cdataSection    );    /**      * This method allows the user installed Document Handler and      * any advanced callback handlers to 'reset' themselves.      */    virtual void resetDocument();    /**      * This method is used to report the start of the parsing process.      * The corresponding user installed SAX Document Handler's method      * 'startDocument' is invoked.      *      * <p>If any advanced callback handlers are installed, then the      * corresponding 'startDocument' method is also called.</p>      *      * @see DocumentHandler#startDocument      */    virtual void startDocument();    /**      * This method is used to report the start of an element. It is      * called at the end of the element, by which time all attributes      * specified are also parsed. The corresponding user installed      * SAX Document Handler's method 'startElement' is invoked.      *      * <p>If any advanced callback handlers are installed, then the      * corresponding 'startElement' method is also called.</p>      *      * @param elemDecl A const reference to the object containing element      *                 declaration information.      * @param urlId    An id referring to the namespace prefix, if      *                 namespaces setting is switched on.      * @param elemPrefix A const pointer to a Unicode string containing      *                   the namespace prefix for this element. Applicable      *                   only when namespace processing is enabled.      * @param attrList  A const reference to the object containing the      *                  list of attributes just scanned for this element.      * @param attrCount A count of number of attributes in the list      *                  specified by the parameter 'attrList'.      * @param isEmpty  A flag indicating whether this is an empty element      *                 or not.      * @param isRoot   A flag indicating whether this element was the      *                 root element.      * @see DocumentHandler#startElement      */    virtual void startElement    (        const   XMLElementDecl&         elemDecl        , const unsigned int            urlId        , const XMLCh* const            elemPrefix        , const RefVectorOf<XMLAttr>&   attrList        , const unsigned int            attrCount        , const bool                    isEmpty        , const bool                    isRoot    );    /**      * This method is used to indicate the start of an entity reference.      *      * <p>If any advanced callback handlers are installed, the      * corresponding 'endEnityReference' method is invoked.</p>      *      * @param entDecl A const reference to the object containing the      *                entity declaration information.      */    virtual void startEntityReference    (        const   XMLEntityDecl&  entDecl    );    /**      * This method is used to report the XML decl scanned by the parser.      * Refer to the XML specification to see the meaning of parameters.      *      * <b>This method is a no-op for this SAX driver      * implementation.</b>      *      * @param versionStr A const pointer to a Unicode string representing      *                   version string value.      * @param encodingStr A const pointer to a Unicode string representing      *                    the encoding string value.      * @param standaloneStr A const pointer to a Unicode string      *                      representing the standalone string value.      * @param actualEncodingStr A const pointer to a Unicode string      *                          representing the actual encoding string      *                          value.      */    virtual void XMLDecl    (        const   XMLCh* const    versionStr        , const XMLCh* const    encodingStr        , const XMLCh* const    standaloneStr        , const XMLCh* const    actualEncodingStr    );    //@}    // -----------------------------------------------------------------------    //  Implementation of the XMLErrorReporter interface    // -----------------------------------------------------------------------    /** @name Implementation of the XMLErrorReporter Interface. */    //@{    /**      * This method is used to report back errors found while parsing the      * XML file. The driver will call the corresponding user installed      * SAX Error Handler methods: 'fatal', 'error', 'warning' depending      * on the severity of the error. This classification is defined by      * the XML specification.      *      * @param errCode An integer code for the error.      * @param msgDomain A const pointer to an Unicode string representing      *                  the message domain to use.      * @param errType An enumeration classifying the severity of the error.      * @param errorText A const pointer to an Unicode string representing      *                  the text of the error message.      * @param systemId  A const pointer to an Unicode string representing      *                  the system id of the XML file where this error      *                  was discovered.      * @param publicId  A const pointer to an Unicode string representing      *                  the public id of the XML file where this error      *                  was discovered.      * @param lineNum   The line number where the error occurred.      * @param colNum    The column number where the error occurred.      * @see ErrorHandler      */    virtual void error    (        const   unsigned int                errCode        , const XMLCh* const                msgDomain        , const XMLErrorReporter::ErrTypes  errType        , const XMLCh* const                errorText        , const XMLCh* const                systemId        , const XMLC

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?