bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ParserController.java
private boolean hasJspRoot(JspReader reader) throws JasperException {

	// <prefix>:root must be the first element
	Mark start = null;
	while ((start = reader.skipUntil("<")) != null) {
	    int c = reader.nextChar();
	    if (c != '!' && c != '?') break;
	}
	if (start == null) {
	    return false;
	}
	Mark stop = reader.skipUntil(":root");
	if (stop == null) {
	    return false;
	}
	// call substring to get rid of leading '<'
	String prefix = reader.getText(start, stop).substring(1);

	start = stop;
	stop = reader.skipUntil(">");
	if (stop == null) {
	    return false;
	}

	// Determine namespace associated with <root> element's prefix
	String root = reader.getText(start, stop);
	String xmlnsDecl = "xmlns:" + prefix;
	int index = root.indexOf(xmlnsDecl);
	if (index == -1) {
	    return false;
	}
	index += xmlnsDecl.length();
	while (index < root.length()
	           && Character.isWhitespace(root.charAt(index))) {
	    index++;
	}
	if (index < root.length() && root.charAt(index) == '=') {
	    index++;
	    while (index < root.length()
		       && Character.isWhitespace(root.charAt(index))) {
		index++;
	    }
	    if (index < root.length() && root.charAt(index++) == '"'
		    && root.regionMatches(index, JSP_URI, 0,
					  JSP_URI.length())) {
		return true;
	    }
	}

	return false;
    }
private boolean hasJspRoot(JspReader reader) throws JasperException {

	// <prefix>:root must be the first element
	Mark start = null;
	while ((start = reader.skipUntil("<")) != null) {
	    int c = reader.nextChar();
	    if (c != '!' && c != '?') break;
	}
	if (start == null) {
	    return false;
	}
	Mark stop = reader.skipUntil(":root");
	if (stop == null) {
	    return false;
	}
	// call substring to get rid of leading '<'
	String prefix = reader.getText(start, stop).substring(1);

	start = stop;
	stop = reader.skipUntil(">");
	if (stop == null) {
	    return false;
	}

	// Determine namespace associated with <root> element's prefix
	String root = reader.getText(start, stop);
	String xmlnsDecl = "xmlns:" + prefix;
	int index = root.indexOf(xmlnsDecl);
	if (index == -1) {
	    return false;
	}
	index += xmlnsDecl.length();
	while (index < root.length()
	           && Character.isWhitespace(root.charAt(index))) {
	    index++;
	}
	if (index < root.length() && root.charAt(index) == '=') {
	    index++;
	    while (index < root.length()
		       && Character.isWhitespace(root.charAt(index))) {
		index++;
	    }
	    if (index < root.length() && root.charAt(index++) == '"'
		    && root.regionMatches(index, JSP_URI, 0,
					  JSP_URI.length())) {
		return true;
	    }
	}

	return false;
    }
private boolean hasJspRoot ( JspReader reader ) throws JasperException { // <prefix>:root must be the first element Mark start = null ; while ( ( start = reader . skipUntil ( "<" ) ) != null ) { int c = reader . nextChar ( ) ; if ( c != ' ' && c != ' ' ) break ; } if ( start == null ) { return false ; } Mark stop = reader . skipUntil ( ":root" ) ; if ( stop == null ) { return false ; } // call substring to get rid of leading '<' String prefix = reader . getText ( start , stop ) . substring ( 1 ) ; start = stop ; stop = reader . skipUntil ( ">" ) ; if ( stop == null ) { return false ; } // Determine namespace associated with <root> element's prefix String root = reader . getText ( start , stop ) ; String xmlnsDecl = "xmlns:" + prefix ; int index = root . indexOf ( xmlnsDecl ) ; if ( index == - 1 ) { return false ; } index += xmlnsDecl . length ( ) ; while ( index < root . length ( ) && Character . isWhitespace ( root . charAt ( index ) ) ) { index ++ ; } if ( index < root . length ( ) && root . charAt ( index ) == ' ' ) { index ++ ; while ( index < root . length ( ) && Character . isWhitespace ( root . charAt ( index ) ) ) { index ++ ; } if ( index < root . length ( ) && root . charAt ( index ++ ) == ' ' && root . regionMatches ( index , JSP_URI , 0 , JSP_URI . length ( ) ) ) { return true ; } } return false ; }
/*
Checks to see if the given page contains, as its first element, a <root>
element whose prefix is bound to the JSP namespace, as in:

<wombat:root xmlns:wombat="http://java.sun.com/JSP/Page" version="1.2">
...
</wombat:root>

@param reader The reader for this page

@return true if this page contains a root element whose prefix is bound
to the JSP namespace, and false otherwise
/ * Checks to see if the given page contains as its first element a <root > element whose prefix is bound to the JSP namespace as in :