Java XML Transform Usage getSchema(InputStream... inputs)

Here you can find the source of getSchema(InputStream... inputs)

Description

get Schema

License

Apache License

Declaration

public static Schema getSchema(InputStream... inputs) throws SAXException 

Method Source Code

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

import java.io.InputStream;

import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;

import org.xml.sax.SAXException;

public class Main {
    public static Schema getSchema(InputStream... inputs) throws SAXException {
        StreamSource[] streamSource = new StreamSource[inputs.length];

        for (int i = 0; i < inputs.length; i++) {
            streamSource[i] = new StreamSource(inputs[i]);
        }//from  w w w . ja  v a 2  s .  c  o m

        SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = sf.newSchema(streamSource);

        return schema;
    }
}

Related

  1. getDate(final XMLGregorianCalendar xmlGregorianCalendar)
  2. getEmptyXmlFile(File xmlFile)
  3. getImplementationObject()
  4. getNormalizedReader(Reader reader)
  5. getSaxSource(File newFile, SAXParserFactory spf)
  6. getSourceFromEndpointReference(EndpointReference epr)
  7. getStreamSources(File[] stylesheets)
  8. getTemplatesByName(File xslF)
  9. getWSAAddress(W3CEndpointReference ref)