bundles/org.apache.jasper.glassfish/src/org/apache/jasper/xmlparser/ParserUtils.java
private static Schema getSchema(Document document)
            throws SAXException, JasperException {

        Schema schema = null;
        Element root = document.getDocumentElement();
        NamedNodeMap map = root.getAttributes();
        for (int i=0; map!=null && i<map.getLength(); i++) {
            if (SCHEMA_LOCATION_ATTR.equals(map.item(i).getLocalName())) {
                String schemaLocation = map.item(i).getNodeValue();
                if (Constants.SCHEMA_LOCATION_JSP_20.equals(schemaLocation)) {
                    schema = getSchema(
                            Constants.TAGLIB_SCHEMA_PUBLIC_ID_20);
                    break;
                } else if (Constants.SCHEMA_LOCATION_JSP_21.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.TAGLIB_SCHEMA_PUBLIC_ID_21);
                    break;
                } else if (Constants.SCHEMA_LOCATION_WEBAPP_24.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.WEBAPP_SCHEMA_PUBLIC_ID_24);
                    break;
                } else if (Constants.SCHEMA_LOCATION_WEBAPP_25.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.WEBAPP_SCHEMA_PUBLIC_ID_25);
                    break;
                } else {
                    throw new JasperException(Localizer.getMessage(
                        "jsp.error.parse.unknownTldSchemaLocation",
                        document.getDocumentURI(),
                        map.item(i).getNodeValue()));
                }
            }
        }

        return schema;
    }
private static Schema getSchema(Document document)
            throws SAXException, JasperException {

        Schema schema = null;
        Element root = document.getDocumentElement();
        NamedNodeMap map = root.getAttributes();
        for (int i=0; map!=null && i<map.getLength(); i++) {
            if (SCHEMA_LOCATION_ATTR.equals(map.item(i).getLocalName())) {
                String schemaLocation = map.item(i).getNodeValue();
                if (Constants.SCHEMA_LOCATION_JSP_20.equals(schemaLocation)) {
                    schema = getSchema(
                            Constants.TAGLIB_SCHEMA_PUBLIC_ID_20);
                    break;
                } else if (Constants.SCHEMA_LOCATION_JSP_21.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.TAGLIB_SCHEMA_PUBLIC_ID_21);
                    break;
                } else if (Constants.SCHEMA_LOCATION_WEBAPP_24.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.WEBAPP_SCHEMA_PUBLIC_ID_24);
                    break;
                } else if (Constants.SCHEMA_LOCATION_WEBAPP_25.equals(
                                                schemaLocation)) {
                    schema = getSchema(
                            Constants.WEBAPP_SCHEMA_PUBLIC_ID_25);
                    break;
                } else {
                    throw new JasperException(Localizer.getMessage(
                        "jsp.error.parse.unknownTldSchemaLocation",
                        document.getDocumentURI(),
                        map.item(i).getNodeValue()));
                }
            }
        }

        return schema;
    }
private static Schema getSchema ( Document document ) throws SAXException , JasperException { Schema schema = null ; Element root = document . getDocumentElement ( ) ; NamedNodeMap map = root . getAttributes ( ) ; for ( int i = 0 ; map != null && i < map . getLength ( ) ; i ++ ) { if ( SCHEMA_LOCATION_ATTR . equals ( map . item ( i ) . getLocalName ( ) ) ) { String schemaLocation = map . item ( i ) . getNodeValue ( ) ; if ( Constants . SCHEMA_LOCATION_JSP_20 . equals ( schemaLocation ) ) { schema = getSchema ( Constants . TAGLIB_SCHEMA_PUBLIC_ID_20 ) ; break ; } else if ( Constants . SCHEMA_LOCATION_JSP_21 . equals ( schemaLocation ) ) { schema = getSchema ( Constants . TAGLIB_SCHEMA_PUBLIC_ID_21 ) ; break ; } else if ( Constants . SCHEMA_LOCATION_WEBAPP_24 . equals ( schemaLocation ) ) { schema = getSchema ( Constants . WEBAPP_SCHEMA_PUBLIC_ID_24 ) ; break ; } else if ( Constants . SCHEMA_LOCATION_WEBAPP_25 . equals ( schemaLocation ) ) { schema = getSchema ( Constants . WEBAPP_SCHEMA_PUBLIC_ID_25 ) ; break ; } else { throw new JasperException ( Localizer . getMessage ( "jsp.error.parse.unknownTldSchemaLocation" , document . getDocumentURI ( ) , map . item ( i ) . getNodeValue ( ) ) ) ; } } } return schema ; }
/*
Gets the compiled schema referenced by the given XML document.

@param document The XML document to validate

@return The schema against which to validate
/ * Gets the compiled schema referenced by the given XML document .