org.apache.xerces.impl
Class XMLVersionDetector
java.lang.Object
org.apache.xerces.impl.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 572055 2007-09-02 17:55:43Z mrglavas $
- Author:
- Neil Graham, IBM, Elena Litani, IBM
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLVersionDetector
public XMLVersionDetector()
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 java.io.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:
java.io.IOException