1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package xni.parser; 19 20 import org.apache.xerces.impl.XMLNamespaceBinder; 21 import org.apache.xerces.impl.dtd.XMLDTDValidator; 22 import org.apache.xerces.parsers.StandardParserConfiguration; 23 import org.apache.xerces.xni.parser.XMLComponent; 24 import org.apache.xerces.xni.parser.XMLParserConfiguration; 25 26 /** 27 * Non-validating parser configuration. 28 * 29 * @see XMLComponent 30 * @see XMLParserConfiguration 31 * 32 * @author Andy Clark, IBM 33 * 34 * @version $Id: NonValidatingParserConfiguration.java 447690 2006-09-19 02:41:53Z mrglavas $ 35 */ 36 public class NonValidatingParserConfiguration 37 extends StandardParserConfiguration { 38 39 // 40 // Data 41 // 42 43 // components (configurable) 44 45 /** Namespace binder. */ 46 protected XMLNamespaceBinder fNamespaceBinder; 47 48 // 49 // Constructors 50 // 51 52 /** 53 * Constructs a document parser using the default symbol table and grammar 54 * pool or the ones specified by the application (through the properties). 55 */ 56 public NonValidatingParserConfiguration() { 57 58 // create and register missing components 59 fNamespaceBinder = new XMLNamespaceBinder(); 60 addComponent(fNamespaceBinder); 61 62 } // <init>() 63 64 // 65 // Protected methods 66 // 67 68 /** Configures the pipeline. */ 69 protected void configurePipeline() { 70 71 // REVISIT: This should be better designed. In other words, we 72 // need to figure out what is the best way for people to 73 // re-use *most* of the standard configuration but do 74 // common things such as remove a component (e.g.the 75 // validator), insert a new component (e.g. XInclude), 76 // etc... -Ac 77 78 // setup document pipeline 79 fScanner.setDocumentHandler(fNamespaceBinder); 80 fNamespaceBinder.setDocumentHandler(fDocumentHandler); 81 fNamespaceBinder.setDocumentSource(fScanner); 82 83 } // configurePipeline() 84 85 // factory methods 86 87 /** Create a null validator. */ 88 protected XMLDTDValidator createDTDValidator() { 89 return null; 90 } // createDTDValidator():XMLDTDValidator 91 92 } // class NonValidatingParserConfiguration