Class XMLParser
- java.lang.Object
-
- de.uni_trier.wi2.procake.utils.io.xerces.XMLParser
-
- Direct Known Subclasses:
DTDBasedParser,XMLSchemaBasedParser
public class XMLParser extends Object
A XMLParser that uses the xerces package from the Apache group, see http://xerces.apache.org/.Usage
XMLParser parser = new XMLParser(this.getClass().getClassLoader()); parser.setContentHandler(new DefaultHandler()); // use your own DefaultHandler parser.setFilename("filename.xml"); parser.read();- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description protected VectordtdGrammarsstatic StringGRAMMAR_POOLProperty identifier: grammar pool.protected static StringNAMESPACES_FEATURE_IDNamespaces feature id (http://xml.org/sax/features/namespaces).protected static StringSCHEMA_FULL_CHECKING_FEATURE_IDSchema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).protected static StringSCHEMA_VALIDATION_FEATURE_IDSchema validation feature id (http://apache.org/xml/features/validation/schema).protected VectorschemaGrammarsstatic StringSYMBOL_TABLEProperty identifier: symbol table.static intTYPE_DTDstatic intTYPE_SCHEMAprotected static StringVALIDATION_FEATURE_IDValidation feature id (http://xml.org/sax/features/validation).protected static StringXINCLUDE_FEATURE_IDFeature ID to enable XInclude processing.protected static StringXINCLUDE_FIXUP_FEATURE_IDFeature ID to perform base URI fixup as specified by the XInclude Recommendation.
-
Constructor Summary
Constructors Constructor Description XMLParser()XMLParser(ClassLoader cl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentHandlergetContentHandler()ResourceEntityResolvergetEntityResolver()ErrorHandlergetErrorHandler()StringgetFilename()booleanisCheckFullSchema()booleanisCheckNamespace()booleanisIncludeEnabled()booleanisValidate()booleanisValidateSchema()voidread()voidsetCheckFullSchema(boolean checkFullSchema)voidsetCheckNamespace(boolean checkNamespace)voidsetConfigurationFile(String configurationFile)voidsetContentHandler(ContentHandler contentHandler)voidsetErrorHandler(ErrorHandler errorHandler)voidsetFilename(String filename)voidsetIncludeEnabled(boolean includeEnabled)voidsetInputSource(InputSource inputSource)voidsetInputStream(InputStream is)voidsetReader(Reader reader)voidsetValidate(boolean validate)voidsetValidateSchema(boolean validateSchema)protected org.apache.xerces.xni.parser.XMLInputSourcestringToXIS(String uri)
-
-
-
Field Detail
-
GRAMMAR_POOL
public static final String GRAMMAR_POOL
Property identifier: grammar pool.- See Also:
- Constant Field Values
-
SYMBOL_TABLE
public static final String SYMBOL_TABLE
Property identifier: symbol table.- See Also:
- Constant Field Values
-
TYPE_DTD
public static final int TYPE_DTD
- See Also:
- Constant Field Values
-
TYPE_SCHEMA
public static final int TYPE_SCHEMA
- See Also:
- Constant Field Values
-
NAMESPACES_FEATURE_ID
protected static final String NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).- See Also:
- Constant Field Values
-
SCHEMA_FULL_CHECKING_FEATURE_ID
protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).- See Also:
- Constant Field Values
-
SCHEMA_VALIDATION_FEATURE_ID
protected static final String SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema).- See Also:
- Constant Field Values
-
VALIDATION_FEATURE_ID
protected static final String VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).- See Also:
- Constant Field Values
-
XINCLUDE_FEATURE_ID
protected static final String XINCLUDE_FEATURE_ID
Feature ID to enable XInclude processing. See http://xerces.apache.org/xerces2-j/features.html#xinclude- See Also:
- Constant Field Values
-
XINCLUDE_FIXUP_FEATURE_ID
protected static final String XINCLUDE_FIXUP_FEATURE_ID
Feature ID to perform base URI fixup as specified by the XInclude Recommendation. See http://xerces.apache.org/xerces2-j/features.html#xinclude.fixup-base-uris- See Also:
- Constant Field Values
-
dtdGrammars
protected Vector dtdGrammars
-
schemaGrammars
protected Vector schemaGrammars
-
-
Constructor Detail
-
XMLParser
public XMLParser()
-
XMLParser
public XMLParser(ClassLoader cl)
-
-
Method Detail
-
getContentHandler
public ContentHandler getContentHandler()
-
setContentHandler
public void setContentHandler(ContentHandler contentHandler)
-
getEntityResolver
public ResourceEntityResolver getEntityResolver()
-
getErrorHandler
public ErrorHandler getErrorHandler()
-
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
-
getFilename
public String getFilename()
-
setFilename
public void setFilename(String filename)
-
setInputSource
public void setInputSource(InputSource inputSource)
-
isCheckFullSchema
public boolean isCheckFullSchema()
-
setCheckFullSchema
public void setCheckFullSchema(boolean checkFullSchema)
-
isCheckNamespace
public boolean isCheckNamespace()
-
setCheckNamespace
public void setCheckNamespace(boolean checkNamespace)
-
isValidate
public boolean isValidate()
-
setValidate
public void setValidate(boolean validate)
-
isValidateSchema
public boolean isValidateSchema()
-
setValidateSchema
public void setValidateSchema(boolean validateSchema)
-
isIncludeEnabled
public boolean isIncludeEnabled()
-
setIncludeEnabled
public void setIncludeEnabled(boolean includeEnabled)
-
read
public void read() throws SAXException, IOException- Throws:
SAXExceptionIOException
-
setConfigurationFile
public void setConfigurationFile(String configurationFile)
- Parameters:
configurationFile-
-
setInputStream
public void setInputStream(InputStream is)
-
setReader
public void setReader(Reader reader)
-
stringToXIS
protected org.apache.xerces.xni.parser.XMLInputSource stringToXIS(String uri)
-
-