📄 saxparser.hpp
字号:
* @see #setExternalSchemaLocation(const XMLCh* const) */ void setExternalSchemaLocation(const char* const schemaLocation); /** * This method allows the user to specify the no target namespace XML * Schema Location externally. If specified, the instance document's * noNamespaceSchemaLocation attribute will be effectively ignored. * * If this method is called more than once, only the last one takes effect. * * The syntax is the same as for the noNamespaceSchemaLocation attribute * that may occur in an instance document: e.g."file_name.xsd". * * @param noNamespaceSchemaLocation the XML Schema Location with no target namespace * * @see #getExternalNoNamespaceSchemaLocation */ void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation); /** * This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const). * It takes native char string as parameter * * @param noNamespaceSchemaLocation the XML Schema Location with no target namespace * * @see #setExternalNoNamespaceSchemaLocation(const XMLCh* const) */ void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation); /** * This allows an application to set a SecurityManager on * the parser; this object stores information that various * components use to limit their consumption of system * resources while processing documents. * * If this method is called more than once, only the last one takes effect. * It may not be reset during a parse. * * * @param securityManager the SecurityManager instance to * be used by this parser * * @see #getSecurityManager */ void setSecurityManager(SecurityManager* const securityManager); /** Set the 'Loading External DTD' flag * * This method allows users to enable or disable the loading of external DTD. * When set to false, the parser will ignore any external DTD completely * if the validationScheme is set to Val_Never. * * The parser's default state is: true. * * This flag is ignored if the validationScheme is set to Val_Always or Val_Auto. * * @param newState The value specifying whether external DTD should * be loaded or not. * * @see #getLoadExternalDTD * @see #setValidationScheme */ void setLoadExternalDTD(const bool newState); /** Set the 'Grammar caching' flag * * This method allows users to enable or disable caching of grammar when * parsing XML documents. When set to true, the parser will cache the * resulting grammar for use in subsequent parses. * * If the flag is set to true, the 'Use cached grammar' flag will also be * set to true. * * The parser's default state is: false. * * @param newState The value specifying whether we should cache grammars * or not. * * @see #isCachingGrammarFromParse * @see #useCachedGrammarInParse */ void cacheGrammarFromParse(const bool newState); /** Set the 'Use cached grammar' flag * * This method allows users to enable or disable the use of cached * grammars. When set to true, the parser will use the cached grammar, * instead of building the grammar from scratch, to validate XML * documents. * * If the 'Grammar caching' flag is set to true, this method ignores the * value passed in. * * The parser's default state is: false. * * @param newState The value specifying whether we should use the cached * grammar or not. * * @see #isUsingCachedGrammarInParse * @see #cacheGrammarFromParse */ void useCachedGrammarInParse(const bool newState); /** Enable/disable src offset calculation * * This method allows users to enable/disable src offset calculation. * Disabling the calculation will improve performance. * * The parser's default state is: false. * * @param newState The value specifying whether we should enable or * disable src offset calculation * * @see #getCalculateSrcOfs */ void setCalculateSrcOfs(const bool newState); /** Force standard uri * * This method allows users to tell the parser to force standard uri conformance. * * The parser's default state is: false. * * @param newState The value specifying whether the parser should reject malformed URI. * * @see #getStandardUriConformant */ void setStandardUriConformant(const bool newState); /** Set the scanner to use when scanning the XML document * * This method allows users to set the scanner to use * when scanning a given XML document. * * @param scannerName The name of the desired scanner */ void useScanner(const XMLCh* const scannerName); /** Set maximum input buffer size * * This method allows users to limit the size of buffers used in parsing * XML character data. The effect of setting this size is to limit the * size of a ContentHandler::characters() call. * * The parser's default input buffer size is 1 megabyte. * * @param bufferSize The maximum input buffer size */ void setInputBufferSize(const size_t bufferSize); /** Set the 'ignore cached DTD grammar' flag * * This method gives users the option to ignore a cached DTD grammar, when * an XML document contains both an internal and external DTD, and the use * cached grammar from parse option is enabled. Currently, we do not allow * using cached DTD grammar when an internal subset is present in the * document. This option will only affect the behavior of the parser when * an internal and external DTD both exist in a document (i.e. no effect * if document has no internal subset). * * The parser's default state is false * * @param newValue The state to set */ void setIgnoreCachedDTD(const bool newValue); /** Set the 'ignore annotation' flag * * This method gives users the option to not generate XSAnnotations * when "traversing" a schema. * * The parser's default state is false * * @param newValue The state to set */ void setIgnoreAnnotations(const bool newValue); /** Set the 'disable default entity resolution' flag * * This method gives users the option to not perform default entity * resolution. If the user's resolveEntity method returns NULL the * parser will try to resolve the entity on its own. When this option * is set to true, the parser will not attempt to resolve the entity * when the resolveEntity method returns NULL. * * The parser's default state is false * * @param newValue The state to set * * @see #entityResolver */ void setDisableDefaultEntityResolution(const bool newValue); /** Set the 'skip DTD validation' flag * * This method gives users the option to skip DTD validation only when * schema validation is on (i.e. when performing validation, we will * ignore the DTD, except for entities, when schema validation is enabled). * * NOTE: This option is ignored if schema validation is disabled. * * The parser's default state is false * * @param newValue The state to set */ void setSkipDTDValidation(const bool newValue); //@} // ----------------------------------------------------------------------- // Advanced document handler list maintenance methods // ----------------------------------------------------------------------- /** @name Advanced document handler list maintenance methods */ //@{ /** * This method installs the specified 'advanced' document callback * handler, thereby allowing the user to customize the processing, * if they choose to do so. Any number of advanced callback handlers * maybe installed. * * <p>The methods in the advanced callback interface represent * Xerces-C extensions. There is no specification for this interface.</p> * * @param toInstall A pointer to the users advanced callback handler. * * @see #removeAdvDocHandler */ void installAdvDocHandler(XMLDocumentHandler* const toInstall); /** * This method removes the 'advanced' document handler callback from * the underlying parser scanner. If no handler is installed, advanced * callbacks are not invoked by the scanner. * @param toRemove A pointer to the advanced callback handler which * should be removed. * * @see #installAdvDocHandler */ bool removeAdvDocHandler(XMLDocumentHandler* const toRemove); //@} // ----------------------------------------------------------------------- // Progressive scan methods // ----------------------------------------------------------------------- /** @name Progressive scan methods */ //@{ /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param systemId A pointer to a Unicode string represting the path * to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could parse the * prolog (which means the token will not be valid.) * * @see #parseNext * @see #parseFirst(char*,...) * @see #parseFirst(InputSource&,...) */ bool parseFirst ( const XMLCh* const systemId , XMLPScanToken& toFill ); /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param systemId A pointer to a regular native string represting * the path to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consIstency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could not parse * the prolog. * * @see #parseNext * @see #parseFirst(XMLCh*,...) * @see #parseFirst(InputSource&,...) */ bool parseFirst ( const char* const systemId , XMLPScanToken& toFill ); /** Begin a progressive parse operation * * This method is used to start a progressive parse on a XML file. * To continue parsing, subsequent calls must be to the parseNext * method. * * It scans through the prolog and returns a token to be used on * subsequent scanNext() calls. If the return value is true, then the * token is legal and ready for further use. If it returns false, then * the scan of the prolog failed and the token is not going to work on * subsequent scanNext() calls. * * @param source A const reference to the InputSource object which * points to the XML file to be parsed. * @param toFill A token maintaing state information to maintain * internal consistency between invocation of 'parseNext' * calls. * * @return 'true', if successful in parsing the prolog. It indicates the * user can go ahead with parsing the rest of the file. It * returns 'false' to indicate that the parser could not parse * the prolog. * * @see #parseNext * @see #parseFirst(XMLCh*,...) * @see #parseFirst(char*,...) */ bool parseFirst
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -