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.xinclude;
19:
20: import java.io.IOException;
21:
22: import org.apache.xerces.util.XML11Char;
23: import org.apache.xerces.xni.parser.XMLInputSource;
24:
25: /**
26: * This class is used for reading resources requested in <include> elements in
27: * XML 1.1 entities, when the parse attribute of the <include> element is "text".
28: * Using this class will open the location, detect the encoding, and discard the
29: * byte order mark, if applicable.
30: *
31: * @author Michael Glavassevich, IBM
32: *
33: * @version $Id: XInclude11TextReader.java 447243 2006-09-18 05:15:27Z mrglavas $
34: *
35: * @see XIncludeHandler
36: */
37: public class XInclude11TextReader extends XIncludeTextReader {
38:
39: /**
40: * Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
41: *
42: * @param source The XMLInputSource to use.
43: * @param handler The XIncludeHandler to use.
44: * @param bufferSize The size of this text reader's buffer.
45: */
46: public XInclude11TextReader(XMLInputSource source,
47: XIncludeHandler handler, int bufferSize) throws IOException {
48: super (source, handler, bufferSize);
49: }
50:
51: /**
52: * Returns true if the specified character is a valid XML character
53: * as per the rules of XML 1.1.
54: *
55: * @param ch The character to check.
56: */
57: protected boolean isValid(int ch) {
58: return XML11Char.isXML11Valid(ch);
59: }
60: }
|