Class XMLVersionDetector
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.XMLVersionDetector
-
public class XMLVersionDetector extends Object
This class scans the version of the document to determine which scanner to use: XML 1.1 or XML 1.0. The version is scanned using XML 1.1. scanner.- Version:
- $Id$
- Author:
- Neil Graham, IBM, Elena Litani, IBM
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ENTITY_MANAGER
Property identifier: entity manager.protected static String
ERROR_REPORTER
Property identifier: error reporter.protected String
fEncoding
protected XMLEntityManager
fEntityManager
Entity manager.protected XMLErrorReporter
fErrorReporter
Error reporter.protected SymbolTable
fSymbolTable
Symbol table.protected static String
fVersionSymbol
Symbol: "version".protected static String
fXMLSymbol
protected static String
SYMBOL_TABLE
Property identifier: symbol table.
-
Constructor Summary
Constructors Constructor Description XMLVersionDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
determineDocVersion(XMLInputSource inputSource)
This methods scans the XML declaration to find out the version (and provisional encoding) of the document.void
reset(XMLComponentManager componentManager)
void
startDocumentParsing(XMLEntityHandler scanner, short version)
Reset the reference to the appropriate scanner given the version of the document and start document scanning.
-
-
-
Field Detail
-
SYMBOL_TABLE
protected static final String SYMBOL_TABLE
Property identifier: symbol table.- See Also:
- Constant Field Values
-
ERROR_REPORTER
protected static final String ERROR_REPORTER
Property identifier: error reporter.- See Also:
- Constant Field Values
-
ENTITY_MANAGER
protected static final String ENTITY_MANAGER
Property identifier: entity manager.- See Also:
- Constant Field Values
-
fVersionSymbol
protected static final String fVersionSymbol
Symbol: "version".
-
fXMLSymbol
protected static final String fXMLSymbol
-
fSymbolTable
protected SymbolTable fSymbolTable
Symbol table.
-
fErrorReporter
protected XMLErrorReporter fErrorReporter
Error reporter.
-
fEntityManager
protected XMLEntityManager fEntityManager
Entity manager.
-
fEncoding
protected String fEncoding
-
-
Method Detail
-
reset
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
- Parameters:
componentManager
- The component manager.- Throws:
XNIException
- Throws exception if required features and properties cannot be found.XMLConfigurationException
-
startDocumentParsing
public void startDocumentParsing(XMLEntityHandler scanner, short version)
Reset the reference to the appropriate scanner given the version of the document and start document scanning.- Parameters:
scanner
- - the scanner to useversion
- - the version of the document (XML 1.1 or XML 1.0).
-
determineDocVersion
public short determineDocVersion(XMLInputSource inputSource) throws IOException
This methods scans the XML declaration to find out the version (and provisional encoding) of the document. The scanning is doing using XML 1.1 scanner.- Parameters:
inputSource
-- Returns:
- short - Constants.XML_VERSION_1_1 if document version 1.1, otherwise Constants.XML_VERSION_1_0
- Throws:
IOException
-
-