1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.parsers;
  22 
  23 import java.io.IOException;
  24 import java.util.ArrayList;
  25 import java.util.HashMap;
  26 import java.util.Locale;
  27 
  28 import com.sun.org.apache.xerces.internal.impl.Constants;
  29 import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
  30 import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
  31 import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
  32 import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
  33 import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
  34 import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
  35 import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
  36 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
  37 import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
  38 import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
  39 import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
  40 import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
  41 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
  42 import com.sun.org.apache.xerces.internal.util.FeatureState;
  43 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
  44 import com.sun.org.apache.xerces.internal.util.PropertyState;
  45 import com.sun.org.apache.xerces.internal.util.Status;
  46 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  47 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
  48 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
  49 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
  50 import com.sun.org.apache.xerces.internal.xni.XMLLocator;
  51 import com.sun.org.apache.xerces.internal.xni.XNIException;
  52 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
  53 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
  54 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
  55 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
  56 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
  57 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
  58 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
  59 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  60 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  61 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  62 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
  63 
  64 /**
  65  * This class is the non vlaidating parser configuration
  66  * used to parse XML 1.0 and XML 1.1 documents.
  67  *
  68  * Xerces parser that uses this configuration is <strong>not</strong> <a href="http://www.w3.org/TR/REC-xml#sec-conformance">conformant</a>
  69  * non-validating XML processor, since conformant non-validating processor is required
  70  * to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values,
  71  * include the replacement text of internal entities, and supply default attribute values".
  72 
  73  * @author Elena Litani, IBM
  74  * @author John Kim, IBM
  75  * @author Michael Glavassevich, IBM
  76  *
  77  */
  78 public class XML11NonValidatingConfiguration extends ParserConfigurationSettings
  79     implements XMLPullParserConfiguration, XML11Configurable {
  80 
  81     //
  82     // Constants
  83     //
  84     protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
  85         "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
  86 
  87     // feature identifiers
  88 
  89     /** Feature identifier: validation. */
  90     protected static final String VALIDATION =
  91         Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
  92 
  93     /** Feature identifier: namespaces. */
  94     protected static final String NAMESPACES =
  95         Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
  96 
  97     /** Feature identifier: external general entities. */
  98     protected static final String EXTERNAL_GENERAL_ENTITIES =
  99         Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
 100 
 101     /** Feature identifier: external parameter entities. */
 102     protected static final String EXTERNAL_PARAMETER_ENTITIES =
 103         Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
 104 
 105 
 106     /** Feature identifier: continue after fatal error. */
 107     protected static final String CONTINUE_AFTER_FATAL_ERROR =
 108         Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
 109 
 110 
 111     // property identifiers
 112 
 113         /** Property identifier: xml string. */
 114         protected static final String XML_STRING =
 115                 Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
 116 
 117         /** Property identifier: symbol table. */
 118         protected static final String SYMBOL_TABLE =
 119                 Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
 120 
 121         /** Property identifier: error handler. */
 122         protected static final String ERROR_HANDLER =
 123                 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
 124 
 125         /** Property identifier: entity resolver. */
 126         protected static final String ENTITY_RESOLVER =
 127                 Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
 128 
 129     /** Property identifier: error reporter. */
 130     protected static final String ERROR_REPORTER =
 131         Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
 132 
 133     /** Property identifier: entity manager. */
 134     protected static final String ENTITY_MANAGER =
 135         Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
 136 
 137     /** Property identifier document scanner: */
 138     protected static final String DOCUMENT_SCANNER =
 139         Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
 140 
 141     /** Property identifier: DTD scanner. */
 142     protected static final String DTD_SCANNER =
 143         Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
 144 
 145     /** Property identifier: grammar pool. */
 146     protected static final String XMLGRAMMAR_POOL =
 147         Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
 148 
 149     /** Property identifier: DTD validator. */
 150     protected static final String DTD_VALIDATOR =
 151         Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
 152 
 153     /** Property identifier: namespace binder. */
 154     protected static final String NAMESPACE_BINDER =
 155         Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
 156 
 157     /** Property identifier: datatype validator factory. */
 158     protected static final String DATATYPE_VALIDATOR_FACTORY =
 159         Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
 160 
 161     protected static final String VALIDATION_MANAGER =
 162         Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
 163 
 164     // debugging
 165 
 166     /** Set to true and recompile to print exception stack trace. */
 167     protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
 168 
 169     //
 170     // Data
 171     //
 172     protected SymbolTable fSymbolTable;
 173     protected XMLInputSource fInputSource;
 174     protected ValidationManager fValidationManager;
 175     protected XMLVersionDetector fVersionDetector;
 176     protected XMLLocator fLocator;
 177     protected Locale fLocale;
 178 
 179     /** XML 1.0 Components. */
 180     protected ArrayList fComponents;
 181 
 182     /** XML 1.1. Components. */
 183     protected ArrayList fXML11Components = null;
 184 
 185     /** Common components: XMLEntityManager, XMLErrorReporter */
 186     protected ArrayList fCommonComponents = null;
 187 
 188     /** The document handler. */
 189     protected XMLDocumentHandler fDocumentHandler;
 190 
 191     /** The DTD handler. */
 192     protected XMLDTDHandler fDTDHandler;
 193 
 194     /** The DTD content model handler. */
 195     protected XMLDTDContentModelHandler fDTDContentModelHandler;
 196 
 197     /** Last component in the document pipeline */
 198     protected XMLDocumentSource fLastComponent;
 199 
 200     /**
 201      * True if a parse is in progress. This state is needed because
 202      * some features/properties cannot be set while parsing (e.g.
 203      * namespaces).
 204      */
 205     protected boolean fParseInProgress = false;
 206 
 207     /** fConfigUpdated is set to true if there has been any change to the configuration settings,
 208      * i.e a feature or a property was changed.
 209      */
 210     protected boolean fConfigUpdated = false;
 211 
 212     //
 213     // XML 1.0 components
 214     //
 215 
 216     /** The XML 1.0 Datatype validator factory. */
 217     protected DTDDVFactory fDatatypeValidatorFactory;
 218 
 219     /** The XML 1.0 Document scanner that does namespace binding. */
 220     protected XMLNSDocumentScannerImpl fNamespaceScanner;
 221 
 222     /** The XML 1.0 Non-namespace implementation of scanner */
 223     protected XMLDocumentScannerImpl fNonNSScanner;
 224 
 225     /** The XML 1.0 DTD scanner. */
 226     protected XMLDTDScanner fDTDScanner;
 227 
 228     //
 229     // XML 1.1 components
 230     //
 231 
 232     /** The XML 1.1 datatype factory. **/
 233     protected DTDDVFactory fXML11DatatypeFactory = null;
 234 
 235     /** The XML 1.1 document scanner that does namespace binding. **/
 236     protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
 237 
 238     /** The XML 1.1 document scanner that does not do namespace binding. **/
 239     protected XML11DocumentScannerImpl fXML11DocScanner = null;
 240 
 241     /** The XML 1.1 DTD scanner. **/
 242     protected XML11DTDScannerImpl fXML11DTDScanner = null;
 243 
 244     //
 245     // Common components
 246     //
 247 
 248     /** Grammar pool. */
 249     protected XMLGrammarPool fGrammarPool;
 250 
 251     /** Error reporter. */
 252     protected XMLErrorReporter fErrorReporter;
 253 
 254     /** Entity manager. */
 255     protected XMLEntityManager fEntityManager;
 256 
 257     /** Current scanner */
 258     protected XMLDocumentScanner fCurrentScanner;
 259 
 260     /** Current Datatype validator factory. */
 261     protected DTDDVFactory fCurrentDVFactory;
 262 
 263     /** Current DTD scanner. */
 264     protected XMLDTDScanner fCurrentDTDScanner;
 265 
 266 
 267     /** Flag indiciating whether XML11 components have been initialized. */
 268     private boolean f11Initialized = false;
 269 
 270     //
 271     // Constructors
 272     //
 273 
 274     /** Default constructor. */
 275     public XML11NonValidatingConfiguration() {
 276         this(null, null, null);
 277     } // <init>()
 278 
 279     /**
 280      * Constructs a parser configuration using the specified symbol table.
 281      *
 282      * @param symbolTable The symbol table to use.
 283      */
 284     public XML11NonValidatingConfiguration(SymbolTable symbolTable) {
 285         this(symbolTable, null, null);
 286     } // <init>(SymbolTable)
 287 
 288     /**
 289      * Constructs a parser configuration using the specified symbol table and
 290      * grammar pool.
 291      * <p>
 292      * <strong>REVISIT:</strong>
 293      * Grammar pool will be updated when the new validation engine is
 294      * implemented.
 295      *
 296      * @param symbolTable The symbol table to use.
 297      * @param grammarPool The grammar pool to use.
 298      */
 299     public XML11NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
 300         this(symbolTable, grammarPool, null);
 301     } // <init>(SymbolTable,XMLGrammarPool)
 302 
 303     /**
 304      * Constructs a parser configuration using the specified symbol table,
 305      * grammar pool, and parent settings.
 306      * <p>
 307      * <strong>REVISIT:</strong>
 308      * Grammar pool will be updated when the new validation engine is
 309      * implemented.
 310      *
 311      * @param symbolTable    The symbol table to use.
 312      * @param grammarPool    The grammar pool to use.
 313      * @param parentSettings The parent settings.
 314      */
 315     public XML11NonValidatingConfiguration(
 316         SymbolTable symbolTable,
 317         XMLGrammarPool grammarPool,
 318         XMLComponentManager parentSettings) {
 319 
 320                 super(parentSettings);
 321 
 322                 // create a vector to hold all the components in use
 323                 // XML 1.0 specialized components
 324                 fComponents = new ArrayList();
 325                 // XML 1.1 specialized components
 326                 fXML11Components = new ArrayList();
 327                 // Common components for XML 1.1. and XML 1.0
 328                 fCommonComponents = new ArrayList();
 329 
 330                 // create table for features and properties
 331                 fFeatures = new HashMap();
 332                 fProperties = new HashMap();
 333 
 334         // add default recognized features
 335         final String[] recognizedFeatures =
 336             {
 337                 CONTINUE_AFTER_FATAL_ERROR, // from XMLDTDScannerImpl
 338                                 VALIDATION,
 339                                 NAMESPACES,
 340                                 EXTERNAL_GENERAL_ENTITIES,
 341                                 EXTERNAL_PARAMETER_ENTITIES,
 342                                 PARSER_SETTINGS
 343                         };
 344         addRecognizedFeatures(recognizedFeatures);
 345 
 346                 // set state for default features
 347                 fFeatures.put(VALIDATION, Boolean.FALSE);
 348                 fFeatures.put(NAMESPACES, Boolean.TRUE);
 349                 fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
 350                 fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
 351                 fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
 352                 fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
 353 
 354         // add default recognized properties
 355         final String[] recognizedProperties =
 356             {
 357                 XML_STRING,
 358                 SYMBOL_TABLE,
 359                                 ERROR_HANDLER,
 360                                 ENTITY_RESOLVER,
 361                 ERROR_REPORTER,
 362                 ENTITY_MANAGER,
 363                 DOCUMENT_SCANNER,
 364                 DTD_SCANNER,
 365                 DTD_VALIDATOR,
 366                                 DATATYPE_VALIDATOR_FACTORY,
 367                                 VALIDATION_MANAGER,
 368                                 XML_STRING,
 369                 XMLGRAMMAR_POOL, };
 370         addRecognizedProperties(recognizedProperties);
 371 
 372                 if (symbolTable == null) {
 373                         symbolTable = new SymbolTable();
 374                 }
 375                 fSymbolTable = symbolTable;
 376                 fProperties.put(SYMBOL_TABLE, fSymbolTable);
 377 
 378         fGrammarPool = grammarPool;
 379         if (fGrammarPool != null) {
 380                         fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
 381         }
 382 
 383         fEntityManager = new XMLEntityManager();
 384                 fProperties.put(ENTITY_MANAGER, fEntityManager);
 385         addCommonComponent(fEntityManager);
 386 
 387         fErrorReporter = new XMLErrorReporter();
 388         fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
 389                 fProperties.put(ERROR_REPORTER, fErrorReporter);
 390         addCommonComponent(fErrorReporter);
 391 
 392         fNamespaceScanner = new XMLNSDocumentScannerImpl();
 393                 fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
 394         addComponent((XMLComponent) fNamespaceScanner);
 395 
 396         fDTDScanner = new XMLDTDScannerImpl();
 397                 fProperties.put(DTD_SCANNER, fDTDScanner);
 398         addComponent((XMLComponent) fDTDScanner);
 399 
 400         fDatatypeValidatorFactory = DTDDVFactory.getInstance();
 401                 fProperties.put(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
 402 
 403         fValidationManager = new ValidationManager();
 404                 fProperties.put(VALIDATION_MANAGER, fValidationManager);
 405 
 406         fVersionDetector = new XMLVersionDetector();
 407 
 408         // add message formatters
 409         if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
 410             XMLMessageFormatter xmft = new XMLMessageFormatter();
 411             fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
 412             fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
 413         }
 414 
 415         // set locale
 416         try {
 417             setLocale(Locale.getDefault());
 418         } catch (XNIException e) {
 419             // do nothing
 420             // REVISIT: What is the right thing to do? -Ac
 421         }
 422 
 423                 fConfigUpdated = false;
 424 
 425     } // <init>(SymbolTable,XMLGrammarPool)
 426 
 427     /**
 428      * Sets the input source for the document to parse.
 429      *
 430      * @param inputSource The document's input source.
 431      *
 432      * @exception XMLConfigurationException Thrown if there is a
 433      *                        configuration error when initializing the
 434      *                        parser.
 435      * @exception IOException Thrown on I/O error.
 436      *
 437      * @see #parse(boolean)
 438      */
 439     public void setInputSource(XMLInputSource inputSource)
 440         throws XMLConfigurationException, IOException {
 441 
 442         // REVISIT: this method used to reset all the components and
 443         //          construct the pipeline. Now reset() is called
 444         //          in parse (boolean) just before we parse the document
 445         //          Should this method still throw exceptions..?
 446 
 447         fInputSource = inputSource;
 448 
 449     } // setInputSource(XMLInputSource)
 450 
 451     /**
 452      * Set the locale to use for messages.
 453      *
 454      * @param locale The locale object to use for localization of messages.
 455      *
 456      * @exception XNIException Thrown if the parser does not support the
 457      *                         specified locale.
 458      */
 459     public void setLocale(Locale locale) throws XNIException {
 460         fLocale = locale;
 461         fErrorReporter.setLocale(locale);
 462     } // setLocale(Locale)
 463 
 464         /**
 465          * Sets the document handler on the last component in the pipeline
 466          * to receive information about the document.
 467          *
 468          * @param documentHandler   The document handler.
 469          */
 470         public void setDocumentHandler(XMLDocumentHandler documentHandler) {
 471                 fDocumentHandler = documentHandler;
 472                 if (fLastComponent != null) {
 473                         fLastComponent.setDocumentHandler(fDocumentHandler);
 474                         if (fDocumentHandler !=null){
 475                                 fDocumentHandler.setDocumentSource(fLastComponent);
 476                         }
 477                 }
 478         } // setDocumentHandler(XMLDocumentHandler)
 479 
 480         /** Returns the registered document handler. */
 481         public XMLDocumentHandler getDocumentHandler() {
 482                 return fDocumentHandler;
 483         } // getDocumentHandler():XMLDocumentHandler
 484 
 485         /**
 486          * Sets the DTD handler.
 487          *
 488          * @param dtdHandler The DTD handler.
 489          */
 490         public void setDTDHandler(XMLDTDHandler dtdHandler) {
 491                 fDTDHandler = dtdHandler;
 492         } // setDTDHandler(XMLDTDHandler)
 493 
 494         /** Returns the registered DTD handler. */
 495         public XMLDTDHandler getDTDHandler() {
 496                 return fDTDHandler;
 497         } // getDTDHandler():XMLDTDHandler
 498 
 499         /**
 500          * Sets the DTD content model handler.
 501          *
 502          * @param handler The DTD content model handler.
 503          */
 504         public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
 505                 fDTDContentModelHandler = handler;
 506         } // setDTDContentModelHandler(XMLDTDContentModelHandler)
 507 
 508         /** Returns the registered DTD content model handler. */
 509         public XMLDTDContentModelHandler getDTDContentModelHandler() {
 510                 return fDTDContentModelHandler;
 511         } // getDTDContentModelHandler():XMLDTDContentModelHandler
 512 
 513         /**
 514          * Sets the resolver used to resolve external entities. The EntityResolver
 515          * interface supports resolution of public and system identifiers.
 516          *
 517          * @param resolver The new entity resolver. Passing a null value will
 518          *                 uninstall the currently installed resolver.
 519          */
 520         public void setEntityResolver(XMLEntityResolver resolver) {
 521                 fProperties.put(ENTITY_RESOLVER, resolver);
 522         } // setEntityResolver(XMLEntityResolver)
 523 
 524         /**
 525          * Return the current entity resolver.
 526          *
 527          * @return The current entity resolver, or null if none
 528          *         has been registered.
 529          * @see #setEntityResolver
 530          */
 531         public XMLEntityResolver getEntityResolver() {
 532                 return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
 533         } // getEntityResolver():XMLEntityResolver
 534 
 535         /**
 536          * Allow an application to register an error event handler.
 537          *
 538          * <p>If the application does not register an error handler, all
 539          * error events reported by the SAX parser will be silently
 540          * ignored; however, normal processing may not continue.  It is
 541          * highly recommended that all SAX applications implement an
 542          * error handler to avoid unexpected bugs.</p>
 543          *
 544          * <p>Applications may register a new or different handler in the
 545          * middle of a parse, and the SAX parser must begin using the new
 546          * handler immediately.</p>
 547          *
 548          * @param errorHandler The error handler.
 549          * @exception java.lang.NullPointerException If the handler
 550          *            argument is null.
 551          * @see #getErrorHandler
 552          */
 553         public void setErrorHandler(XMLErrorHandler errorHandler) {
 554                 fProperties.put(ERROR_HANDLER, errorHandler);
 555         } // setErrorHandler(XMLErrorHandler)
 556 
 557         /**
 558          * Return the current error handler.
 559          *
 560          * @return The current error handler, or null if none
 561          *         has been registered.
 562          * @see #setErrorHandler
 563          */
 564         public XMLErrorHandler getErrorHandler() {
 565                 // REVISIT: Should this be a property?
 566                 return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
 567         } // getErrorHandler():XMLErrorHandler
 568 
 569 
 570     /**
 571      * If the application decides to terminate parsing before the xml document
 572      * is fully parsed, the application should call this method to free any
 573      * resource allocated during parsing. For example, close all opened streams.
 574      */
 575     public void cleanup() {
 576         fEntityManager.closeReaders();
 577     }
 578 
 579     /**
 580      * Parses the specified input source.
 581      *
 582      * @param source The input source.
 583      *
 584      * @exception XNIException Throws exception on XNI error.
 585      * @exception java.io.IOException Throws exception on i/o error.
 586      */
 587     public void parse(XMLInputSource source) throws XNIException, IOException {
 588 
 589         if (fParseInProgress) {
 590             // REVISIT - need to add new error message
 591             throw new XNIException("FWK005 parse may not be called while parsing.");
 592         }
 593         fParseInProgress = true;
 594 
 595         try {
 596             setInputSource(source);
 597             parse(true);
 598         } catch (XNIException ex) {
 599             if (PRINT_EXCEPTION_STACK_TRACE)
 600                 ex.printStackTrace();
 601             throw ex;
 602         } catch (IOException ex) {
 603             if (PRINT_EXCEPTION_STACK_TRACE)
 604                 ex.printStackTrace();
 605             throw ex;
 606         } catch (RuntimeException ex) {
 607             if (PRINT_EXCEPTION_STACK_TRACE)
 608                 ex.printStackTrace();
 609             throw ex;
 610         } catch (Exception ex) {
 611             if (PRINT_EXCEPTION_STACK_TRACE)
 612                 ex.printStackTrace();
 613             throw new XNIException(ex);
 614         } finally {
 615             fParseInProgress = false;
 616             // close all streams opened by xerces
 617             this.cleanup();
 618         }
 619 
 620     } // parse(InputSource)
 621 
 622     public boolean parse(boolean complete) throws XNIException, IOException {
 623         //
 624         // reset and configure pipeline and set InputSource.
 625         if (fInputSource != null) {
 626             try {
 627                                 fValidationManager.reset();
 628                 fVersionDetector.reset(this);
 629                 resetCommon();
 630 
 631                 short version = fVersionDetector.determineDocVersion(fInputSource);
 632                 if (version == Constants.XML_VERSION_1_1) {
 633                     initXML11Components();
 634                     configureXML11Pipeline();
 635                     resetXML11();
 636                 } else {
 637                     configurePipeline();
 638                     reset();
 639                 }
 640 
 641                 // mark configuration as fixed
 642                 fConfigUpdated = false;
 643 
 644                 // resets and sets the pipeline.
 645                 fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
 646                 fInputSource = null;
 647             } catch (XNIException ex) {
 648                 if (PRINT_EXCEPTION_STACK_TRACE)
 649                     ex.printStackTrace();
 650                 throw ex;
 651             } catch (IOException ex) {
 652                 if (PRINT_EXCEPTION_STACK_TRACE)
 653                     ex.printStackTrace();
 654                 throw ex;
 655             } catch (RuntimeException ex) {
 656                 if (PRINT_EXCEPTION_STACK_TRACE)
 657                     ex.printStackTrace();
 658                 throw ex;
 659             } catch (Exception ex) {
 660                 if (PRINT_EXCEPTION_STACK_TRACE)
 661                     ex.printStackTrace();
 662                 throw new XNIException(ex);
 663             }
 664         }
 665 
 666         try {
 667             return fCurrentScanner.scanDocument(complete);
 668         } catch (XNIException ex) {
 669             if (PRINT_EXCEPTION_STACK_TRACE)
 670                 ex.printStackTrace();
 671             throw ex;
 672         } catch (IOException ex) {
 673             if (PRINT_EXCEPTION_STACK_TRACE)
 674                 ex.printStackTrace();
 675             throw ex;
 676         } catch (RuntimeException ex) {
 677             if (PRINT_EXCEPTION_STACK_TRACE)
 678                 ex.printStackTrace();
 679             throw ex;
 680         } catch (Exception ex) {
 681             if (PRINT_EXCEPTION_STACK_TRACE)
 682                 ex.printStackTrace();
 683             throw new XNIException(ex);
 684         }
 685 
 686     } // parse(boolean):boolean
 687 
 688         /**
 689          * Returns the state of a feature.
 690          *
 691          * @param featureId The feature identifier.
 692                  * @return true if the feature is supported
 693          *
 694          * @throws XMLConfigurationException Thrown for configuration error.
 695          *                                   In general, components should
 696          *                                   only throw this exception if
 697          *                                   it is <strong>really</strong>
 698          *                                   a critical error.
 699          */
 700         public FeatureState getFeatureState(String featureId)
 701                 throws XMLConfigurationException {
 702                         // make this feature special
 703         if (featureId.equals(PARSER_SETTINGS)){
 704                 return FeatureState.is(fConfigUpdated);
 705         }
 706         return super.getFeatureState(featureId);
 707 
 708         } // getFeature(String):boolean
 709 
 710         /**
 711          * Set the state of a feature.
 712          *
 713          * Set the state of any feature in a SAX2 parser.  The parser
 714          * might not recognize the feature, and if it does recognize
 715          * it, it might not be able to fulfill the request.
 716          *
 717          * @param featureId The unique identifier (URI) of the feature.
 718          * @param state The requested state of the feature (true or false).
 719          *
 720          * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
 721          *            requested feature is not known.
 722          */
 723         public void setFeature(String featureId, boolean state)
 724                 throws XMLConfigurationException {
 725                 fConfigUpdated = true;
 726                 // forward to every XML 1.0 component
 727                 int count = fComponents.size();
 728                 for (int i = 0; i < count; i++) {
 729                         XMLComponent c = (XMLComponent) fComponents.get(i);
 730                         c.setFeature(featureId, state);
 731                 }
 732                 // forward it to common components
 733                 count = fCommonComponents.size();
 734                 for (int i = 0; i < count; i++) {
 735                         XMLComponent c = (XMLComponent) fCommonComponents.get(i);
 736                         c.setFeature(featureId, state);
 737                 }
 738 
 739                 // forward to every XML 1.1 component
 740                 count = fXML11Components.size();
 741                 for (int i = 0; i < count; i++) {
 742                         XMLComponent c = (XMLComponent) fXML11Components.get(i);
 743                         try{
 744                                 c.setFeature(featureId, state);
 745                         }
 746                         catch (Exception e){
 747                                 // no op
 748                         }
 749                 }
 750                 // save state if noone "objects"
 751                 super.setFeature(featureId, state);
 752 
 753         } // setFeature(String,boolean)
 754 
 755         /**
 756          * setProperty
 757          *
 758          * @param propertyId
 759          * @param value
 760          */
 761         public void setProperty(String propertyId, Object value)
 762                 throws XMLConfigurationException {
 763                 fConfigUpdated = true;
 764                 // forward to every XML 1.0 component
 765                 int count = fComponents.size();
 766                 for (int i = 0; i < count; i++) {
 767                         XMLComponent c = (XMLComponent) fComponents.get(i);
 768                         c.setProperty(propertyId, value);
 769                 }
 770                 // forward it to every common Component
 771                 count = fCommonComponents.size();
 772                 for (int i = 0; i < count; i++) {
 773                         XMLComponent c = (XMLComponent) fCommonComponents.get(i);
 774                         c.setProperty(propertyId, value);
 775                 }
 776                 // forward it to every XML 1.1 component
 777                 count = fXML11Components.size();
 778                 for (int i = 0; i < count; i++) {
 779                         XMLComponent c = (XMLComponent) fXML11Components.get(i);
 780                         try{
 781                                 c.setProperty(propertyId, value);
 782                         }
 783                         catch (Exception e){
 784                                 // ignore it
 785                         }
 786                 }
 787 
 788                 // store value if noone "objects"
 789                 super.setProperty(propertyId, value);
 790 
 791         } // setProperty(String,Object)
 792 
 793 
 794         /** Returns the locale. */
 795         public Locale getLocale() {
 796                 return fLocale;
 797         } // getLocale():Locale
 798 
 799         /**
 800          * reset all XML 1.0 components before parsing and namespace context
 801          */
 802         protected void reset() throws XNIException {
 803                 int count = fComponents.size();
 804                 for (int i = 0; i < count; i++) {
 805                         XMLComponent c = (XMLComponent) fComponents.get(i);
 806                         c.reset(this);
 807                 }
 808 
 809         } // reset()
 810 
 811         /**
 812          * reset all common components before parsing
 813          */
 814         protected void resetCommon() throws XNIException {
 815                 // reset common components
 816                 int count = fCommonComponents.size();
 817                 for (int i = 0; i < count; i++) {
 818                         XMLComponent c = (XMLComponent) fCommonComponents.get(i);
 819                         c.reset(this);
 820                 }
 821 
 822         } // resetCommon()
 823 
 824 
 825         /**
 826          * reset all components before parsing and namespace context
 827          */
 828         protected void resetXML11() throws XNIException {
 829                 // reset every component
 830                 int count = fXML11Components.size();
 831                 for (int i = 0; i < count; i++) {
 832                         XMLComponent c = (XMLComponent) fXML11Components.get(i);
 833                         c.reset(this);
 834                 }
 835 
 836         } // resetXML11()
 837 
 838 
 839     /**
 840      *  Configures the XML 1.1 pipeline.
 841      *  Note: this method also resets the new XML11 components.
 842      */
 843     protected void configureXML11Pipeline() {
 844         if (fCurrentDVFactory != fXML11DatatypeFactory) {
 845             fCurrentDVFactory = fXML11DatatypeFactory;
 846             setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
 847         }
 848 
 849         // setup DTD pipeline
 850         if (fCurrentDTDScanner != fXML11DTDScanner) {
 851             fCurrentDTDScanner = fXML11DTDScanner;
 852             setProperty(DTD_SCANNER, fCurrentDTDScanner);
 853         }
 854         fXML11DTDScanner.setDTDHandler(fDTDHandler);
 855         fXML11DTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
 856 
 857         // setup XML 1.1 document pipeline
 858         if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
 859             if (fCurrentScanner != fXML11NSDocScanner) {
 860                 fCurrentScanner = fXML11NSDocScanner;
 861                 setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner);
 862             }
 863 
 864             fXML11NSDocScanner.setDTDValidator(null);
 865             fXML11NSDocScanner.setDocumentHandler(fDocumentHandler);
 866             if (fDocumentHandler != null) {
 867                 fDocumentHandler.setDocumentSource(fXML11NSDocScanner);
 868             }
 869             fLastComponent = fXML11NSDocScanner;
 870 
 871         } else {
 872                         // create components
 873                           if (fXML11DocScanner == null) {
 874                                         // non namespace document pipeline
 875                                         fXML11DocScanner = new XML11DocumentScannerImpl();
 876                                         addXML11Component(fXML11DocScanner);
 877                           }
 878             if (fCurrentScanner != fXML11DocScanner) {
 879                 fCurrentScanner = fXML11DocScanner;
 880                 setProperty(DOCUMENT_SCANNER, fXML11DocScanner);
 881             }
 882             fXML11DocScanner.setDocumentHandler(fDocumentHandler);
 883 
 884             if (fDocumentHandler != null) {
 885                 fDocumentHandler.setDocumentSource(fXML11DocScanner);
 886             }
 887             fLastComponent = fXML11DocScanner;
 888         }
 889 
 890     } // configureXML11Pipeline()
 891 
 892     /** Configures the pipeline. */
 893     protected void configurePipeline() {
 894         if (fCurrentDVFactory != fDatatypeValidatorFactory) {
 895             fCurrentDVFactory = fDatatypeValidatorFactory;
 896             // use XML 1.0 datatype library
 897             setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
 898         }
 899 
 900         // setup DTD pipeline
 901         if (fCurrentDTDScanner != fDTDScanner) {
 902             fCurrentDTDScanner = fDTDScanner;
 903             setProperty(DTD_SCANNER, fCurrentDTDScanner);
 904         }
 905         fDTDScanner.setDTDHandler(fDTDHandler);
 906         fDTDScanner.setDTDContentModelHandler(fDTDContentModelHandler);
 907 
 908         // setup document pipeline
 909         if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
 910             if (fCurrentScanner != fNamespaceScanner) {
 911                 fCurrentScanner = fNamespaceScanner;
 912                 setProperty(DOCUMENT_SCANNER, fNamespaceScanner);
 913             }
 914             fNamespaceScanner.setDTDValidator(null);
 915             fNamespaceScanner.setDocumentHandler(fDocumentHandler);
 916             if (fDocumentHandler != null) {
 917                 fDocumentHandler.setDocumentSource(fNamespaceScanner);
 918             }
 919             fLastComponent = fNamespaceScanner;
 920         } else {
 921             // create components
 922             if (fNonNSScanner == null) {
 923                 fNonNSScanner = new XMLDocumentScannerImpl();
 924                 // add components
 925                 addComponent((XMLComponent) fNonNSScanner);
 926 
 927             }
 928             if (fCurrentScanner != fNonNSScanner) {
 929                 fCurrentScanner = fNonNSScanner;
 930                 setProperty(DOCUMENT_SCANNER, fNonNSScanner);
 931 
 932             }
 933 
 934             fNonNSScanner.setDocumentHandler(fDocumentHandler);
 935             if (fDocumentHandler != null) {
 936                 fDocumentHandler.setDocumentSource(fNonNSScanner);
 937             }
 938             fLastComponent = fNonNSScanner;
 939         }
 940 
 941     } // configurePipeline()
 942 
 943 
 944     // features and properties
 945 
 946     /**
 947      * Check a feature. If feature is know and supported, this method simply
 948      * returns. Otherwise, the appropriate exception is thrown.
 949      *
 950      * @param featureId The unique identifier (URI) of the feature.
 951      *
 952      * @throws XMLConfigurationException Thrown for configuration error.
 953      *                                   In general, components should
 954      *                                   only throw this exception if
 955      *                                   it is <strong>really</strong>
 956      *                                   a critical error.
 957      */
 958     protected FeatureState checkFeature(String featureId) throws XMLConfigurationException {
 959 
 960         //
 961         // Xerces Features
 962         //
 963 
 964         if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
 965             final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
 966 
 967             //
 968             // http://apache.org/xml/features/validation/dynamic
 969             //   Allows the parser to validate a document only when it
 970             //   contains a grammar. Validation is turned on/off based
 971             //   on each document instance, automatically.
 972             //
 973             if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
 974                 featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
 975                 return FeatureState.RECOGNIZED;
 976             }
 977 
 978             //
 979             // http://apache.org/xml/features/validation/default-attribute-values
 980             //
 981             if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
 982                 featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
 983                 // REVISIT
 984                 return FeatureState.NOT_SUPPORTED;
 985             }
 986             //
 987             // http://apache.org/xml/features/validation/default-attribute-values
 988             //
 989             if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
 990                 featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
 991                 // REVISIT
 992                 return FeatureState.NOT_SUPPORTED;
 993             }
 994             //
 995             // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
 996             //
 997             if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
 998                 featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
 999                 return FeatureState.RECOGNIZED;
