Examples of DeclScanner


Examples of org.exist.xquery.parser.DeclScanner

     * @return QName describing the module namespace or null if the source is not
     * a module.
     */
    protected final static QName getModuleDecl(InputStream is) {
        final XQueryLexer lexer = new XQueryLexer(null, new InputStreamReader(is));
        final DeclScanner scanner = new DeclScanner(lexer);
        try {
            scanner.versionDecl();
        } catch (final RecognitionException e) {
            //Nothing to do
        } catch (final TokenStreamException e) {
            //Nothing to do
        } catch (final XPathException e) {
            //Nothing to do
        }
        if (scanner.getNamespace() != null) {
            return new QName(scanner.getPrefix(), scanner.getNamespace());
        }
        return null;
    }
View Full Code Here

Examples of org.exist.xquery.parser.DeclScanner

     * @param is
     * @return The guessed encoding.
     */
    protected final static String guessXQueryEncoding(InputStream is) {
        final XQueryLexer lexer = new XQueryLexer(null, new InputStreamReader(is));
        final DeclScanner scanner = new DeclScanner(lexer);
        try {
            scanner.versionDecl();
        } catch (final RecognitionException e) {
            //Nothing to do
        } catch (final TokenStreamException e) {
            //Nothing to do
        } catch (final XPathException e) {
            //Nothing to do
        }
        return scanner.getEncoding();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.