public class

XMLVersionDetector

extends Object
java.lang.Object
   ↳ org.apache.xerces.impl.XMLVersionDetector

Class Overview

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. @xerces.internal

Summary

Constants
String ENTITY_MANAGER Property identifier: entity manager.
String ERROR_REPORTER Property identifier: error reporter.
String SYMBOL_TABLE Property identifier: symbol table.
Fields
protected String fEncoding
protected XMLEntityManager fEntityManager Entity manager.
protected XMLErrorReporter fErrorReporter Error reporter.
protected SymbolTable fSymbolTable Symbol table.
protected static final String fVersionSymbol Symbol: "version".
protected static final String fXMLSymbol
Public Constructors
XMLVersionDetector()
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final String ENTITY_MANAGER

Property identifier: entity manager.

Constant Value: "http://apache.org/xml/properties/internal/entity-manager"

protected static final String ERROR_REPORTER

Property identifier: error reporter.

Constant Value: "http://apache.org/xml/properties/internal/error-reporter"

protected static final String SYMBOL_TABLE

Property identifier: symbol table.

Constant Value: "http://apache.org/xml/properties/internal/symbol-table"

Fields

protected String fEncoding

protected XMLEntityManager fEntityManager

Entity manager.

protected XMLErrorReporter fErrorReporter

Error reporter.

protected SymbolTable fSymbolTable

Symbol table.

protected static final String fVersionSymbol

Symbol: "version".

protected static final String fXMLSymbol

Public Constructors

public XMLVersionDetector ()

Public Methods

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.

Returns
  • short - Constants.XML_VERSION_1_1 if document version 1.1, otherwise Constants.XML_VERSION_1_0
Throws
IOException

public void reset (XMLComponentManager componentManager)

Parameters
componentManager The component manager.
Throws
Throws exception if required features and properties cannot be found.
XMLConfigurationException

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).