01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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 org.apache.xerces.impl.dtd;
19:
20: import org.apache.xerces.impl.Constants;
21: import org.apache.xerces.impl.XML11DTDScannerImpl;
22: import org.apache.xerces.impl.XMLDTDScannerImpl;
23: import org.apache.xerces.impl.XMLEntityManager;
24: import org.apache.xerces.impl.XMLErrorReporter;
25: import org.apache.xerces.util.SymbolTable;
26: import org.apache.xerces.util.XML11Char;
27: import org.apache.xerces.xni.grammars.XMLGrammarPool;
28: import org.apache.xerces.xni.parser.XMLEntityResolver;
29:
30: /**
31: * This class extends XMLDTDProcessor by giving it
32: * the ability to parse XML 1.1 documents correctly. It can also be used
33: * as a DTD loader, so that XML 1.1 external subsets can
34: * be processed correctly (hence it's rather anomalous-appearing
35: * derivation from XMLDTDLoader).
36: *
37: * @xerces.internal
38: *
39: * @author Neil Graham, IBM
40: *
41: * @version $Id: XML11DTDProcessor.java 446755 2006-09-15 21:56:27Z mrglavas $
42: */
43: public class XML11DTDProcessor extends XMLDTDLoader {
44:
45: // constructors
46:
47: public XML11DTDProcessor() {
48: super ();
49: } // <init>()
50:
51: public XML11DTDProcessor(SymbolTable symbolTable) {
52: super (symbolTable);
53: } // init(SymbolTable)
54:
55: public XML11DTDProcessor(SymbolTable symbolTable,
56: XMLGrammarPool grammarPool) {
57: super (symbolTable, grammarPool);
58: } // init(SymbolTable, XMLGrammarPool)
59:
60: XML11DTDProcessor(SymbolTable symbolTable,
61: XMLGrammarPool grammarPool, XMLErrorReporter errorReporter,
62: XMLEntityResolver entityResolver) {
63: super (symbolTable, grammarPool, errorReporter, entityResolver);
64: } // init(SymbolTable, XMLGrammarPool, XMLErrorReporter, XMLEntityResolver)
65:
66: // overridden methods
67:
68: protected boolean isValidNmtoken(String nmtoken) {
69: return XML11Char.isXML11ValidNmtoken(nmtoken);
70: } // isValidNmtoken(String): boolean
71:
72: protected boolean isValidName(String name) {
73: return XML11Char.isXML11ValidName(name);
74: } // isValidNmtoken(String): boolean
75:
76: protected XMLDTDScannerImpl createDTDScanner(
77: SymbolTable symbolTable, XMLErrorReporter errorReporter,
78: XMLEntityManager entityManager) {
79: return new XML11DTDScannerImpl(symbolTable, errorReporter,
80: entityManager);
81: } // createDTDScanner(SymbolTable, XMLErrorReporter, XMLEntityManager) : XMLDTDScannerImpl
82:
83: protected short getScannerVersion() {
84: return Constants.XML_VERSION_1_1;
85: } // getScannerVersion() : short
86:
87: } // class XML11DTDProcessor
|