/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.apache.org. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.xerces.validators.common;
import org.apache.xerces.framework.XMLAttrList;
import org.apache.xerces.framework.XMLContentSpec;
import org.apache.xerces.framework.XMLDocumentHandler;
import org.apache.xerces.framework.XMLDocumentScanner;
import org.apache.xerces.framework.XMLErrorReporter;
import org.apache.xerces.readers.DefaultEntityHandler;
import org.apache.xerces.readers.XMLEntityHandler;
import org.apache.xerces.utils.ChunkyCharArray;
import org.apache.xerces.utils.NamespacesScope;
import org.apache.xerces.utils.StringPool;
import org.apache.xerces.utils.XMLCharacterProperties;
import org.apache.xerces.utils.XMLMessages;
import org.apache.xerces.utils.ImplementationMessages;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.EntityResolver;
import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
import org.apache.xerces.validators.dtd.DTDImporter;
import org.apache.xerces.validators.schema.SchemaImporter;
import org.apache.xerces.validators.schema.SchemaMessageProvider;
import org.apache.xerces.validators.schema.DatatypeContentModel;
import org.apache.xerces.validators.datatype.InvalidDatatypeValueException;
public final class XMLValidator
implements DefaultEntityHandler.EventHandler,
XMLEntityHandler.CharDataHandler,
XMLDocumentScanner.EventHandler,
NamespacesScope.NamespacesHandler
{
// **** DEBUG ****
static XMLValidator schemaValidator = null;
static boolean DEBUG = false;
// **** DEBUG ****
//
// Debugging options
//
private static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
private static final boolean DEBUG_PRINT_ATTRIBUTES = false;
private static final boolean DEBUG_PRINT_CONTENT = false;
//
// Package access for use by AttributeValidator classes.
//
StringPool fStringPool = null;
boolean fValidating = false;
boolean fInElementContent = false;
int fStandaloneReader = -1;
//
//
//
private XMLErrorReporter fErrorReporter = null;
private DefaultEntityHandler fEntityHandler = null;
private boolean fValidationEnabled = false;
private boolean fDynamicValidation = false;
private boolean fValidationEnabledByDynamic = false;
private boolean fDynamicDisabledByValidation = false;
private boolean fWarningOnDuplicateAttDef = false;
private boolean fWarningOnUndeclaredElements = false;
private int[] fElementTypeStack = new int[8];
private int[] fElementEntityStack = new int[8];
private int[] fElementIndexStack = new int[8];
private int[] fContentSpecTypeStack = new int[8];
private int[] fElementChildCount = new int[8];
private int[][] fElementChildren = new int[8][];
private int fElementDepth = -1;
private boolean fNamespacesEnabled = false;
private NamespacesScope fNamespacesScope = null;
private int fNamespacesPrefix = -1;
private int fRootElementType = -1;
private int fAttrListHandle = -1;
private int fElementDeclCount = 0;
private int fCurrentElementType = -1;
private int fCurrentElementEntity = -1;
private int fCurrentElementIndex = -1;
private int fCurrentContentSpecType = -1;
private boolean fSeenDoctypeDecl = false;
private int fEMPTYSymbol = -1;
private int fANYSymbol = -1;
private int fMIXEDSymbol = -1;
private int fCHILDRENSymbol = -1;
private int fCDATASymbol = -1;
private int fIDSymbol = -1;
private int fIDREFSymbol = -1;
private int fIDREFSSymbol = -1;
private int fENTITYSymbol = -1;
private int fENTITIESSymbol = -1;
private int fNMTOKENSymbol = -1;
private int fNMTOKENSSymbol = -1;
private int fNOTATIONSymbol = -1;
private int fENUMERATIONSymbol = -1;
private int fREQUIREDSymbol = -1;
private int fFIXEDSymbol = -1;
private int fDATATYPESymbol = -1;
private int fEpsilonIndex = -1;
private boolean fScanningDTD = false;
private DTDImporter fDTDImporter = null;
private SchemaImporter fSchemaImporter = null;
private XMLDocumentScanner fDocumentScanner = null;
private boolean fCalledStartDocument = false;
private XMLDocumentHandler fDocumentHandler = null;
private XMLDocumentHandler.DTDHandler fDTDHandler = null;
private boolean fSeenRootElement = false;
private XMLAttrList fAttrList = null;
private int fXMLLang = -1;
private LocatorImpl fAttrNameLocator = null;
private boolean fCheckedForSchema = false;
private Document fSchemaDocument = null;
private boolean fDeclsAreExternal = false;
private StringPool.CharArrayRange fCurrentElementCharArrayRange = null;
private char[] fCharRefData = null;
private boolean fSendCharDataAsCharArray = false;
private boolean fBufferDatatype = false;
private StringBuffer fDatatypeBuffer = new StringBuffer();
//
//
//
public XMLValidator(StringPool stringPool,
XMLErrorReporter errorReporter,
Def
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Xerces-J-src.1.0.4.zip (506个子文件)
structures.dtd 13KB
datatypes.dtd 6KB
personal.dtd 644B
xcatalog.dtd 580B
versionInfo.ent 2KB
entities.ent 1KB
Readme.html 492B
Makefile.incl 2KB
XMLValidator.java 147KB
XMLDTDScanner.java 126KB
DOMParser.java 120KB
UTF8Reader.java 117KB
XMLDocumentScanner.java 99KB
XMLMessages.java 87KB
SchemaImporter.java 67KB
DefaultEntityHandler.java 56KB
DeferredDocumentImpl.java 56KB
SAXParser.java 54KB
Schema.java 53KB
AbstractCharReader.java 52KB
StreamingCharReader.java 50KB
NodeImpl.java 49KB
XMLParser.java 49KB
BaseMarkupSerializer.java 47KB
SchemaParser.java 47KB
DocumentImpl.java 46KB
RangeImpl.java 45KB
DFAContentModel.java 40KB
DefaultImages.java 38KB
XGrammarWriter.java 37KB
StringPool.java 37KB
StringReader.java 36KB
ParentNode.java 36KB
UCSReader.java 35KB
ChildAndParentNode.java 35KB
HTMLSerializer.java 32KB
TreeView.java 31KB
NamedNodeMapImpl.java 30KB
HTMLDocumentImpl.java 28KB
XMLEntityHandler.java 27KB
ParserAdapter.java 27KB
ElementImpl.java 27KB
UTF8CharReader.java 26KB
XMLSerializer.java 25KB
DTDImporter.java 25KB
OutputFormat.java 25KB
TreeWalkerView.java 25KB
XMLMessages.java 24KB
UTF8DataChunk.java 23KB
XMLCharacterProperties.java 22KB
XMLFilterImpl.java 22KB
XCatalog.java 22KB
DatatypeContentModel.java 21KB
IteratorView.java 21KB
MIME2Java.java 21KB
XMLAttrList.java 21KB
HTMLCollectionImpl.java 21KB
SimpleContentModel.java 20KB
HTMLdtd.java 20KB
NamespaceSupport.java 20KB
Document.java 19KB
TimeDurationValidator.java 18KB
TimeInstantValidator.java 17KB
CharDataChunk.java 17KB
AttributesImpl.java 17KB
Node.java 16KB
DOMWriter.java 16KB
CharacterDataImpl.java 16KB
Range.java 16KB
TreeWalkerImpl.java 16KB
Element.java 15KB
DefaultHandler.java 15KB
XMLReader.java 15KB
ContentHandler.java 15KB
XMLDocumentHandler.java 15KB
CharReader.java 15KB
NodeIteratorImpl.java 14KB
DecimalValidator.java 14KB
RevalidatingDOMParser.java 14KB
XMLReaderAdapter.java 14KB
DOMTreeFull.java 14KB
IndentPrinter.java 14KB
TextSerializer.java 13KB
HandlerBase.java 13KB
AttrImpl.java 13KB
XUtil.java 12KB
EntityReferenceImpl.java 12KB
IntegerValidator.java 12KB
HTMLTableElementImpl.java 12KB
SAX2Writer.java 12KB
RealValidator.java 12KB
SAXWriter.java 12KB
UTF8Recognizer.java 12KB
AttributesImpl.java 12KB
DoubleValidator.java 12KB
FloatValidator.java 12KB
DOMAddLines.java 11KB
MixedContentModel.java 11KB
DefaultReaderFactory.java 11KB
HTMLElementImpl.java 11KB
共 506 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
段子手-168
- 粉丝: 2100
- 资源: 2470
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功