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$
    Author:
    Neil Graham, IBM, Elena Litani, IBM
    • Field Detail

      • fVersionSymbol

        protected static final String fVersionSymbol
        Symbol: "version".
      • fXMLSymbol

        protected static final String fXMLSymbol
      • fSymbolTable

        protected SymbolTable fSymbolTable
        Symbol table.
      • fEncoding

        protected String fEncoding
    • Constructor Detail

      • XMLVersionDetector

        public XMLVersionDetector()
    • Method Detail

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