Code example for SchemaFactory

Methods: newSchema

0
        { 
            // Load factory 
            schemaFactory = SchemaFactory.newInstance(XML_SCHEMA);
             
            // Load Map schema 
            schema = schemaFactory.newSchema(new File("maps/mapSchema.xsd"));
        }  
         
        // Problem loading schema 
        catch (Exception e) {
            System.out.println(e.toString());
        } 
    } 
     
    // Set up our SAX Parser 
    private void loadParser() 
    { 
        // Schema must be loaded first 
        //if (schema == null || parser != null) return; 
        if (parser != null) return;