org.apache.xerces.impl

Class 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: XMLVersionDetector.java,v 1.14 2004/10/04 21:45:48 mrglavas Exp $

Author: Neil Graham, IBM Elena Litani, IBM

UNKNOWN:

Field Summary
protected static StringENTITY_MANAGER
Property identifier: entity manager.
protected static StringERROR_REPORTER
Property identifier: error reporter.
protected StringfEncoding
protected XMLEntityManagerfEntityManager
Entity manager.
protected XMLErrorReporterfErrorReporter
Error reporter.
protected SymbolTablefSymbolTable
Symbol table.
protected static StringfVersionSymbol
Symbol: "version".
protected static StringfXMLSymbol
protected static StringSYMBOL_TABLE
Property identifier: symbol table.
Method Summary
shortdetermineDocVersion(XMLInputSource inputSource)
This methods scans the XML declaration to find out the version (and provisional encoding) of the document.
voidreset(XMLComponentManager componentManager)
voidstartDocumentParsing(XMLEntityHandler scanner, short version)
Reset the reference to the appropriate scanner given the version of the document and start document scanning.

Field Detail

ENTITY_MANAGER

protected static final String ENTITY_MANAGER
Property identifier: entity manager.

ERROR_REPORTER

protected static final String ERROR_REPORTER
Property identifier: error reporter.

fEncoding

protected String fEncoding

fEntityManager

protected XMLEntityManager fEntityManager
Entity manager.

fErrorReporter

protected XMLErrorReporter fErrorReporter
Error reporter.

fSymbolTable

protected SymbolTable fSymbolTable
Symbol table.

fVersionSymbol

protected static final String fVersionSymbol
Symbol: "version".

fXMLSymbol

protected static final String fXMLSymbol

SYMBOL_TABLE

protected static final String SYMBOL_TABLE
Property identifier: symbol table.

Method Detail

determineDocVersion

public short determineDocVersion(XMLInputSource inputSource)
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

reset

public void reset(XMLComponentManager componentManager)

Parameters: componentManager The component manager.

Throws: SAXException Throws exception if required features and properties cannot be found.

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 use version - the version of the document (XML 1.1 or XML 1.0).

Copyright © 1999-2005 Apache XML Project. All Rights Reserved.