Java XML SAX Parser getSchemaFromResource(URL schemaURL)

Here you can find the source of getSchemaFromResource(URL schemaURL)

Description

get Schema From Resource

License

Apache License

Declaration

public static Schema getSchemaFromResource(URL schemaURL) throws SAXException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URL;

import javax.xml.XMLConstants;

import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;

import org.xml.sax.SAXException;

public class Main {
    public static Schema getSchemaFromResource(URL schemaURL) throws SAXException {
        SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = sf.newSchema(schemaURL);
        return schema;
    }//from   w  ww  .  ja  va2 s  .  c  o m
}

Related

  1. getSAXParser()
  2. getSAXParserFactory()
  3. getSAXSDDriver()
  4. getSchema(File xsd, ErrorHandler errorHandler)
  5. getSchema(URL xml_schema)
  6. getXIncludeXMLReader()
  7. getXmlReader()
  8. isWellFormedXml(final String string)
  9. isXML(final byte[] data)