1000             }
1001             //
1002             // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
1003             //
1004             if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
1005                 featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
1006                 return FeatureState.RECOGNIZED;
1007             }
1008 
1009             //
1010             // http://apache.org/xml/features/validation/default-attribute-values
1011             //
1012             if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
1013                 featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
1014                 return FeatureState.NOT_SUPPORTED;
1015             }
1016 
1017             // special performance feature: only component manager is allowed to set it.
1018             if (suffixLength == Constants.PARSER_SETTINGS.length() &&
1019                 featureId.endsWith(Constants.PARSER_SETTINGS)) {
1020                 return FeatureState.NOT_SUPPORTED;
1021             }
1022         }
1023 
1024         //
1025         // Not recognized
1026         //
1027 
1028         return super.checkFeature(featureId);
1029 
1030     } // checkFeature(String)
1031 
1032     /**
1033      * Check a property. If the property is know and supported, this method
1034      * simply returns. Otherwise, the appropriate exception is thrown.
1035      *
1036      * @param propertyId The unique identifier (URI) of the property
1037      *                   being set.
1038      *
1039      * @throws XMLConfigurationException Thrown for configuration error.
1040      *                                   In general, components should
1041      *                                   only throw this exception if
1042      *                                   it is <strong>really</strong>
1043      *                                   a critical error.
1044      */
1045     protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException {
1046 
1047         //
1048         // Xerces Properties
1049         //
1050 
1051         if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
1052             final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
1053 
1054             if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
1055                 propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
1056                 return PropertyState.RECOGNIZED;
1057             }
1058         }
1059 
1060         if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
1061             final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
1062 
1063             if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
1064                 propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
1065                 return PropertyState.RECOGNIZED;
1066             }
1067         }
1068 
1069         // special cases
1070         if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
1071             final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
1072 
1073             //
1074             // http://xml.org/sax/properties/xml-string
1075             // Value type: String
1076             // Access: read-only
1077             //   Get the literal string of characters associated with the
1078             //   current event.  If the parser recognises and supports this
1079             //   property but is not currently parsing text, it should return
1080             //   null (this is a good way to check for availability before the
1081             //   parse begins).
1082             //
1083             if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
1084                 propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
1085                 // REVISIT - we should probably ask xml-dev for a precise
1086                 // definition of what this is actually supposed to return, and
1087                 // in exactly which circumstances.
1088                 return PropertyState.NOT_SUPPORTED;
1089             }
1090         }
1091 
1092         //
1093         // Not recognized
1094         //
1095 
1096         return super.checkProperty(propertyId);
1097 
1098     } // checkProperty(String)
1099 
1100 
1101     /**
1102      * Adds a component to the parser configuration. This method will
1103      * also add all of the component's recognized features and properties
1104      * to the list of default recognized features and properties.
1105      *
1106      * @param component The component to add.
1107      */
1108     protected void addComponent(XMLComponent component) {
1109 
1110         // don't add a component more than once
1111         if (fComponents.contains(component)) {
1112             return;
1113         }
1114         fComponents.add(component);
1115         addRecognizedParamsAndSetDefaults(component);
1116 
1117     } // addComponent(XMLComponent)
1118 
1119     /**
1120      * Adds common component to the parser configuration. This method will
1121      * also add all of the component's recognized features and properties
1122      * to the list of default recognized features and properties.
1123      *
1124      * @param component The component to add.
1125      */
1126     protected void addCommonComponent(XMLComponent component) {
1127 
1128         // don't add a component more than once
1129         if (fCommonComponents.contains(component)) {
1130             return;
1131         }
1132         fCommonComponents.add(component);
1133         addRecognizedParamsAndSetDefaults(component);
1134 
1135     } // addCommonComponent(XMLComponent)
1136 
1137     /**
1138      * Adds an XML 1.1 component to the parser configuration. This method will
1139      * also add all of the component's recognized features and properties
1140      * to the list of default recognized features and properties.
1141      *
1142      * @param component The component to add.
1143      */
1144     protected void addXML11Component(XMLComponent component) {
1145 
1146         // don't add a component more than once
1147         if (fXML11Components.contains(component)) {
1148             return;
1149         }
1150         fXML11Components.add(component);
1151         addRecognizedParamsAndSetDefaults(component);
1152 
1153     } // addXML11Component(XMLComponent)
1154 
1155     /**
1156      * Adds all of the component's recognized features and properties
1157      * to the list of default recognized features and properties, and
1158      * sets default values on the configuration for features and
1159      * properties which were previously absent from the configuration.
1160      *
1161      * @param component The component whose recognized features
1162      * and properties will be added to the configuration
1163      */
1164     protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {
1165 
1166         // register component's recognized features
1167         String[] recognizedFeatures = component.getRecognizedFeatures();
1168         addRecognizedFeatures(recognizedFeatures);
1169 
1170         // register component's recognized properties
1171         String[] recognizedProperties = component.getRecognizedProperties();
1172         addRecognizedProperties(recognizedProperties);
1173 
1174         // set default values
1175         if (recognizedFeatures != null) {
1176             for (int i = 0; i < recognizedFeatures.length; ++i) {
1177                 String featureId = recognizedFeatures[i];
1178                 Boolean state = component.getFeatureDefault(featureId);
1179                 if (state != null) {
1180                     // Do not overwrite values already set on the configuration.
1181                     if (!fFeatures.containsKey(featureId)) {
1182                         fFeatures.put(featureId, state);
1183                         // For newly added components who recognize this feature
1184                         // but did not offer a default value, we need to make
1185                         // sure these components will get an opportunity to read
1186                         // the value before parsing begins.
1187                         fConfigUpdated = true;
1188                     }
1189                 }
1190             }
1191         }
1192         if (recognizedProperties != null) {
1193             for (int i = 0; i < recognizedProperties.length; ++i) {
1194                 String propertyId = recognizedProperties[i];
1195                 Object value = component.getPropertyDefault(propertyId);
1196                 if (value != null) {
1197                     // Do not overwrite values already set on the configuration.
1198                     if (!fProperties.containsKey(propertyId)) {
1199                         fProperties.put(propertyId, value);
1200                         // For newly added components who recognize this property
1201                         // but did not offer a default value, we need to make
1202                         // sure these components will get an opportunity to read
1203                         // the value before parsing begins.
1204                         fConfigUpdated = true;
1205                     }
1206                 }
1207             }
1208         }
1209     }
1210 
1211     private void initXML11Components() {
1212         if (!f11Initialized) {
1213 
1214             // create datatype factory
1215             fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
1216 
1217             // setup XML 1.1 DTD pipeline
1218             fXML11DTDScanner = new XML11DTDScannerImpl();
1219             addXML11Component(fXML11DTDScanner);
1220 
1221             // setup XML 1.1. document pipeline - namespace aware
1222             fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
1223             addXML11Component(fXML11NSDocScanner);
1224 
1225             f11Initialized = true;
1226         }
1227     }
1228 
1229 } // class XML11NonValidatingConfiguration