|
||||
File indexing completed on 2025-01-18 10:14:56
0001 /* 0002 * Licensed to the Apache Software Foundation (ASF) under one or more 0003 * contributor license agreements. See the NOTICE file distributed with 0004 * this work for additional information regarding copyright ownership. 0005 * The ASF licenses this file to You under the Apache License, Version 2.0 0006 * (the "License"); you may not use this file except in compliance with 0007 * the License. You may obtain a copy of the License at 0008 * 0009 * http://www.apache.org/licenses/LICENSE-2.0 0010 * 0011 * Unless required by applicable law or agreed to in writing, software 0012 * distributed under the License is distributed on an "AS IS" BASIS, 0013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0014 * See the License for the specific language governing permissions and 0015 * limitations under the License. 0016 */ 0017 0018 /* 0019 * $Id$ 0020 */ 0021 0022 #if !defined(XERCESC_INCLUDE_GUARD_SAX2XMLFILTERIMPL_HPP) 0023 #define XERCESC_INCLUDE_GUARD_SAX2XMLFILTERIMPL_HPP 0024 0025 #include <xercesc/sax2/SAX2XMLFilter.hpp> 0026 #include <xercesc/sax/EntityResolver.hpp> 0027 #include <xercesc/sax/DTDHandler.hpp> 0028 #include <xercesc/sax2/ContentHandler.hpp> 0029 #include <xercesc/sax/ErrorHandler.hpp> 0030 0031 XERCES_CPP_NAMESPACE_BEGIN 0032 0033 /** 0034 * This class implements the SAX2 'XMLFilterImpl' interface and should be 0035 * used by applications as the base class for their SAX2 filters. 0036 * This implementation simply forwards every call to the parent object. 0037 * 0038 */ 0039 0040 class PARSERS_EXPORT SAX2XMLFilterImpl : 0041 public SAX2XMLFilter 0042 , public EntityResolver 0043 , public DTDHandler 0044 , public ContentHandler 0045 , public ErrorHandler 0046 { 0047 public : 0048 // ----------------------------------------------------------------------- 0049 // Constructors and Destructor 0050 // ----------------------------------------------------------------------- 0051 /** @name Constructors and Destructor */ 0052 //@{ 0053 /** The default constructor */ 0054 SAX2XMLFilterImpl(SAX2XMLReader* parent); 0055 0056 /** The destructor */ 0057 ~SAX2XMLFilterImpl() ; 0058 //@} 0059 0060 //----------------------------------------------------------------------- 0061 // Implementation of SAX2XMLReader Interface 0062 //----------------------------------------------------------------------- 0063 //----------------------------------------------------------------------- 0064 // The XMLReader interface 0065 //----------------------------------------------------------------------- 0066 /** @name Implementation of SAX 2.0 XMLReader interface's. */ 0067 //@{ 0068 0069 /** 0070 * This method returns the installed content handler. 0071 * 0072 * @return A pointer to the installed content handler object. 0073 */ 0074 virtual ContentHandler* getContentHandler() const ; 0075 0076 /** 0077 * This method returns the installed DTD handler. 0078 * 0079 * @return A pointer to the installed DTD handler object. 0080 */ 0081 virtual DTDHandler* getDTDHandler() const ; 0082 0083 /** 0084 * This method returns the installed entity resolver. 0085 * 0086 * @return A pointer to the installed entity resolver object. 0087 */ 0088 virtual EntityResolver* getEntityResolver() const ; 0089 0090 /** 0091 * This method returns the installed error handler. 0092 * 0093 * @return A pointer to the installed error handler object. 0094 */ 0095 virtual ErrorHandler* getErrorHandler() const ; 0096 0097 /** 0098 * Query the current state of any feature in a SAX2 XMLReader. 0099 * 0100 * @param name The unique identifier (URI) of the feature being set. 0101 * @return The current state of the feature. 0102 * @exception SAXNotRecognizedException If the requested feature is not known. 0103 */ 0104 virtual bool getFeature(const XMLCh* const name) const ; 0105 0106 /** 0107 * Query the current value of a property in a SAX2 XMLReader. 0108 * 0109 * The parser owns the returned pointer. The memory allocated for 0110 * the returned pointer will be destroyed when the parser is deleted. 0111 * 0112 * To ensure accessibility of the returned information after the parser 0113 * is deleted, callers need to copy and store the returned information 0114 * somewhere else; otherwise you may get unexpected result. Since the returned 0115 * pointer is a generic void pointer, see the SAX2 Programming Guide to learn 0116 * exactly what type of property value each property returns for replication. 0117 * 0118 * @param name The unique identifier (URI) of the property being set. 0119 * @return The current value of the property. The pointer spans the same 0120 * life-time as the parser. A null pointer is returned if nothing 0121 * was specified externally. 0122 * @exception SAXNotRecognizedException If the requested property is not known. 0123 */ 0124 virtual void* getProperty(const XMLCh* const name) const ; 0125 0126 /** 0127 * Allow an application to register a document event handler. 0128 * 0129 * If the application does not register a document handler, all 0130 * document events reported by the SAX parser will be silently 0131 * ignored (this is the default behaviour implemented by 0132 * HandlerBase). 0133 * 0134 * Applications may register a new or different handler in the 0135 * middle of a parse, and the SAX parser must begin using the new 0136 * handler immediately. 0137 * 0138 * @param handler The document handler. 0139 * @see DocumentHandler#DocumentHandler 0140 * @see HandlerBase#HandlerBase 0141 */ 0142 virtual void setContentHandler(ContentHandler* const handler) ; 0143 0144 /** 0145 * Allow an application to register a DTD event handler. 0146 * 0147 * If the application does not register a DTD handler, all DTD 0148 * events reported by the SAX parser will be silently ignored (this 0149 * is the default behaviour implemented by HandlerBase). 0150 * 0151 * Applications may register a new or different handler in the middle 0152 * of a parse, and the SAX parser must begin using the new handler 0153 * immediately. 0154 * 0155 * @param handler The DTD handler. 0156 * @see DTDHandler#DTDHandler 0157 * @see HandlerBase#HandlerBase 0158 */ 0159 virtual void setDTDHandler(DTDHandler* const handler) ; 0160 0161 /** 0162 * Allow an application to register a custom entity resolver. 0163 * 0164 * If the application does not register an entity resolver, the 0165 * SAX parser will resolve system identifiers and open connections 0166 * to entities itself (this is the default behaviour implemented in 0167 * DefaultHandler). 0168 * 0169 * Applications may register a new or different entity resolver 0170 * in the middle of a parse, and the SAX parser must begin using 0171 * the new resolver immediately. 0172 * 0173 * @param resolver The object for resolving entities. 0174 * @see EntityResolver#EntityResolver 0175 * @see DefaultHandler#DefaultHandler 0176 */ 0177 virtual void setEntityResolver(EntityResolver* const resolver) ; 0178 0179 /** 0180 * Allow an application to register an error event handler. 0181 * 0182 * If the application does not register an error event handler, 0183 * all error events reported by the SAX parser will be silently 0184 * ignored, except for fatalError, which will throw a SAXException 0185 * (this is the default behaviour implemented by HandlerBase). 0186 * 0187 * Applications may register a new or different handler in the 0188 * middle of a parse, and the SAX parser must begin using the new 0189 * handler immediately. 0190 * 0191 * @param handler The error handler. 0192 * @see ErrorHandler#ErrorHandler 0193 * @see SAXException#SAXException 0194 * @see HandlerBase#HandlerBase 0195 */ 0196 virtual void setErrorHandler(ErrorHandler* const handler) ; 0197 0198 /** 0199 * Set the state of any feature in a SAX2 XMLReader. 0200 * Supported features in SAX2 for xerces-c are: 0201 * <br>(See the SAX2 Programming Guide for detail description). 0202 * 0203 * <br>http://xml.org/sax/features/validation (default: true) 0204 * <br>http://xml.org/sax/features/namespaces (default: true) 0205 * <br>http://xml.org/sax/features/namespace-prefixes (default: false) 0206 * <br>http://apache.org/xml/features/validation/dynamic (default: false) 0207 * <br>http://apache.org/xml/features/validation/reuse-grammar (default: false) 0208 * <br>http://apache.org/xml/features/validation/schema (default: true) 0209 * <br>http://apache.org/xml/features/validation/schema-full-checking (default: false) 0210 * <br>http://apache.org/xml/features/validating/load-schema (default: true) 0211 * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd (default: true) 0212 * <br>http://apache.org/xml/features/continue-after-fatal-error (default: false) 0213 * <br>http://apache.org/xml/features/validation-error-as-fatal (default: false) 0214 * 0215 * @param name The unique identifier (URI) of the feature. 0216 * @param value The requested state of the feature (true or false). 0217 * @exception SAXNotRecognizedException If the requested feature is not known. 0218 * @exception SAXNotSupportedException Feature modification is not supported during parse 0219 * 0220 */ 0221 virtual void setFeature(const XMLCh* const name, const bool value) ; 0222 0223 /** 0224 * Set the value of any property in a SAX2 XMLReader. 0225 * Supported properties in SAX2 for xerces-c are: 0226 * <br>(See the SAX2 Programming Guide for detail description). 0227 * 0228 * <br>http://apache.org/xml/properties/schema/external-schemaLocation 0229 * <br>http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation. 0230 * 0231 * It takes a void pointer as the property value. Application is required to initialize this void 0232 * pointer to a correct type. See the SAX2 Programming Guide 0233 * to learn exactly what type of property value each property expects for processing. 0234 * Passing a void pointer that was initialized with a wrong type will lead to unexpected result. 0235 * If the same property is set more than once, the last one takes effect. 0236 * 0237 * @param name The unique identifier (URI) of the property being set. 0238 * @param value The requested value for the property. See 0239 * the SAX2 Programming Guide to learn 0240 * exactly what type of property value each property expects for processing. 0241 * Passing a void pointer that was initialized with a wrong type will lead 0242 * to unexpected result. 0243 * @exception SAXNotRecognizedException If the requested property is not known. 0244 * @exception SAXNotSupportedException Property modification is not supported during parse 0245 */ 0246 virtual void setProperty(const XMLCh* const name, void* value) ; 0247 0248 /** 0249 * Parse an XML document. 0250 * 0251 * The application can use this method to instruct the SAX parser 0252 * to begin parsing an XML document from any valid input 0253 * source (a character stream, a byte stream, or a URI). 0254 * 0255 * Applications may not invoke this method while a parse is in 0256 * progress (they should create a new Parser instead for each 0257 * additional XML document). Once a parse is complete, an 0258 * application may reuse the same Parser object, possibly with a 0259 * different input source. 0260 * 0261 * @param source The input source for the top-level of the 0262 * XML document. 0263 * @exception SAXException Any SAX exception, possibly 0264 * wrapping another exception. 0265 * @exception XMLException An exception from the parser or client 0266 * handler code. 0267 * @see InputSource#InputSource 0268 * @see #setEntityResolver 0269 * @see #setDTDHandler 0270 * @see #setDocumentHandler 0271 * @see #setErrorHandler 0272 */ 0273 virtual void parse 0274 ( 0275 const InputSource& source 0276 ) ; 0277 0278 /** 0279 * Parse an XML document from a system identifier (URI). 0280 * 0281 * This method is a shortcut for the common case of reading a 0282 * document from a system identifier. It is the exact equivalent 0283 * of the following: 0284 * 0285 * parse(new URLInputSource(systemId)); 0286 * 0287 * If the system identifier is a URL, it must be fully resolved 0288 * by the application before it is passed to the parser. 0289 * 0290 * @param systemId The system identifier (URI). 0291 * @exception SAXException Any SAX exception, possibly 0292 * wrapping another exception. 0293 * @exception XMLException An exception from the parser or client 0294 * handler code. 0295 * @see #parse(InputSource) 0296 */ 0297 virtual void parse 0298 ( 0299 const XMLCh* const systemId 0300 ) ; 0301 0302 /** 0303 * Parse an XML document from a system identifier (URI). 0304 * 0305 * This method is a shortcut for the common case of reading a 0306 * document from a system identifier. It is the exact equivalent 0307 * of the following: 0308 * 0309 * parse(new URLInputSource(systemId)); 0310 * 0311 * If the system identifier is a URL, it must be fully resolved 0312 * by the application before it is passed to the parser. 0313 * 0314 * @param systemId The system identifier (URI). 0315 * @exception SAXException Any SAX exception, possibly 0316 * wrapping another exception. 0317 * @exception XMLException An exception from the parser or client 0318 * handler code. 0319 * @see #parse(InputSource) 0320 */ 0321 virtual void parse 0322 ( 0323 const char* const systemId 0324 ) ; 0325 0326 //@} 0327 0328 // ----------------------------------------------------------------------- 0329 // SAX 2.0-ext 0330 // ----------------------------------------------------------------------- 0331 /** @name SAX 2.0-ext */ 0332 //@{ 0333 /** 0334 * This method returns the installed declaration handler. 0335 * 0336 * @return A pointer to the installed declaration handler object. 0337 */ 0338 virtual DeclHandler* getDeclarationHandler() const ; 0339 0340 /** 0341 * This method returns the installed lexical handler. 0342 * 0343 * @return A pointer to the installed lexical handler object. 0344 */ 0345 virtual LexicalHandler* getLexicalHandler() const ; 0346 0347 /** 0348 * Allow an application to register a declaration event handler. 0349 * 0350 * If the application does not register a declaration handler, 0351 * all events reported by the SAX parser will be silently 0352 * ignored. (this is the default behaviour implemented by DefaultHandler). 0353 * 0354 * Applications may register a new or different handler in the 0355 * middle of a parse, and the SAX parser must begin using the new 0356 * handler immediately. 0357 * 0358 * @param handler The DTD declaration handler. 0359 * @see DeclHandler#DeclHandler 0360 * @see SAXException#SAXException 0361 * @see DefaultHandler#DefaultHandler 0362 */ 0363 virtual void setDeclarationHandler(DeclHandler* const handler) ; 0364 0365 /** 0366 * Allow an application to register a lexical event handler. 0367 * 0368 * If the application does not register a lexical handler, 0369 * all events reported by the SAX parser will be silently 0370 * ignored. (this is the default behaviour implemented by HandlerBase). 0371 * 0372 * Applications may register a new or different handler in the 0373 * middle of a parse, and the SAX parser must begin using the new 0374 * handler immediately. 0375 * 0376 * @param handler The error handler. 0377 * @see LexicalHandler#LexicalHandler 0378 * @see SAXException#SAXException 0379 * @see HandlerBase#HandlerBase 0380 */ 0381 virtual void setLexicalHandler(LexicalHandler* const handler) ; 0382 0383 //@} 0384 0385 // ----------------------------------------------------------------------- 0386 // Getter Methods 0387 // ----------------------------------------------------------------------- 0388 /** @name Getter Methods (Xerces-C specific) */ 0389 //@{ 0390 /** 0391 * This method is used to get the current validator. 0392 * 0393 * <b>SAX2XMLReader assumes responsibility for the validator. It will be 0394 * deleted when the XMLReader is destroyed.</b> 0395 * 0396 * @return A pointer to the validator. An application should not deleted 0397 * the object returned. 0398 * 0399 */ 0400 virtual XMLValidator* getValidator() const ; 0401 0402 /** Get error count from the last parse operation. 0403 * 0404 * This method returns the error count from the last parse 0405 * operation. Note that this count is actually stored in the 0406 * scanner, so this method simply returns what the 0407 * scanner reports. 0408 * 0409 * @return number of errors encountered during the latest 0410 * parse operation. 0411 */ 0412 virtual XMLSize_t getErrorCount() const ; 0413 0414 /** 0415 * This method returns the state of the parser's 0416 * exit-on-First-Fatal-Error flag. 0417 * 0418 * <p>Or you can query the feature "http://apache.org/xml/features/continue-after-fatal-error" 0419 * which indicates the opposite state.</p> 0420 * 0421 * @return true, if the parser is currently configured to 0422 * exit on the first fatal error, false otherwise. 0423 * 0424 * @see #setExitOnFirstFatalError 0425 * @see #getFeature 0426 */ 0427 virtual bool getExitOnFirstFatalError() const ; 0428 0429 /** 0430 * This method returns the state of the parser's 0431 * validation-constraint-fatal flag. 0432 * 0433 * <p>Or you can query the feature "http://apache.org/xml/features/validation-error-as-fatal" 0434 * which means the same thing. 0435 * 0436 * @return true, if the parser is currently configured to 0437 * set validation constraint errors as fatal, false 0438 * otherwise. 0439 * 0440 * @see #setValidationContraintFatal 0441 * @see #getFeature 0442 */ 0443 virtual bool getValidationConstraintFatal() const ; 0444 0445 /** 0446 * Retrieve the grammar that is associated with the specified namespace key 0447 * 0448 * @param nameSpaceKey Namespace key 0449 * @return Grammar associated with the Namespace key. 0450 */ 0451 virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey); 0452 0453 /** 0454 * Retrieve the grammar where the root element is declared. 0455 * 0456 * @return Grammar where root element declared 0457 */ 0458 virtual Grammar* getRootGrammar(); 0459 0460 /** 0461 * Returns the string corresponding to a URI id from the URI string pool. 0462 * 0463 * @param uriId id of the string in the URI string pool. 0464 * @return URI string corresponding to the URI id. 0465 */ 0466 virtual const XMLCh* getURIText(unsigned int uriId) const; 0467 0468 /** 0469 * Returns the current src offset within the input source. 0470 * To be used only while parsing is in progress. 0471 * 0472 * @return offset within the input source 0473 */ 0474 virtual XMLFilePos getSrcOffset() const; 0475 0476 //@} 0477 0478 // ----------------------------------------------------------------------- 0479 // Setter Methods 0480 // ----------------------------------------------------------------------- 0481 /** @name Setter Methods (Xerces-C specific) */ 0482 //@{ 0483 /** 0484 * This method is used to set a validator. 0485 * 0486 * <b>SAX2XMLReader assumes responsibility for the validator. It will be 0487 * deleted when the XMLReader is destroyed.</b> 0488 * 0489 * @param valueToAdopt A pointer to the validator that the reader should use. 0490 * 0491 */ 0492 virtual void setValidator(XMLValidator* valueToAdopt) ; 0493 0494 /** 0495 * This method allows users to set the parser's behaviour when it 0496 * encounters the first fatal error. If set to true, the parser 0497 * will exit at the first fatal error. If false, then it will 0498 * report the error and continue processing. 0499 * 0500 * <p>The default value is 'true' and the parser exits on the 0501 * first fatal error.</p> 0502 * 0503 * <p>Or you can set the feature "http://apache.org/xml/features/continue-after-fatal-error" 0504 * which has the opposite behaviour.</p> 0505 * 0506 * <p>If both the feature above and this function are used, the latter takes effect.</p> 0507 * 0508 * @param newState The value specifying whether the parser should 0509 * continue or exit when it encounters the first 0510 * fatal error. 0511 * 0512 * @see #getExitOnFirstFatalError 0513 * @see #setFeature 0514 */ 0515 virtual void setExitOnFirstFatalError(const bool newState) ; 0516 0517 /** 0518 * This method allows users to set the parser's behaviour when it 0519 * encounters a validation constraint error. If set to true, and the 0520 * the parser will treat validation error as fatal and will exit depends on the 0521 * state of "getExitOnFirstFatalError". If false, then it will 0522 * report the error and continue processing. 0523 * 0524 * Note: setting this true does not mean the validation error will be printed with 0525 * the word "Fatal Error". It is still printed as "Error", but the parser 0526 * will exit if "setExitOnFirstFatalError" is set to true. 0527 * 0528 * <p>The default value is 'false'.</p> 0529 * 0530 * <p>Or you can set the feature "http://apache.org/xml/features/validation-error-as-fatal" 0531 * which means the same thing.</p> 0532 * 0533 * <p>If both the feature above and this function are used, the latter takes effect.</p> 0534 * 0535 * @param newState If true, the parser will exit if "setExitOnFirstFatalError" 0536 * is set to true. 0537 * 0538 * @see #getValidationConstraintFatal 0539 * @see #setExitOnFirstFatalError 0540 * @see #setFeature 0541 */ 0542 virtual void setValidationConstraintFatal(const bool newState) ; 0543 //@} 0544 0545 0546 // ----------------------------------------------------------------------- 0547 // Progressive scan methods 0548 // ----------------------------------------------------------------------- 0549 0550 /** @name Progressive scan methods */ 0551 //@{ 0552 0553 /** Begin a progressive parse operation 0554 * 0555 * This method is used to start a progressive parse on a XML file. 0556 * To continue parsing, subsequent calls must be to the parseNext 0557 * method. 0558 * 0559 * It scans through the prolog and returns a token to be used on 0560 * subsequent scanNext() calls. If the return value is true, then the 0561 * token is legal and ready for further use. If it returns false, then 0562 * the scan of the prolog failed and the token is not going to work on 0563 * subsequent scanNext() calls. 0564 * 0565 * @param systemId A pointer to a Unicode string representing the path 0566 * to the XML file to be parsed. 0567 * @param toFill A token maintaing state information to maintain 0568 * internal consistency between invocation of 'parseNext' 0569 * calls. 0570 * 0571 * @return 'true', if successful in parsing the prolog. It indicates the 0572 * user can go ahead with parsing the rest of the file. It 0573 * returns 'false' to indicate that the parser could parse the 0574 * prolog (which means the token will not be valid.) 0575 * 0576 * @see #parseNext 0577 * @see #parseFirst(char*,...) 0578 * @see #parseFirst(InputSource&,...) 0579 */ 0580 virtual bool parseFirst 0581 ( 0582 const XMLCh* const systemId 0583 , XMLPScanToken& toFill 0584 ) ; 0585 0586 /** Begin a progressive parse operation 0587 * 0588 * This method is used to start a progressive parse on a XML file. 0589 * To continue parsing, subsequent calls must be to the parseNext 0590 * method. 0591 * 0592 * It scans through the prolog and returns a token to be used on 0593 * subsequent scanNext() calls. If the return value is true, then the 0594 * token is legal and ready for further use. If it returns false, then 0595 * the scan of the prolog failed and the token is not going to work on 0596 * subsequent scanNext() calls. 0597 * 0598 * @param systemId A pointer to a regular native string representing 0599 * the path to the XML file to be parsed. 0600 * @param toFill A token maintaing state information to maintain 0601 * internal consistency between invocation of 'parseNext' 0602 * calls. 0603 * 0604 * @return 'true', if successful in parsing the prolog. It indicates the 0605 * user can go ahead with parsing the rest of the file. It 0606 * returns 'false' to indicate that the parser could not parse 0607 * the prolog. 0608 * 0609 * @see #parseNext 0610 * @see #parseFirst(XMLCh*,...) 0611 * @see #parseFirst(InputSource&,...) 0612 */ 0613 virtual bool parseFirst 0614 ( 0615 const char* const systemId 0616 , XMLPScanToken& toFill 0617 ) ; 0618 0619 /** Begin a progressive parse operation 0620 * 0621 * This method is used to start a progressive parse on a XML file. 0622 * To continue parsing, subsequent calls must be to the parseNext 0623 * method. 0624 * 0625 * It scans through the prolog and returns a token to be used on 0626 * subsequent scanNext() calls. If the return value is true, then the 0627 * token is legal and ready for further use. If it returns false, then 0628 * the scan of the prolog failed and the token is not going to work on 0629 * subsequent scanNext() calls. 0630 * 0631 * @param source A const reference to the InputSource object which 0632 * points to the XML file to be parsed. 0633 * @param toFill A token maintaing state information to maintain 0634 * internal consistency between invocation of 'parseNext' 0635 * calls. 0636 * 0637 * @return 'true', if successful in parsing the prolog. It indicates the 0638 * user can go ahead with parsing the rest of the file. It 0639 * returns 'false' to indicate that the parser could not parse 0640 * the prolog. 0641 * 0642 * @see #parseNext 0643 * @see #parseFirst(XMLCh*,...) 0644 * @see #parseFirst(char*,...) 0645 */ 0646 virtual bool parseFirst 0647 ( 0648 const InputSource& source 0649 , XMLPScanToken& toFill 0650 ) ; 0651 0652 /** Continue a progressive parse operation 0653 * 0654 * This method is used to continue with progressive parsing of 0655 * XML files started by a call to 'parseFirst' method. 0656 * 0657 * It parses the XML file and stops as soon as it comes across 0658 * a XML token (as defined in the XML specification). Relevant 0659 * callback handlers are invoked as required by the SAX 0660 * specification. 0661 * 0662 * @param token A token maintaing state information to maintain 0663 * internal consistency between invocation of 'parseNext' 0664 * calls. 0665 * 0666 * @return 'true', if successful in parsing the next XML token. 0667 * It indicates the user can go ahead with parsing the rest 0668 * of the file. It returns 'false' to indicate that the parser 0669 * could not find next token as per the XML specification 0670 * production rule. 0671 * 0672 * @see #parseFirst(XMLCh*,...) 0673 * @see #parseFirst(char*,...) 0674 * @see #parseFirst(InputSource&,...) 0675 */ 0676 virtual bool parseNext(XMLPScanToken& token) ; 0677 0678 /** Reset the parser after a progressive parse 0679 * 0680 * If a progressive parse loop exits before the end of the document 0681 * is reached, the parser has no way of knowing this. So it will leave 0682 * open any files or sockets or memory buffers that were in use at 0683 * the time that the parse loop exited. 0684 * 0685 * The next parse operation will cause these open files and such to 0686 * be closed, but the next parse operation might occur at some unknown 0687 * future point. To avoid this problem, you should reset the parser if 0688 * you exit the loop early. 0689 * 0690 * If you exited because of an error, then this cleanup will be done 0691 * for you. Its only when you exit the file prematurely of your own 0692 * accord, because you've found what you wanted in the file most 0693 * likely. 0694 * 0695 * @param token A token maintaing state information to maintain 0696 * internal consistency between invocation of 'parseNext' 0697 * calls. 0698 */ 0699 virtual void parseReset(XMLPScanToken& token) ; 0700 0701 //@} 0702 0703 // ----------------------------------------------------------------------- 0704 // Implementation of the grammar preparsing interface 0705 // ----------------------------------------------------------------------- 0706 0707 /** @name Implementation of Grammar preparsing interface's. */ 0708 //@{ 0709 /** 0710 * Preparse schema grammar (XML Schema, DTD, etc.) via an input source 0711 * object. 0712 * 0713 * This method invokes the preparsing process on a schema grammar XML 0714 * file specified by the SAX InputSource parameter. If the 'toCache' flag 0715 * is enabled, the parser will cache the grammars for re-use. If a grammar 0716 * key is found in the pool, no caching of any grammar will take place. 0717 * 0718 * 0719 * @param source A const reference to the SAX InputSource object which 0720 * points to the schema grammar file to be preparsed. 0721 * @param grammarType The grammar type (Schema or DTD). 0722 * @param toCache If <code>true</code>, we cache the preparsed grammar, 0723 * otherwise, no caching. Default is <code>false</code>. 0724 * @return The preparsed schema grammar object (SchemaGrammar or 0725 * DTDGrammar). That grammar object is owned by the parser. 0726 * 0727 * @exception SAXException Any SAX exception, possibly 0728 * wrapping another exception. 0729 * @exception XMLException An exception from the parser or client 0730 * handler code. 0731 * @exception DOMException A DOM exception as per DOM spec. 0732 * 0733 * @see InputSource#InputSource 0734 */ 0735 virtual Grammar* loadGrammar(const InputSource& source, 0736 const Grammar::GrammarType grammarType, 0737 const bool toCache = false); 0738 0739 /** 0740 * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL 0741 * 0742 * This method invokes the preparsing process on a schema grammar XML 0743 * file specified by the file path parameter. If the 'toCache' flag 0744 * is enabled, the parser will cache the grammars for re-use. If a grammar 0745 * key is found in the pool, no caching of any grammar will take place. 0746 * 0747 * 0748 * @param systemId A const XMLCh pointer to the Unicode string which 0749 * contains the path to the XML grammar file to be 0750 * preparsed. 0751 * @param grammarType The grammar type (Schema or DTD). 0752 * @param toCache If <code>true</code>, we cache the preparsed grammar, 0753 * otherwise, no caching. Default is <code>false</code>. 0754 * @return The preparsed schema grammar object (SchemaGrammar or 0755 * DTDGrammar). That grammar object is owned by the parser. 0756 * 0757 * @exception SAXException Any SAX exception, possibly 0758 * wrapping another exception. 0759 * @exception XMLException An exception from the parser or client 0760 * handler code. 0761 * @exception DOMException A DOM exception as per DOM spec. 0762 */ 0763 virtual Grammar* loadGrammar(const XMLCh* const systemId, 0764 const Grammar::GrammarType grammarType, 0765 const bool toCache = false); 0766 0767 /** 0768 * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL 0769 * 0770 * This method invokes the preparsing process on a schema grammar XML 0771 * file specified by the file path parameter. If the 'toCache' flag 0772 * is enabled, the parser will cache the grammars for re-use. If a grammar 0773 * key is found in the pool, no caching of any grammar will take place. 0774 * 0775 * 0776 * @param systemId A const char pointer to a native string which contains 0777 * the path to the XML grammar file to be preparsed. 0778 * @param grammarType The grammar type (Schema or DTD). 0779 * @param toCache If <code>true</code>, we cache the preparsed grammar, 0780 * otherwise, no caching. Default is <code>false</code>. 0781 * @return The preparsed schema grammar object (SchemaGrammar or 0782 * DTDGrammar). That grammar object is owned by the parser. 0783 * 0784 * @exception SAXException Any SAX exception, possibly 0785 * wrapping another exception. 0786 * @exception XMLException An exception from the parser or client 0787 * handler code. 0788 * @exception DOMException A DOM exception as per DOM spec. 0789 */ 0790 virtual Grammar* loadGrammar(const char* const systemId, 0791 const Grammar::GrammarType grammarType, 0792 const bool toCache = false); 0793 0794 /** 0795 * Clear the cached grammar pool 0796 */ 0797 virtual void resetCachedGrammarPool(); 0798 0799 /** Set maximum input buffer size 0800 * 0801 * This method allows users to limit the size of buffers used in parsing 0802 * XML character data. The effect of setting this size is to limit the 0803 * size of a ContentHandler::characters() call. 0804 * 0805 * The parser's default input buffer size is 1 megabyte. 0806 * 0807 * @param bufferSize The maximum input buffer size 0808 */ 0809 void setInputBufferSize(const XMLSize_t bufferSize); 0810 0811 //@} 0812 0813 0814 // ----------------------------------------------------------------------- 0815 // Advanced document handler list maintenance methods 0816 // ----------------------------------------------------------------------- 0817 0818 /** @name Advanced document handler list maintenance methods */ 0819 //@{ 0820 /** 0821 * This method installs the specified 'advanced' document callback 0822 * handler, thereby allowing the user to customize the processing, 0823 * if they choose to do so. Any number of advanced callback handlers 0824 * maybe installed. 0825 * 0826 * <p>The methods in the advanced callback interface represent 0827 * Xerces-C extensions. There is no specification for this interface.</p> 0828 * 0829 * @param toInstall A pointer to the users advanced callback handler. 0830 * 0831 * @see #removeAdvDocHandler 0832 */ 0833 virtual void installAdvDocHandler(XMLDocumentHandler* const toInstall) ; 0834 0835 /** 0836 * This method removes the 'advanced' document handler callback from 0837 * the underlying parser scanner. If no handler is installed, advanced 0838 * callbacks are not invoked by the scanner. 0839 * @param toRemove A pointer to the advanced callback handler which 0840 * should be removed. 0841 * 0842 * @see #installAdvDocHandler 0843 */ 0844 virtual bool removeAdvDocHandler(XMLDocumentHandler* const toRemove) ; 0845 //@} 0846 0847 0848 // ----------------------------------------------------------------------- 0849 // The XMLFilter interface 0850 // ----------------------------------------------------------------------- 0851 0852 /** @name Implementation of SAX 2.0 XMLFilter interface's. */ 0853 //@{ 0854 /** 0855 * This method returns the parent XMLReader object. 0856 * 0857 * @return A pointer to the parent XMLReader object. 0858 */ 0859 virtual SAX2XMLReader* getParent() const; 0860 0861 /** 0862 * Sets the parent XMLReader object; parse requests will be forwarded to this 0863 * object, and callback notifications coming from it will be postprocessed 0864 * 0865 * @param parent The new XMLReader parent. 0866 * @see SAX2XMLReader#SAX2XMLReader 0867 */ 0868 virtual void setParent(SAX2XMLReader* parent); 0869 //@} 0870 0871 // ----------------------------------------------------------------------- 0872 // Implementation of the EntityResolver interface 0873 // ----------------------------------------------------------------------- 0874 /** @name The EntityResolver interface */ 0875 //@{ 0876 0877 /** 0878 * Allow the application to resolve external entities. 0879 * 0880 * <p>The Parser will call this method before opening any external 0881 * entity except the top-level document entity (including the 0882 * external DTD subset, external entities referenced within the 0883 * DTD, and external entities referenced within the document 0884 * element): the application may request that the parser resolve 0885 * the entity itself, that it use an alternative URI, or that it 0886 * use an entirely different input source.</p> 0887 * 0888 * <p>Application writers can use this method to redirect external 0889 * system identifiers to secure and/or local URIs, to look up 0890 * public identifiers in a catalogue, or to read an entity from a 0891 * database or other input source (including, for example, a dialog 0892 * box).</p> 0893 * 0894 * <p>If the system identifier is a URL, the SAX parser must 0895 * resolve it fully before reporting it to the application.</p> 0896 * 0897 * @param publicId The public identifier of the external entity 0898 * being referenced, or null if none was supplied. 0899 * @param systemId The system identifier of the external entity 0900 * being referenced. 0901 * @return An InputSource object describing the new input source, 0902 * or null to request that the parser open a regular 0903 * URI connection to the system identifier. 0904 * The returned InputSource is owned by the parser which is 0905 * responsible to clean up the memory. 0906 * @exception SAXException Any SAX exception, possibly 0907 * wrapping another exception. 0908 * @exception IOException An IO exception, 0909 * possibly the result of creating a new InputStream 0910 * or Reader for the InputSource. 0911 * @see InputSource#InputSource 0912 */ 0913 virtual InputSource* resolveEntity 0914 ( 0915 const XMLCh* const publicId 0916 , const XMLCh* const systemId 0917 ); 0918 0919 //@} 0920 0921 // ----------------------------------------------------------------------- 0922 // Implementation of the DTDHandler interface 0923 // ----------------------------------------------------------------------- 0924 /** @name The DTD handler interface */ 0925 //@{ 0926 /** 0927 * Receive notification of a notation declaration event. 0928 * 0929 * <p>It is up to the application to record the notation for later 0930 * reference, if necessary.</p> 0931 * 0932 * <p>If a system identifier is present, and it is a URL, the SAX 0933 * parser must resolve it fully before passing it to the 0934 * application.</p> 0935 * 0936 * @param name The notation name. 0937 * @param publicId The notation's public identifier, or null if 0938 * none was given. 0939 * @param systemId The notation's system identifier, or null if 0940 * none was given. 0941 * @exception SAXException Any SAX exception, possibly 0942 * wrapping another exception. 0943 * @see #unparsedEntityDecl 0944 * @see AttributeList#AttributeList 0945 */ 0946 virtual void notationDecl 0947 ( 0948 const XMLCh* const name 0949 , const XMLCh* const publicId 0950 , const XMLCh* const systemId 0951 ); 0952 0953 /** 0954 * Receive notification of an unparsed entity declaration event. 0955 * 0956 * <p>Note that the notation name corresponds to a notation 0957 * reported by the notationDecl() event. It is up to the 0958 * application to record the entity for later reference, if 0959 * necessary.</p> 0960 * 0961 * <p>If the system identifier is a URL, the parser must resolve it 0962 * fully before passing it to the application.</p> 0963 * 0964 * @exception SAXException Any SAX exception, possibly 0965 * wrapping another exception. 0966 * @param name The unparsed entity's name. 0967 * @param publicId The entity's public identifier, or null if none 0968 * was given. 0969 * @param systemId The entity's system identifier (it must always 0970 * have one). 0971 * @param notationName The name of the associated notation. 0972 * @see #notationDecl 0973 * @see AttributeList#AttributeList 0974 */ 0975 virtual void unparsedEntityDecl 0976 ( 0977 const XMLCh* const name 0978 , const XMLCh* const publicId 0979 , const XMLCh* const systemId 0980 , const XMLCh* const notationName 0981 ); 0982 0983 /** 0984 * Reset the DocType object on its reuse 0985 * 0986 * <p>This method helps in reseting the DTD object implementation 0987 * defaults each time the DTD is begun.</p> 0988 * 0989 */ 0990 virtual void resetDocType(); 0991 0992 //@} 0993 0994 // ----------------------------------------------------------------------- 0995 // Implementation of the ContentHandler interface 0996 // ----------------------------------------------------------------------- 0997 /** @name The virtual document handler interface */ 0998 0999 //@{ 1000 /** 1001 * Receive notification of character data. 1002 * 1003 * <p>The Parser will call this method to report each chunk of 1004 * character data. SAX parsers may return all contiguous character 1005 * data in a single chunk, or they may split it into several 1006 * chunks; however, all of the characters in any single event 1007 * must come from the same external entity, so that the Locator 1008 * provides useful information.</p> 1009 * 1010 * <p>The application must not attempt to read from the array 1011 * outside of the specified range.</p> 1012 * 1013 * <p>Note that some parsers will report whitespace using the 1014 * ignorableWhitespace() method rather than this one (validating 1015 * parsers must do so).</p> 1016 * 1017 * @param chars The characters from the XML document. 1018 * @param length The number of characters to read from the array. 1019 * @exception SAXException Any SAX exception, possibly 1020 * wrapping another exception. 1021 * @see #ignorableWhitespace 1022 * @see Locator#Locator 1023 */ 1024 virtual void characters 1025 ( 1026 const XMLCh* const chars 1027 , const XMLSize_t length 1028 ); 1029 1030 /** 1031 * Receive notification of the end of a document. 1032 * 1033 * <p>The SAX parser will invoke this method only once, and it will 1034 * be the last method invoked during the parse. The parser shall 1035 * not invoke this method until it has either abandoned parsing 1036 * (because of an unrecoverable error) or reached the end of 1037 * input.</p> 1038 * 1039 * @exception SAXException Any SAX exception, possibly 1040 * wrapping another exception. 1041 */ 1042 virtual void endDocument (); 1043 1044 /** 1045 * Receive notification of the end of an element. 1046 * 1047 * <p>The SAX parser will invoke this method at the end of every 1048 * element in the XML document; there will be a corresponding 1049 * startElement() event for every endElement() event (even when the 1050 * element is empty).</p> 1051 * 1052 * @param uri The URI of the associated namespace for this element 1053 * @param localname The local part of the element name 1054 * @param qname The QName of this element 1055 * @exception SAXException Any SAX exception, possibly 1056 * wrapping another exception. 1057 */ 1058 virtual void endElement 1059 ( 1060 const XMLCh* const uri, 1061 const XMLCh* const localname, 1062 const XMLCh* const qname 1063 ); 1064 1065 /** 1066 * Receive notification of ignorable whitespace in element content. 1067 * 1068 * <p>Validating Parsers must use this method to report each chunk 1069 * of ignorable whitespace (see the W3C XML 1.0 recommendation, 1070 * section 2.10): non-validating parsers may also use this method 1071 * if they are capable of parsing and using content models.</p> 1072 * 1073 * <p>SAX parsers may return all contiguous whitespace in a single 1074 * chunk, or they may split it into several chunks; however, all of 1075 * the characters in any single event must come from the same 1076 * external entity, so that the Locator provides useful 1077 * information.</p> 1078 * 1079 * <p>The application must not attempt to read from the array 1080 * outside of the specified range.</p> 1081 * 1082 * @param chars The characters from the XML document. 1083 * @param length The number of characters to read from the array. 1084 * @exception SAXException Any SAX exception, possibly 1085 * wrapping another exception. 1086 * @see #characters 1087 */ 1088 virtual void ignorableWhitespace 1089 ( 1090 const XMLCh* const chars 1091 , const XMLSize_t length 1092 ); 1093 1094 /** 1095 * Receive notification of a processing instruction. 1096 * 1097 * <p>The Parser will invoke this method once for each processing 1098 * instruction found: note that processing instructions may occur 1099 * before or after the main document element.</p> 1100 * 1101 * <p>A SAX parser should never report an XML declaration (XML 1.0, 1102 * section 2.8) or a text declaration (XML 1.0, section 4.3.1) 1103 * using this method.</p> 1104 * 1105 * @param target The processing instruction target. 1106 * @param data The processing instruction data, or null if 1107 * none was supplied. 1108 * @exception SAXException Any SAX exception, possibly 1109 * wrapping another exception. 1110 */ 1111 virtual void processingInstruction 1112 ( 1113 const XMLCh* const target 1114 , const XMLCh* const data 1115 ); 1116 1117 /** 1118 * Receive an object for locating the origin of SAX document events. 1119 * 1120 * SAX parsers are strongly encouraged (though not absolutely 1121 * required) to supply a locator: if it does so, it must supply 1122 * the locator to the application by invoking this method before 1123 * invoking any of the other methods in the DocumentHandler 1124 * interface. 1125 * 1126 * The locator allows the application to determine the end 1127 * position of any document-related event, even if the parser is 1128 * not reporting an error. Typically, the application will 1129 * use this information for reporting its own errors (such as 1130 * character content that does not match an application's 1131 * business rules). The information returned by the locator 1132 * is probably not sufficient for use with a search engine. 1133 * 1134 * Note that the locator will return correct information only 1135 * during the invocation of the events in this interface. The 1136 * application should not attempt to use it at any other time. 1137 * 1138 * @param locator An object that can return the location of 1139 * any SAX document event. The object is only 1140 * 'on loan' to the client code and they are not 1141 * to attempt to delete or modify it in any way! 1142 * 1143 * @see Locator#Locator 1144 */ 1145 virtual void setDocumentLocator(const Locator* const locator); 1146 1147 /** 1148 * Receive notification of the beginning of a document. 1149 * 1150 * <p>The SAX parser will invoke this method only once, before any 1151 * other methods in this interface or in DTDHandler (except for 1152 * setDocumentLocator).</p> 1153 * 1154 * @exception SAXException Any SAX exception, possibly 1155 * wrapping another exception. 1156 */ 1157 virtual void startDocument(); 1158 1159 /** 1160 * Receive notification of the beginning of an element. 1161 * 1162 * <p>The Parser will invoke this method at the beginning of every 1163 * element in the XML document; there will be a corresponding 1164 * endElement() event for every startElement() event (even when the 1165 * element is empty). All of the element's content will be 1166 * reported, in order, before the corresponding endElement() 1167 * event.</p> 1168 * 1169 * <p>Note that the attribute list provided will 1170 * contain only attributes with explicit values (specified or 1171 * defaulted): #IMPLIED attributes will be omitted.</p> 1172 * 1173 * @param uri The URI of the associated namespace for this element 1174 * @param localname The local part of the element name 1175 * @param qname The QName of this element 1176 * @param attrs The attributes attached to the element, if any. 1177 * @exception SAXException Any SAX exception, possibly 1178 * wrapping another exception. 1179 * @see #endElement 1180 * @see Attributes#Attributes 1181 */ 1182 virtual void startElement 1183 ( 1184 const XMLCh* const uri, 1185 const XMLCh* const localname, 1186 const XMLCh* const qname, 1187 const Attributes& attrs 1188 ); 1189 1190 /** 1191 * Receive notification of the start of an namespace prefix mapping. 1192 * 1193 * <p>By default, do nothing. Application writers may override this 1194 * method in a subclass to take specific actions at the start of 1195 * each namespace prefix mapping.</p> 1196 * 1197 * @param prefix The namespace prefix used 1198 * @param uri The namespace URI used. 1199 * @exception SAXException Any SAX exception, possibly 1200 * wrapping another exception. 1201 */ 1202 virtual void startPrefixMapping 1203 ( 1204 const XMLCh* const prefix, 1205 const XMLCh* const uri 1206 ); 1207 1208 /** 1209 * Receive notification of the end of an namespace prefix mapping. 1210 * 1211 * <p>By default, do nothing. Application writers may override this 1212 * method in a subclass to take specific actions at the end of 1213 * each namespace prefix mapping.</p> 1214 * 1215 * @param prefix The namespace prefix used 1216 * @exception SAXException Any SAX exception, possibly 1217 * wrapping another exception. 1218 */ 1219 virtual void endPrefixMapping 1220 ( 1221 const XMLCh* const prefix 1222 ); 1223 1224 /** 1225 * Receive notification of a skipped entity 1226 * 1227 * <p>The parser will invoke this method once for each entity 1228 * skipped. All processors may skip external entities, 1229 * depending on the values of the features:<br> 1230 * http://xml.org/sax/features/external-general-entities<br> 1231 * http://xml.org/sax/features/external-parameter-entities</p> 1232 * 1233 * <p>Note: Xerces (specifically) never skips any entities, regardless 1234 * of the above features. This function is never called in the 1235 * Xerces implementation of SAX2.</p> 1236 * 1237 * <p>Introduced with SAX2</p> 1238 * 1239 * @param name The name of the skipped entity. If it is a parameter entity, 1240 * the name will begin with %, and if it is the external DTD subset, 1241 * it will be the string [dtd]. 1242 * @exception SAXException Any SAX exception, possibly 1243 * wrapping another exception. 1244 */ 1245 virtual void skippedEntity 1246 ( 1247 const XMLCh* const name 1248 ); 1249 1250 //@} 1251 1252 // ----------------------------------------------------------------------- 1253 // Implementation of the ErrorHandler interface 1254 // ----------------------------------------------------------------------- 1255 /** @name The error handler interface */ 1256 //@{ 1257 /** 1258 * Receive notification of a warning. 1259 * 1260 * <p>SAX parsers will use this method to report conditions that 1261 * are not errors or fatal errors as defined by the XML 1.0 1262 * recommendation. The default behaviour is to take no action.</p> 1263 * 1264 * <p>The SAX parser must continue to provide normal parsing events 1265 * after invoking this method: it should still be possible for the 1266 * application to process the document through to the end.</p> 1267 * 1268 * @param exc The warning information encapsulated in a 1269 * SAX parse exception. 1270 * @exception SAXException Any SAX exception, possibly 1271 * wrapping another exception. 1272 * @see SAXParseException#SAXParseException 1273 */ 1274 virtual void warning(const SAXParseException& exc); 1275 1276 /** 1277 * Receive notification of a recoverable error. 1278 * 1279 * <p>This corresponds to the definition of "error" in section 1.2 1280 * of the W3C XML 1.0 Recommendation. For example, a validating 1281 * parser would use this callback to report the violation of a 1282 * validity constraint. The default behaviour is to take no 1283 * action.</p> 1284 * 1285 * <p>The SAX parser must continue to provide normal parsing events 1286 * after invoking this method: it should still be possible for the 1287 * application to process the document through to the end. If the 1288 * application cannot do so, then the parser should report a fatal 1289 * error even if the XML 1.0 recommendation does not require it to 1290 * do so.</p> 1291 * 1292 * @param exc The error information encapsulated in a 1293 * SAX parse exception. 1294 * @exception SAXException Any SAX exception, possibly 1295 * wrapping another exception. 1296 * @see SAXParseException#SAXParseException 1297 */ 1298 virtual void error(const SAXParseException& exc); 1299 1300 /** 1301 * Receive notification of a non-recoverable error. 1302 * 1303 * <p>This corresponds to the definition of "fatal error" in 1304 * section 1.2 of the W3C XML 1.0 Recommendation. For example, a 1305 * parser would use this callback to report the violation of a 1306 * well-formedness constraint.</p> 1307 * 1308 * <p>The application must assume that the document is unusable 1309 * after the parser has invoked this method, and should continue 1310 * (if at all) only for the sake of collecting addition error 1311 * messages: in fact, SAX parsers are free to stop reporting any 1312 * other events once this method has been invoked.</p> 1313 * 1314 * @param exc The error information encapsulated in a 1315 * SAX parse exception. 1316 * @exception SAXException Any SAX exception, possibly 1317 * wrapping another exception. 1318 * @see SAXParseException#SAXParseException 1319 */ 1320 virtual void fatalError(const SAXParseException& exc); 1321 1322 /** 1323 * Reset the Error handler object on its reuse 1324 * 1325 * <p>This method helps in reseting the Error handler object 1326 * implementation defaults each time the Error handler is begun.</p> 1327 * 1328 */ 1329 virtual void resetErrors(); 1330 1331 //@} 1332 1333 1334 private : 1335 // ----------------------------------------------------------------------- 1336 // Unimplemented constructors and operators 1337 // ----------------------------------------------------------------------- 1338 SAX2XMLFilterImpl(const SAX2XMLFilterImpl&); 1339 SAX2XMLFilterImpl& operator=(const SAX2XMLFilterImpl&); 1340 1341 // ----------------------------------------------------------------------- 1342 // Private data members 1343 // 1344 // fParentReader 1345 // The object that we are filtering 1346 // 1347 // fDocHandler 1348 // The installed SAX content handler, if any. Null if none. 1349 // 1350 // fDTDHandler 1351 // The installed SAX DTD handler, if any. Null if none. 1352 // 1353 // fEntityResolver 1354 // The installed SAX entity handler, if any. Null if none. 1355 // 1356 // fErrorHandler 1357 // The installed SAX error handler, if any. Null if none. 1358 // 1359 // ----------------------------------------------------------------------- 1360 SAX2XMLReader* fParentReader; 1361 ContentHandler* fDocHandler; 1362 DTDHandler* fDTDHandler; 1363 EntityResolver* fEntityResolver; 1364 ErrorHandler* fErrorHandler; 1365 }; 1366 1367 1368 // --------------------------------------------------------------------------- 1369 // SAX2XMLReader: Getter methods 1370 // --------------------------------------------------------------------------- 1371 inline SAX2XMLReader* SAX2XMLFilterImpl::getParent() const 1372 { 1373 return fParentReader; 1374 } 1375 1376 inline ContentHandler* SAX2XMLFilterImpl::getContentHandler() const 1377 { 1378 return fDocHandler; 1379 } 1380 1381 inline DTDHandler* SAX2XMLFilterImpl::getDTDHandler() const 1382 { 1383 return fDTDHandler; 1384 } 1385 1386 inline EntityResolver* SAX2XMLFilterImpl::getEntityResolver() const 1387 { 1388 return fEntityResolver; 1389 } 1390 1391 inline ErrorHandler* SAX2XMLFilterImpl::getErrorHandler() const 1392 { 1393 return fErrorHandler; 1394 } 1395 1396 inline LexicalHandler* SAX2XMLFilterImpl::getLexicalHandler() const 1397 { 1398 return 0; 1399 } 1400 1401 inline DeclHandler* SAX2XMLFilterImpl::getDeclarationHandler() const 1402 { 1403 return 0; 1404 } 1405 1406 inline void SAX2XMLFilterImpl::setContentHandler(ContentHandler* const handler) 1407 { 1408 fDocHandler = handler; 1409 } 1410 1411 inline void SAX2XMLFilterImpl::setDTDHandler(DTDHandler* const handler) 1412 { 1413 fDTDHandler = handler; 1414 } 1415 1416 inline void SAX2XMLFilterImpl::setErrorHandler(ErrorHandler* const handler) 1417 { 1418 fErrorHandler = handler; 1419 } 1420 1421 inline void SAX2XMLFilterImpl::setEntityResolver(EntityResolver* const resolver) 1422 { 1423 fEntityResolver = resolver; 1424 } 1425 1426 inline void SAX2XMLFilterImpl::setLexicalHandler(LexicalHandler* const /*handler*/) 1427 { 1428 } 1429 1430 inline void SAX2XMLFilterImpl::setDeclarationHandler(DeclHandler* const /*handler*/) 1431 { 1432 } 1433 1434 inline void SAX2XMLFilterImpl::installAdvDocHandler(XMLDocumentHandler* const /*toInstall*/) 1435 { 1436 } 1437 1438 inline bool SAX2XMLFilterImpl::removeAdvDocHandler(XMLDocumentHandler* const /*toRemove*/) 1439 { 1440 return false; 1441 } 1442 1443 XERCES_CPP_NAMESPACE_END 1444 1445 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |