org.apache.xerces.impl

Class XMLVersionDetector


public class XMLVersionDetector
extends java.lang.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 $
Authors:
Neil Graham, IBM
Elena Litani, IBM

Field Summary

protected static String
ENTITY_MANAGER
Property identifier: entity manager.
protected static String
ERROR_REPORTER
Property identifier: error reporter.
protected static String
SYMBOL_TABLE
Property identifier: symbol table.
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

Method Summary

short
determineDocVersion(org.apache.xerces.xni.parser.XMLInputSource inputSource)
This methods scans the XML declaration to find out the version (and provisional encoding) of the document.
void
reset(org.apache.xerces.xni.parser.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 Details

ENTITY_MANAGER

protected static final String ENTITY_MANAGER
Property identifier: entity manager.

ERROR_REPORTER

protected static final String ERROR_REPORTER
Property identifier: error reporter.

SYMBOL_TABLE

protected static final String SYMBOL_TABLE
Property identifier: symbol table.

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

Method Details

determineDocVersion

public short determineDocVersion(org.apache.xerces.xni.parser.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

reset

public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
            throws org.apache.xerces.xni.parser.XMLConfigurationException
Parameters:
componentManager - The component manager.

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 B) 1999-2005 Apache XML Project. All Rights Reserved.